@balaenis/pi-format

pi format support

Packages

Package details

extension

Install @balaenis/pi-format from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@balaenis/pi-format
Package
@balaenis/pi-format
Version
0.2.1
Published
Aug 28, 2026
Downloads
304/mo · 45/wk
Author
pzyyll
License
Apache-2.0
Types
extension
Size
37.2 KB
Dependencies
0 dependencies · 4 peers
Pi manifest JSON
{
  "extensions": [
    "./dist/index.js"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

@balaenis/pi-format

Format files from Pi using project-local formatters. Provides an LLM-callable format tool, a /format slash command, and automatic formatting after successful built-in write/edit tool calls.

Features

  • Explicit formatting via the format tool or /format command
  • Automatic formatting after Pi's built-in write and edit tools succeed
  • Built-in detection for Biome, Oxfmt, Prettier, Ruff, gofmt, rustfmt, shfmt, and clang-format
  • User-defined formatters and per-project overrides via JSONC config

Local development

The package is not published to a registry yet. Build it and load it with -e:

mise run build --package packages/pi-format
pi -e ./packages/pi-format/dist/index.js

Documentation

  • Tutorial: Format files from Pi - load the extension, format a file, observe format-on-write
  • How-to guides - toggle format-on-write, add custom formatters, override or disable built-ins
  • Reference - config fields, built-in recipes, /format syntax
  • Explanation - how auto-format hooks into write/edit, detection rules, best-effort semantics

Development

mise run test --package packages/pi-format
mise run typecheck --package packages/pi-format
mise run build --package packages/pi-format
hk check

License

See LICENSE.