@ifi/pi-background-tasks
v0.5.1
Published
Reactive background shell tasks for pi with /bg, Ctrl+Shift+B, log viewing, and agent wakeups on output.
Maintainers
Readme
@ifi/pi-background-tasks
Reactive background shell tasks for pi.
Install
pi install npm:@ifi/pi-background-tasksOr install the full default oh-pi bundle, which also includes the compatible bg-process shim:
npx @ifi/oh-piWhat it provides
This package turns explicit background shell commands into a first-class pi workflow:
- ordinary
bashcommands stay in the foreground and use pi's built-in execution flow bg_status— compatibility tool for listing, tailing, and stopping tracked background tasks by PIDbg_task— richer LLM-callable tool for spawning, listing, tailing, stopping, and clearing tasks by id or PID/bg— slash command for launching and managing background tasks manuallyCtrl+Shift+B— richer multi-pane dashboard overlay with a task list, metadata pane, and scrollable log tail/bg watch --follow <id>— jump straight into the output pane for a task with follow-tail mode enabled- reactive follow-ups — pi can wake itself up when watched tasks emit new output or exit
- persistent log files for every spawned task
Example flows
/bg run gh pr checks 123 --watch
/bg run pnpm test --watch
/bg watch bg-1
/bg watch --follow bg-1
/bg stop bg-1The bg_task tool lets the agent start tasks explicitly and optionally gate wakeups with a
substring or /regex/flags pattern.
The dashboard supports:
Tabto switch between the task list and output pane↑↓,Shift+↑,Shift+↓,Home, andEndfor navigationfto toggle follow-tail modesto stop the selected taskcto clear finished tasks
Notes
- tasks are tracked for the current pi runtime and cleaned up on session shutdown
- every task writes output to a log file so you can inspect recent activity even after the command returns
- use
bg_taskor/bgfor servers, watchers, PR checks, and other commands you want to keep running after the tool returns reactToOutputdefaults totrue, so long-lived watchers likegh ... --watchcan wake the agent when new output arrives
This package ships raw .ts sources for pi to load directly.
