Note This is a stripped down fork of https://github.com/aliou/pi-processes. Most people should likely use the original project instead.
Manage background processes from Pi without blocking the conversation.
Install from npm:
pi install npm:@mjakl/pi-processesFor development builds, install from git:
pi install git:https://github.com/mjakl/pi-processes- the
processtool for starting, listing, inspecting, killing, and clearing managed processes - a single
/psoverlay for monitoring processes - a tiny always-visible process status line while managed processes exist, showing active/finished counts
- process completion notifications in the conversation
- file-backed logs so process output is preserved outside agent context
- all
/ps:*subcommands - the log dock
- the settings UI
- extra widget state and dock controls
The process tool is for the agent. Users should ask the agent to start or inspect long-running commands, then monitor them with /ps.
Tool-call examples:
process start "pnpm dev" name="backend-dev"
process start "pnpm test --watch" name="tests"
process start "pnpm dev" name="backend-dev" continueAfterStart=true
process list
process output id="backend-dev"
process logs id="proc_1"
process kill id="backend-dev"
process kill id="proc_1" force=true
process clear
For output, logs, and kill, id must be either:
- the exact process ID (
proc_1) - the exact friendly process name (
backend-dev)
If multiple processes share the same name, use the process ID.
Do not poll after starting a process.
This tool is event-driven: the agent is notified automatically when a process exits, fails, or is externally killed. By default, process start ends the current agent turn so the agent actually waits for that notification instead of immediately polling. If the next step is waiting, call process start by itself rather than batching it with unrelated tools.
The intended pattern is:
process start- let the turn stop and wait for the automatic notification if the process ends
- resume from that notification
Use continueAfterStart=true only when the agent has immediate, specific, non-polling work to do after starting the process.
Repeated process list, process output, or process logs calls just to see whether the process is still running are an anti-pattern.
process outputreturns a one-off tailed stdout/stderr snapshot for agent consumption.process logsreturns file paths forstdout,stderr, and a combined view for the/psoverlay.- Use
output/logsonly when the user asks, when you need a diagnostic snapshot, or when investigating a problem - not as a polling loop.
process kill id="..."sendsSIGTERMprocess kill id="..." force=truesendsSIGKILL- tool-triggered kills never notify the agent
/ps opens the process overlay.
Inside the overlay:
up/down- move the highlighted processleft/right- scroll older/newer log output for the highlighted processg/G- jump to the top or back to the live tailx- terminate the highlighted process; pressxagain when it showsneeds killto force-kill itc- clear finished processesqorEsc- close the overlay
The right side always shows logs for the currently highlighted process.
Global config lives in ~/.pi/agent/extensions/process.json.
{
"output": {
"defaultTailLines": 100,
"maxOutputLines": 200
},
"execution": {
"shellPath": "/absolute/path/to/bash"
},
"interception": {
"blockBackgroundCommands": true
}
}output.defaultTailLines- default number of lines returned byprocess outputoutput.maxOutputLines- hard cap forprocess outputexecution.shellPath- absolute shell path override used for process startupinterception.blockBackgroundCommands- block shell backgrounding (&,nohup,disown,setsid) and obvious long-running foreground commands such aspnpm dev,docker compose up,tail -f, orkubectl port-forward, and guide the agent to use theprocesstool instead
There are no Git hooks installed by this repository. Before committing or opening a PR, consider running:
pnpm typecheck
pnpm lint
pnpm testAfter dependency changes, also verify the lockfile with:
pnpm install --frozen-lockfile --ignore-scripts- Log files live in a temporary directory managed by the extension.
- Background processes are cleaned up when the session shuts down.