@ifi/pi-background-tasks
Reactive background shell tasks for pi with /bg, Ctrl+Shift+B, log viewing, and agent wakeups on output.
Package details
Install @ifi/pi-background-tasks from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@ifi/pi-background-tasks- Package
@ifi/pi-background-tasks- Version
0.5.1- Published
- Apr 28, 2026
- Downloads
- 457/mo · 457/wk
- Author
- ifiokjr
- License
- MIT
- Types
- extension
- Size
- 48.5 KB
- Dependencies
- 0 dependencies · 5 peers
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
@ifi/pi-background-tasks
Reactive background shell tasks for pi.
Install
pi install npm:@ifi/pi-background-tasks
Or install the full default oh-pi bundle, which also includes the compatible bg-process shim:
npx @ifi/oh-pi
What 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-1
The 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.