Skip to content

Repository files navigation

Pi Worker

CI npm version Go 1.25+ Node.js 22.20+ macOS Linux Windows source MIT license

Delegate bounded coding tasks to exact models available through your local Pi installation.

What is it?

Pi Worker is a small CLI and coding-agent skill. Your primary agent remains the orchestrator; Pi Worker starts one to three workers in parallel, keeps results in request order, and returns each worker's status and final explanation.

Why does it exist?

Using the primary agent for every subtask can consume an expensive or limited quota. Pi may already expose a lower-cost model or a model billed through a separate account. Pi Worker removes the manual prompt-and-result copying while enforcing an exact provider/model choice and reporting the effective thinking level.

How do I use it?

You need Node.js 22.20.0 or newer and a Pi CLI with provider authentication. Pi 0.84.1 is verified; other semantic versions run with an explicit warning.

Install the npm package:

npm install -g pi-worker

The npm package supports only macOS and Linux on arm64 and x64. It includes the native binary and provider-neutral skill. npm install attempts to install the skill for detected coding agents through pinned skills@1.5.22; it never overwrites an unrecognized existing skill.

Native archives are available from GitHub Releases. Windows users must build from source; Windows is compile-checked but not runtime-tested. Source builds are documented in detailed usage. The Go binary can also be installed directly without the bundled skill:

go install github.com/arasovic/pi-worker/cmd/pi-worker@latest

The binary lands in go env GOBIN, or in $(go env GOPATH)/bin when GOBIN is unset. That directory must be on PATH:

command -v pi-worker

Safety: Workers can modify the current writable workspace and execute bash with the current user's host permissions. Pi Worker is not a sandbox or worktree layer. Use a trusted workspace; parallel tasks must be disjoint.

Choose an exact selector, check readiness, save a default, and run a task. Replace provider/model with one exact selector printed by pi-worker models before config set:

pi-worker models
pi-worker doctor
pi-worker config set default-model provider/model
pi-worker run --thinking high --task "Review this module and explain the main risks"

Doctor is read-only. Its five checks, in order, are pi-executable, pi-version, config, model-catalog, and default-model.

Thinking is separate from model identity. Accepted values are off, minimal, low, medium, high, xhigh, and max. An unsupported explicit effort keeps the same model, uses Pi's confirmed default, and reports the fallback. The requested model/provider never silently changes.

From a coding agent, a request can be as short as:

Use pi-worker with provider/model at high effort to complete this task.

Run up to three independent tasks by repeating --task or --task-file. Parallel writes must target disjoint files because every worker shares the current writable workspace.

Safety

Pi Worker is not a sandbox. bash has the current user's host permissions, and workers can edit the current workspace. Use one worker for overlapping work.

An exact requested model never silently changes. Thinking fallback stays on the same model and reports the fallback. Installer state is recorded in a durable receipt; the stable identity marker distinguishes recognized Pi Worker content.

Troubleshooting

Show foreground installer diagnostics and inspect skill state:

npm install -g --foreground-scripts pi-worker
pi-worker skill status
pi-worker skill status --json
pi-worker skill receipt-path
npx --yes skills@1.5.22 list -g

A separately installed recognized skill is externally managed and may be stale. Markerless, foreign, or mixed content is never overwritten automatically. After backing up and verifying every affected path as Pi Worker content, recovery may require:

npx --yes skills@1.5.22 remove pi-worker -g -y
npm install -g --foreground-scripts pi-worker

Do not use the global remove command for unrecognized content.

Documentation

License

See LICENSE and THIRD_PARTY_NOTICES.

Releases

Used by

Contributors

Languages