@diegopetrucci/pi-inline-bash
A pi extension that expands inline bash commands in user prompts.
Package details
Install @diegopetrucci/pi-inline-bash from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@diegopetrucci/pi-inline-bash- Package
@diegopetrucci/pi-inline-bash- Version
0.1.2- Published
- Jun 1, 2026
- Downloads
- 465/mo · 26/wk
- Author
- diegopetrucci
- License
- MIT
- Types
- extension
- Size
- 5.7 KB
- Dependencies
- 0 dependencies · 1 peer
Pi manifest JSON
{
"extensions": [
"index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
inline-bash
A pi extension that expands inline bash commands in user prompts before they are sent to the agent.
This started from the original inline-bash.ts example in earendil-works/pi-mono, with small packaging and safety tweaks.
Usage
Write inline commands with !{...}:
What's in !{pwd}?
The current branch is !{git branch --show-current} and status: !{git status --short}
My node version is !{node --version}
The extension runs each command and replaces the !{command} pattern with trimmed stdout or stderr. Each expansion is capped at 50,000 characters.
Whole-line !command syntax is left alone so pi's built-in shell-command behavior still works.
Install
Standalone npm package
pi install npm:@diegopetrucci/pi-inline-bash
Collection package
pi install npm:@diegopetrucci/pi-extensions
GitHub package
pi install git:github.com/diegopetrucci/pi-extensions
Then reload pi:
/reload
Notes
- Hooks the
inputevent. - Inline commands run through
bash -cwith a 30-second timeout. - Extension-injected follow-up messages are ignored to avoid implicit shell execution from other extensions.
- In interactive mode, pi shows a notification summarizing the expanded commands.
- Treat prompt text containing
!{...}as shell code; only use this extension where prompt authors are trusted. permission-gatedoes not intercept these user-prompt expansions because they run before agent tool calls.