原始内容
pi-spawnkit
Resolve and smoke-test the right child
piexecutable before Pi extensions try to spawn it.
What this is
pi-spawnkit is a Pi extension/helper package for extension authors and Pi power users who launch child Pi processes. It targets Windows/npm-shim setups where the interactive shell can find pi, but a parent Pi process fails with spawn pi ENOENT because pi.cmd or the npm global bin is missing from the child process PATH.
Planned MVP
/spawnkit:doctor— show platform, PATH entries, Pi executable candidates, selected SpawnPlan, and smoke result.spawnkit_resolve_pi— return{ command, argsPrefix, envPatch, confidence, warnings }for child-launching tools.- Session-start process-local patch — set
PATH,PI_BIN, andPI_SPAWNKIT_RESOLVED=1only when high-confidence resolution succeeds. - Consumer docs for
pi-baton,pi-git-delegate, gstack Agent/Task fallback, and Windows Git Bash / PowerShell.
Install
pi install npm:pi-spawnkit
Or install from GitHub:
pi install git:github.com/eiei114/pi-spawnkit
Doctor command
Run /spawnkit:doctor inside Pi after loading the package to print platform, PATH entry count, process.execPath, PI_BIN, checked candidates (pi, pi.cmd, pi.exe), and warnings. Missing candidates are diagnostics warnings rather than hard failures.
Development
npm install
npm run ci
Boundaries
- Child
piprocess resolution only. - Not a generic shell execution wrapper; use
pi-winshellfor arbitrary command execution / argv / stdin safety. - Not a broad environment probe; use
pi-env-probefor one-shot diagnostics. - No permanent PATH rewrite, shell profile edit, registry edit, automatic install, or
npm publishby agents.
Links
- npm: https://www.npmjs.com/package/pi-spawnkit
- GitHub: https://github.com/eiei114/pi-spawnkit
- Issues: https://github.com/eiei114/pi-spawnkit/issues
- Vault PRD:
4_Project/OSS/pi-spawnkit/Docs/PRD.md
License
MIT