@bytetrue/pi-background-terminal
Pi extension: run a shell command in the background, check on it, stop it, get notified when it finishes. Does not override bash.
Package details
Install @bytetrue/pi-background-terminal from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@bytetrue/pi-background-terminal- Package
@bytetrue/pi-background-terminal- Version
0.4.0- Published
- Aug 11, 2026
- Downloads
- 609/mo · 336/wk
- Author
- bytetrue
- License
- MIT
- Types
- extension
- Size
- 20.1 KB
- Dependencies
- 0 dependencies · 2 peers
Pi manifest JSON
{
"extensions": [
"./src/index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
@bytetrue/pi-background-terminal
Three independent tools that use Pi's local bash execution backend to run a shell command in the background, check on it, and stop it — without overriding the built-in bash tool — plus a /background menu for users.
background_runstarts a command and returns immediately with a task id; the command keeps running.background_statusreports one task's status, exit code, and output file.background_killstops a running one.- When a task finishes normally, a follow-up message wakes the agent automatically; manually stopped tasks are silent.
- Output streams to a file as it's produced; use the built-in
readtool on that path for the full output instead of getting it dumped inline, which keeps a long command's output from flooding context. - Task lifetime matches the current Pi session; a real session end (not
/reload) waits for and stops all owned processes, then deletes their output files. Tasks survive/reload, which re-evaluates the extension module. - The footer shows
bg:Nwhile this session has running tasks; it disappears at zero.
Install
pi install npm:@bytetrue/pi-background-terminal
User command
/background
Opens a menu for the current session's running background commands. Select a command to open its output in the native editor, stop it, or return to the list. The menu owns the selection flow; users do not need to remember task ids.
Tools
background_run
command(required)
Returns a task id and the output file path immediately. Use this only for a command that must outlive the tool call (a dev server, a watch mode, a long build/test); for anything that finishes on its own, use bash.
background_status
id(required) — task id returned bybackground_run
Returns status (running/exited/killed/failed), exit code, output file path, line count, and a short recent-output preview. Never returns the full output inline — use read on the file path for that.
background_kill
id(required)
Stops a running task. A manually stopped task does not generate a completion follow-up.
Verification
npm --workspace @bytetrue/pi-background-terminal run typecheck
npm --workspace @bytetrue/pi-background-terminal test