pi-spawnkit

内容来源:README.md(说明文档) · 原始地址 · 查看安装指南

原始内容

pi-spawnkit

CI Publish npm version npm downloads License: MIT Pi package Trusted Publishing

Resolve and smoke-test the right child pi executable 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, and PI_SPAWNKIT_RESOLVED=1 only 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 pi process resolution only.
  • Not a generic shell execution wrapper; use pi-winshell for arbitrary command execution / argv / stdin safety.
  • Not a broad environment probe; use pi-env-probe for one-shot diagnostics.
  • No permanent PATH rewrite, shell profile edit, registry edit, automatic install, or npm publish by agents.

Links

License

MIT