Files
tty7/crates/tty7-cli
thomasandClaude Fable 5 917d09f014 feat(cli): tty7-cli crate skeleton — grammar, addressing, backend seam, output
The thin console CLI from docs/cli-design.md, transport-free for now:

- clap grammar for the full documented surface: ws/tab/pane/machine/server
  nouns, the hot-path top-level verbs (ls/attach/run/new/split/send/capture/
  procs/agents/events/status/doctor), global -m/--json/-q, `run -- <cmd...>`,
  and bare `tty7 [path]` parsing as the GUI launcher stub.
- tmux-style addressing (%42 pane, @7 machine-wide tab ordinal or @<uuid>,
  workspace by name / id / unique id prefix) with implicit-context fallback
  to TTY7_PANE / TTY7_WS and a "not inside a tty7 shell" error naming the fix.
- Backend trait as the integration seam: control() speaks real
  tty7_core::daemon::control ControlRequest/ReplyOk values, plus declared
  pane-side entry points (spawn_shell/send_input/capture/procs/attach_pane/
  run/events). StubBackend fails loudly until the transport client lands;
  MockBackend asserts the exact request shapes every structural verb builds.
- Plain aligned tables and trees for ls/tree/pane ls, one JSON object per
  command under --json. Exit codes: 0 ok, 1 failed, 2 usage (clap default).

agents/status/machine ls stay stubbed: they need ControlRequest::AgentStates/
Status/Routes, which another slice is adding; ws stop and server start/stop
likewise wait on their mechanisms rather than inventing protocol.

Build/test this package alone (cargo build -p tty7-cli): its bin is named
tty7 and collides with the GUI bin until that one is renamed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014JPaaZVK7rfQPKyrymzsYv
2026-07-31 09:34:52 +08:00
..