pi-tilth
v1.1.1
Published
AST-aware code reading via tilth — replaces read/grep/find/ls tools
Readme
pi-tilth
Pi extension that registers tilth as a native tool for the LLM.
Tilth is an AST-aware code reading CLI powered by tree-sitter. It replaces read, grep, find, and ls with a single smart tool that understands code structure — showing definitions first, resolving callee chains, and supporting glob-based file listing plus slash-wrapped regex content search.
Requirements
- tilth CLI installed and available in PATH
Install
pi install npm:pi-tilthOr from GitHub:
pi install https://github.com/sting8k/pi-tilthOr try without installing:
pi -e https://github.com/sting8k/pi-tilthFeatures
- Tool registration —
tilthavailable as a native Pi tool with structured params (query, scope, section, budget, map) - Query modes —
querycan be a file path, symbol, glob, plain text, or slash-wrapped regex content search like/handle(Auth|Login)/ - Regex caveat — upstream tilth supports
/<pattern>/regex content search, but some regex patterns that contain glob-like characters may still be classified as globs first - Mode toggle —
/tilth [on|off]enables/disables tilth mode, removing built-in tools when active - Persistent config — state saved to
~/.pi/agent/settings.jsonunder"pi-tilth"key - Auto-enable — restores tilth mode on session start based on saved config
- Styled rendering — custom
renderCall/renderResultwith badge, bold params, and line count summary - Nudge hints — when tilth mode is on, appends a
[tilth]hint to bash tool output if the command usesrg,grep,find,fd,cat, etc., reminding the agent to prefer tilth - Remote command detection — automatically skips nudge hints for remote commands (
ssh,sshpass,scp,rsync,docker exec,kubectl exec) since tilth only works locally
Commands
| Command | Description |
|---------|-------------|
| /tilth | Enable tilth mode (default) |
| /tilth on | Enable tilth mode |
| /tilth off | Disable tilth mode, restore built-in tools |
