feat(cli): add terminals wait/wait-output/send-keys/attach/resume-all, schema, completions, config check
AV
2mo ago+4612+4612+0123456789012345678901234567890123456789-23-23-01234567890123456789
Summary
Ports the highest-leverage CLI/product gaps identified against Herdr (the terminal-multiplexer competitor) — the CLI goes from a thin wrapper around the desktop app to a first-class way to script, diagnose, and directly control the agent fleet.
10 new capabilities, roughly half the diff is tests:
terminals wait— block until an agent reaches a target lifecycle status. No more hand-rolled polling loops aroundterminals read.terminals wait-output— same idea for any process (test watchers, servers), not just agents.terminals send-keys— real key injection (esc, ctrl+c, arrows, ...).terminals sendcould previously only type text + Enter. As a side effect, sending an interrupt also clears a wedged status, since Esc/Ctrl+C fire no hook — the exact failure mode behind Superset's least-trustworthy status readings.terminals attach— interactive tmux/herdr-style attach to a live terminal session, over the same WebSocket protocol the desktop's own renderer uses. Works on a remote host via the existing--hostflag, for free.terminals resume-all— bulk-sweep every dead-but-resumable session in a workspace at once (--dry-runto preview), instead of noticing and resuming one pane at a time.explain/wait:msSincePtyOutput— independent PTY-silence evidence alongside the hook-derived status. Never overrides it — it's additional evidence for a human or script, not an automatic correction (guessing wrong on live status would be worse than the existing gap).completion bash|zsh— generated live from the real command tree, so it can't drift out of sync as commands are added.schema— the full command tree + every option as real JSON. (--help --jsonexisted but never actually printed JSON.)config check— validates~/.superset/config.json. Running it against my own machine's real config caught two genuinely stale keys nothing reads anymore.
What's deliberately not in here
Three items from the Herdr comparison aren't built, each backed by checked evidence rather than assumption:
- Pane geometry control — no persisted layout model exists server-side (checked both DB schemas); the desktop's pane tree lives only in browser localStorage, per-device. Building this means a real sync-layer project, not a CLI command.
- Attaching hooks to a process Superset didn't launch — Superset's terminals are always spawned by Superset itself; there's no adoption mechanism for an arbitrary external process (confirmed via the actual session-adoption code path).
- A general notification feed — no persisted notification model exists; building one is new product surface, not a port.
Test plan
tsc --noEmitclean acrosshost-service,cli, andcli-framework.- Full suites green: 211/211
cli, 203/203host-service, 40/40cli-framework. - Every
--helpoutput confirmed through the real CLI framework binary, not just typechecked. terminals attachhad no unit-testable client wiring on its own, so I stood up a local WebSocket server mirroring the host-service's real terminal protocol byte-for-byte and ran the actual client bridge class against it — all 6 protocol assertions passed (JSON control frames, binary output frames, resize, detach-on-close).config checkandschemawere run for real (read-only) against a live machine.- Merged
mainin after the fact; found and fixed one real gap the auto-merge couldn't catch by compiling alone (resume-allneeded the newhasSessiondependency main's account-switch fix added to the resume path) — separate commit, easy to review on its own.
https://claude.ai/code/session_01N29v4UPewWLJxf5MvKaz4H
Summary by CodeRabbit
-
New Features
- Added Bash and Zsh shell completion generation, CLI schema output, and
config checkvalidation. - Added terminal commands for attaching, explaining agent status, waiting for status or matching output, sending keys, and resuming eligible sessions.
- Added terminal-agent status monitoring, output-activity details, and bulk session resumption.
- Added static CLI comparison and verification reports.
- Added Bash and Zsh shell completion generation, CLI schema output, and
-
Documentation
- Updated orchestration guidance for terminal monitoring and recovery.
-
Tests
- Added coverage for completions, configuration validation, terminal interactions, waiting, and agent lifecycle behavior.