← Catalog

@diegopetrucci/pi-inline-bash

A pi extension that expands inline bash commands in user prompts.

Prompt

Install

Install with PiG

pig install npm:@diegopetrucci/pi-inline-bash

Install with Pi

pi install npm:@diegopetrucci/pi-inline-bash
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 0.1.17 (README.md). PiG does not review it.

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, 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 input event.
  • Inline commands run through bash -c with 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-gate does not intercept these user-prompt expansions because they run before agent tool calls.