Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (pi-fallow) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Pi Fallow extension
A Pi coding-agent extension that exposes Fallow as an LLM-callable tool.
Fallow docs analysis
Fetched Fallow's docs index plus the LLM bundle (/llms.txt, /llms-full.txt). Key points for a Pi integration:
- Fallow is codebase intelligence for TypeScript/JavaScript.
- The free static layer covers dead code, unused exports/files/dependencies/types, duplication, complexity/health, architecture boundaries, feature flags, and auto-fix.
- The optional runtime layer adds hot/cold path and runtime-backed deletion evidence.
- The docs explicitly recommend agents use
--format jsonfor structured output. - The MCP tools are thin wrappers around CLI commands, so a Pi extension can get equivalent value by wrapping the CLI safely.
- Useful agent commands map to:
fallow,dead-code,dupes,health,audit,fix --dry-run,fix --yes,list, traces, andcoverage analyze. - Fallow exit code
1means issues/gate failure, not tool execution failure; only2+should be treated as command errors.
What this extension adds
- LLM tool:
fallow_run - Slash command:
/fallow ...with autocomplete for Fallow commands and common flags (type/fallowand press Tab to pick a subcommand). Branch refs for--base/--changed-sinceare populated from the current repo when possible. - Command shortcuts:
/fallow prmaps toauditwith detected base ref andnew-onlygate default;/fallow rerunre-runs the previous slash command. - Automatic JSON + quiet output for modeled tool calls
- Uses
FALLOW_BINif set, otherwisefallowfromPATH, falling back tonpx -y fallow - Truncates large output to Pi's default limits and saves full JSON to a temp file
- Compact TUI rendering with expandable command/summary details
- Interactive bordered issue navigator for
/fallow ...: arrow keys orj/kmove, Enter/Space expands the selected finding,sselects/unselects,e/aloads selected findings into the editor so you can add comments before submitting,trunstrace-filefor the selected finding when possible, andq/Esc closes. The regular Pi transcript only gets a compact summary while details live in the navigator.
File layout
.fallowrc.json— Fallow entry-point and component callback configuration for local health/dead-code checksextensions/index.ts— extension entrypoint and Pi registration (shimmed viaextensions/fallow.tsfor compatibility)extensions/fallow/schema.ts— tool parameter schemaextensions/fallow/autocomplete.ts—/fallowcommand and flag autocompleteextensions/fallow/cli.ts— CLI argument building and process executionextensions/fallow/output.ts— JSON parsing, summaries, truncationextensions/fallow/overview.ts— maps Fallow JSON to overview dataextensions/fallow/ui.ts— pi-tui overview componentextensions/fallow/project/— Fallow project/git status detection and rendering helpersextensions/fallow/pr-summary/— PR gate summary extraction and rendering helpersextensions/fallow/engine.ts— unified command execution + formatting pipelineextensions/fallow/summary/— shared summary formatting/rendering helpersextensions/fallow/types.ts— shared types
Install / test
Install this repository as a Pi package:
# Global install for your user
pi install .
# Or project-local install, written to .pi/settings.json
pi install -l .Try it for one Pi run without installing:
pi -e .Install from git:
pi install git:github.com/revazi/pi-fallowAfter publishing to npm, install with:
pi install npm:pi-fallowpackage.json declares the Pi package entrypoint:
{
"keywords": ["pi-package", "pi-extension"],
"pi": {
"extensions": ["./extensions/index.ts"]
}
}Publishing to the Pi package gallery
Pi's package gallery discovers npm packages tagged with the pi-package keyword. This package is set up for that flow:
Pick and add a license before publishing if you want the package to be open source.
Verify the npm tarball contents:
npm run pack:checkPublish to npm:
npm publish --access public
Install the published package in Pi:
pi install npm:pi-fallow
After npm publishing, the Pi gallery should pick it up from the pi-package keyword. To add a gallery preview, add a public MP4 pi.video or PNG/JPEG/GIF/WebP pi.image URL in the pi manifest.
License
MIT © Revaz Zakalashvili
Examples
Ask Pi:
- "Run a Fallow audit for this PR and fix any introduced dead code."
- "Use Fallow to find duplicate code, then trace the largest clone group before refactoring."
- "Run Fallow health with file scores and targets; propose the safest low-effort refactor."
- "Preview Fallow auto-fixes, then apply the safe ones."
Or run manually in Pi:
/fallow all
/fallow pr
/fallow pr --base develop --gate all
/fallow rerun
/fallow audit --base main --gate new-only
/fallow audit --base origin/main --gate new-only
/fallow check-changed --changed-since main
/fallow dead-code --changed-since main
/fallow dupes --changed-since main
/fallow health --changed-since main
/fallow trace-file extensions/fallow/ui.ts
/fallow health --file-scores --targets --score --format json --quiet