pi-jobs
v0.2.0
Published
Offload-completion pings + in-session resume for Pi. Marker-based jobs: scripts write ~/.pi/jobs/<id>.json on completion, Pi pings in-session, /jobs resume <id> continues from the result.
Maintainers
Readme
pi-jobs
Offload-completion pings + in-session resume for Pi.
When you offload work to a script, subagent, remote worker, or another
machine, the offloaded process writes a small marker file on completion.
While a Pi session is open you get a notification and a live footer/widget
status; /jobs resume <id> makes Pi continue directly from the result.
Install
pi install npm:pi-jobs
# or from git
pi install git:github.com/stanleytejakusuma/pi-jobsThen /reload.
The contract
Offloaded work writes one immutable file on completion:
~/.pi/jobs/<id>.json{
"status": "done",
"summary": "Reviewed PR #123 — 2 issues found, both fixed.",
"resultPath": "/abs/path/to/result",
"nextStep": "Review the diff and commit."
}Three lines in any script:
echo '{"status":"done","summary":"backup finished","resultPath":"/tmp/backup.log"}' \
> ~/.pi/jobs/backup-$(date +%s).jsonCommands
| Command | What it does |
|---|---|
| /jobs | List markers, newest first |
| /jobs show <id> | Full marker JSON |
| /jobs resume <id> | Continue the session from the marker |
| /jobs clear [status...] | Delete markers (default: finished ones) |
Tool: jobs_list — lets Pi answer "is my job done?" itself.
Design
- No scheduler — the offloaded script or external cron owns timing. Pi's own cron attempts died on orphaned sessions and ENOENT races; this is stateless and file-based.
- No channel — in-session ping is notify/status; out-of-band ping is the script's own curl to ntfy/Telegram. Markers are the shared contract.
- Immutable markers, explicit cleanup — nothing auto-deletes.
License
MIT
