@shelve/cli@5.1.0
Minor Changes
-
#751
f9a0848Thanks @HugoRCD! - Add agent-friendly global flags (--json,--quiet,--yes,--non-interactive), structured JSON errors on stderr, non-interactive guards across all commands, and machine-readable output for query commands. Addsshelve doctor,runspawn JSON events, GitHub Action, CI playground smoke tests, LP skills manifest check, troubleshooting docs,shelve-appagent skill, and llms.txt skill links. Includeslogin --token,generate --type, HTTP debug logging, fixes silent fetch failures inshelve run, full CLI documentation on shelve.cloud, and a Docus-published agent skill at/.well-known/skills/. -
#752
787cf07Thanks @HugoRCD! - Add sync policies for push/pull conflict handling,shelve diffandshelve sync, server-side protected environments on projects, and consolidate published agent skills into a single comprehensiveshelveskill (removeshelve-app).
Patch Changes
-
#749
e64d2ecThanks @HugoRCD! - Add a self-containedplayground/run/fixture and rootpnpm playscripts so the fullshelve runflow can be exercised end-to-end without leaving the repo, hitting the production API, or running the Shelve app.- A tiny zero-dep
node:httpfake Shelve API (server.mjs) seeded with a team / project / 3 environments / variables / a fake token (seed.json). Implements the four endpointsshelve runcalls. - An orchestrator (
start.mjs) that boots the server, waits for/health, then spawns the locally-stubbed CLI with the rightSHELVE_*env vars injected and tears the server down on exit / Ctrl-C. - Root scripts:
pnpm play(=shelve run dev),pnpm play:start,pnpm play:fail,pnpm play:watch,pnpm play:server(server only). Each runspnpm -C packages/cli stubfirst so edits inpackages/cli/src/**are picked up without a rebuild. - Two admin endpoints (
POST /__playground/variables,POST /__playground/reset) let you trigger watch-mode reloads from another terminal with a single curl. - Not part of the pnpm workspace —
pnpm installignores it, no host-project lockfile drift can swallow output.
Also fixes several long-standing
shelve runcorrectness and cross-platform bugs the playground surfaced:- CLI orphaned its own child.
runMain(main).then(() => process.exit(0))resolved as soon as theruncommand function returned (right after spawn), killing the CLI before the child had done anything. Withstdio: 'inherit'the orphaned child kept writing to the terminal so it looked fine, but signal forwarding, watch mode and exit-code propagation were all broken. Fix: theruncommand awaits a never-resolving promise;child.on('exit')is now the only path toprocess.exit. --watch --restart-on-changekilled the CLI on the first reload. Killing the old child fired its exit handler which calledprocess.exit(143)before the new child could spawn. Fix: mark the outgoing child with__restartingso its exit handler is a no-op while watch is swapping in a replacement.- Signal handler leak in watch mode. Each respawn registered fresh
process.on(SIGINT|TERM|HUP)listeners. After 10 reloads Node warned. Fix: register process-level signal handlers exactly once and have them target the current child via a module-level ref. process.kill(-pid, …)doesn't work on Windows. Replaced everywhere withtree-kill, which usestaskkill /F /Ton Windows and process-group kill on Unix. Droppeddetached: trueon spawn — no longer needed for cleanup and was what made the CLI missSIGHUPwhen the terminal closed.- Package-manager shims (
pnpm.cmd,npm.cmd,yarn.cmd) didn't spawn on Windows. Node'sspawndoesn't resolve.cmdwithout a shell. Now usesshell: trueon Windows (the shim chain is killed correctly thanks totree-kill). - Parent-death watchdog. Both the CLI's
runcommand and the playground orchestrator poll their originalppidwithprocess.kill(ppid, 0)every 2s. If the parent disappears (terminal force-quit, parent SIGKILL'd, Cursor crashed, …), the child tears down its own subtree instead of running orphaned forever and spammingsetRawMode EIOinto whatever terminal it ended up attached to. - Suspiciously-fast exit warning. If a spawned child exits cleanly in <250ms (probably script-resolution went wrong), the CLI now prints a warning pointing at
--debugandshelve run -- <pm> <script>to bypass script resolution. Script-resolution errors are debug-logged instead of swallowed.
Smoke-tested all variants — SIGINT, terminal SIGHUP, parent
kill -9, watch+restart, failing exit codes — on macOS. No orphans, ports always released, exit codes always propagated. - A tiny zero-dep