You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert

13
15
14
16
Tools like `tmux` or `screen` help _you_ manage your own terminal windows. `agent-tty` is for handing a real, long-lived terminal to an AI coding agent, so it can run commands, drive interactive apps like `nvim` or `htop`, and read the screen back. Because every session is recorded, you never have to take the agent's word for what happened: you (or another agent) get a plain-text snapshot, a real screenshot, or a video of the actual screen, and can replay it to check the work. It works just as well for plain shell automation and CI smoke tests with no agent involved.
@@ -48,13 +50,13 @@ npm install -g agent-tty
48
50
export AGENT_TTY_HOME="$(mktemp -d)"
49
51
agent-tty doctor --json # check your environment
50
52
51
-
#Open a session, do something, wait for it, look at the result.
Driving an interactive TUI is the same loop, with key chords and a wait for the screen to settle:
@@ -111,9 +113,17 @@ A colleague then used `agent-tty` to build an experimental TUI for Coder agents
111
113
112
114
## Command surface
113
115
114
-
Every user-facing command takes `--json` and returns a stable, machine-readable envelope. The commands cover the session lifecycle (`create`, `list`, `inspect`, `destroy`, `gc`), input and control (`run`, `type`, `paste`, `send-keys`, `batch`, `resize`, `signal`, `mark`), observation and capture (`wait`, `snapshot`, `screenshot`, `record export`), the live `dashboard`, and environment checks (`version`, `doctor`, `skills`).
116
+
Every user-facing command takes `--json` and returns a stable, machine-readable envelope, and exits with a stable code (`0` success, `2` usage error, `3` session not found, …) so scripts can branch without parsing output.
| Input and control |`run`, `type`, `paste`, `send-keys`, `batch`, `resize`, `signal`, `mark`|
122
+
| Observation and capture |`wait`, `snapshot`, `screenshot`, `record export`|
123
+
| Live view |`dashboard`|
124
+
| Environment |`version`, `doctor`, `skills`|
115
125
116
-
See [`docs/USAGE.md`](./docs/USAGE.md) for the full flag reference and[`docs/TROUBLESHOOTING.md`](./docs/TROUBLESHOOTING.md) for renderer and environment issues.
126
+
The CLI documents itself: `agent-tty --help` lists every command, and `agent-tty <command> --help` shows its flags. The full reference, including the exit-code table, is in [`docs/USAGE.md`](./docs/USAGE.md); renderer and environment issues are in[`docs/TROUBLESHOOTING.md`](./docs/TROUBLESHOOTING.md).
Copy file name to clipboardExpand all lines: docs/USAGE.md
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -104,6 +104,8 @@ Useful flags:
104
104
-`--exit`: wait for the process to exit.
105
105
-`--timeout <ms>`: maximum wait time in milliseconds, with `0` meaning infinite.
106
106
107
+
On timeout, a standalone `wait` still exits `0` and reports `matched: false` / `timedOut: true` in the JSON result — check the envelope, not the exit code. Inside `batch`, a timed-out `wait` step is a step failure (`WAIT_TIMEOUT`, exit code `11` under fail-fast).
108
+
107
109
### Screen Hash
108
110
109
111
`snapshot` results (both `--format structured` and `--format text`) and a **matched**`wait` result carry an optional `screenHash`: a lowercase 64-character hex SHA-256 of the visible screen text. Compare it across two calls to tell whether the visible screen actually changed — equal hashes mean identical visible content, even if the event-log sequence advanced on a no-op repaint.
A lone `'%'` does **not** restore the marker (zsh treats it as a prompt escape that expands to nothing); use `'%B%S%#%s%b'` for the styled default or `'%%'` for a plain percent. The default is applied at spawn time and is not stored in the manifest, so it does not appear in `inspect`, `list`, or `create --json` output. If your `~/.zshrc` assigns `PROMPT_EOL_MARK` it runs after the environment is imported and wins, so the marker can reappear — remove that line or set the value you want via `--env`.
231
233
234
+
## Exit Codes
235
+
236
+
Every command exits with a stable code, so scripts can branch without parsing output. The `--json` error envelope carries the precise `error.code` (for example `WAIT_TIMEOUT`); the exit code is a coarser, stable summary of it.
0 commit comments