cli-stream
A small, generic streaming subprocess engine for Rust: spawn a CLI,
stream its stdout/stderr line-by-line through a callback, cancel it
(SIGTERM → SIGKILL), and augment PATH so a Node-based CLI (or node
itself) resolves even from a Finder-launched macOS .app.
No agent / harness protocol knowledge — just process streaming, useful to anyone driving a child CLI. (The one node-specific concession is the PATH resolver below; as the shared leaf it's the one place the bob/claude/codex adapters can reuse it without a dependency cycle.)
spawn_streaming(program, args, env, cwd, run_id, callback)→ returns aProcessHandle(or a typedStreamError—Spawncarries the underlyingio::Error, so you can tell "not on PATH" from "permission denied"); emitsProcessEvents (Started / Stdout / Stderr / Error / Exited) to the callback from reader threads.ProcessHandle::cancel()— SIGTERM, then SIGKILL after a grace period. Pollstry_wait(not a blockingwaitunder the lock), so it actually terminates a running child, not just on the next event.augmented_node_path()— resolves the user's realPATHby asking their login shell (so it findsnodewherever nvm / pnpm / volta / asdf / Homebrew put it), cached once, with a hardcoded fallback — so a Finder-launched.appfindsnodeinstead of mis-reporting installed CLIs as "not installed".InstallEvent— the sibling shape for streamed install/login output.
License
Licensed under either of MIT or Apache-2.0 at your option.