name: agenter-terminal description: Create and drive durable terminal sessions. Use this when work needs a long-lived or interactive process; killed-terminal recovery is an explicit forensic path.
agenter-terminal
Use this skill when work needs a durable process or an interactive shell. Killed terminal instances are dead history evidence; recover one only when you explicitly need that exact durable id.
Quick start:
- Run
terminal listfirst to inspectprocessPhase,currentPath,currentTitle, and prior stop facts before guessing lifecycle from stale output. - Run
terminal createwhen no suitable terminal exists yet. Publicterminal createauto-bootstraps by default, so a fresh terminal may briefly showlifecycleTransition = bootstrappingbefore it settles intoprocessPhase = running. - If you need the durable launch command, launch cwd, geometry, or metadata, run
terminal get-configinstead of inferring config from observed runtime output. - If
terminal listshowsprocessPhaseasnot_started, runterminal bootstrapbefore expecting read/write to work. If the terminal was already killed, switch toterminal history; preferterminal createfor normal follow-up work and bootstrap the killed id only for explicit forensic recovery. - If
terminal listorterminal get-configshowslifecycleTransition = bootstrappingorkilling, wait and reread instead of stacking another lifecycle or config mutation. - Decide whether the next payload is
rawormixed. - If the exact payload shape is unclear, run
terminal write --helporterminal input --helpfirst. - Run
terminal writefor literal raw bytes, orterminal inputfor mixed DSL. - Run
terminal awaitwhen you need to wait for bounded evidence such as output change, idle state, or a deterministic text match. - Run
terminal readonly for immediate inspection or recovery of current terminal state. - Run
terminal set-configwhen the durable terminal identity is correct but launch truth needs to change for the next bootstrap. - Run
terminal stopwhen you want to halt the PTY, remove it from the live list, and keep its durable history evidence for later bootstrap.
Key laws:
- A runtime does not start with a terminal by default.
- Long-lived and interactive work belongs in terminals, not one-shot bash.
terminalis a collaborative process surface, not a root-workspace shell.- Shared terminals keep real-home semantics and do not inherit runtime-local env/CLI by default, even when
cwdstarts inside the avatar root workspace. terminal listis the lifecycle and observed-identity inspection surface. ReadprocessPhase,currentPath,currentTitle, and stop facts there before inferring state from raw output.terminal createauto-bootstraps by default. A newly created terminal may briefly exposelifecycleTransition = bootstrapping; wait and reread instead of firing a redundant second bootstrap.- Provisioned terminals do not auto-start when you read or write. Use
terminal bootstrapexplicitly. - Killed terminals leave
terminal list. Useterminal historyto inspect dead-instance facts. Preferterminal createfor normal follow-up work; bootstrap a killed id only when you intentionally need forensic recovery of that same durable terminal. terminal readconsumes this actor's read cursor. Other actors keep independent cursors on the same shared terminal output.- Use
terminal readdeliberately:remark:falseinspects without advancing your cursor, while normal reads advance only your actor's cursor. terminal awaitis the bounded observation primitive. Use it instead of reconstructing waits with shellsleep, repeatedterminal read, andgrep.terminal awaitreturns clean bounded snapshot lines and match context from the terminal canvas. Those lines are evidence of the stable screen state, not raw ANSI bytes or PTY transition chunks.- Prefer
terminal await's command-levelwait.timeoutMsfor post-mortem evidence. Shell-leveltimeoutmay still cancel the command, but it can prevent the JSON result from reaching you. lifecycleTransitionis a coordination lock, not a work item. If it isbootstrappingorkilling, wait and rereadterminal listorterminal get-configbefore sending another lifecycle or config mutation.terminal get-configis the durable launch/config inspection surface. Use it forcommand,launchCwd, geometry, metadata, and other next-bootstrap truth.terminal set-configpatches durable launch/config truth without changing the terminal id.- For running PTYs,
colsandrowsmay apply live immediately. Launch-affecting fields such ascommand,launchCwd,env,processKind,gitLog, andlogStyleupdate durable truth first and take effect on the next bootstrap. - If work needs a port listener, local web server, watch mode, REPL, or retryable boot sequence, start it in
terminal. terminal writeis raw mode. It sends literal bytes and never invents Enter, waits, or special keys for you.terminal inputis mixed mode. Use it for<key .../>,<wait .../>, or literal<...>text wrapped in<raw>...</raw>.- In mixed mode, literal tag-like lines must stay inside
<raw>...</raw>, and Ctrl combos usectrl="true"such as<key data="d" ctrl="true"/>. - Interactive stdin programs usually split into two phases: start the program with
terminal write, then feed content and special keys withterminal input. terminal writeandterminal inputonly prove that input delivery succeeded; they do not prove the process succeeded.terminal stophalts the PTY, removes the terminal from the live list, and preserves durable history evidence.terminal archivehides dead history from the default work queue, andterminal deleteis the final destructive removal.- After starting a listener in
terminal, inspect its real state and verify the exact promised URL or path before you tell a room or user that it is ready. terminal readsnapshots and "the process is still running" only describe terminal state; they do not prove the promised URL or API path actually responds.- When the task already names the workspace and delivery target, the normal next move is to create or select a live terminal, not to browse unrelated room or attention detail first.
- If a one-shot shell hits binding or sandbox errors while you are trying to make a service reachable, stop and switch to
terminal. - When more than one workspace is mounted, choose an explicit absolute
cwd. terminal create,terminal write,terminal await, andterminal readare JSON-first commands. Throughroot_bash, default tocommand=<bare terminal action>plus JSONstdin.- Only use a single argv JSON payload when it is trivially short and clearly cheaper in tokens than a separate
stdinfield. - If
terminal create --help,terminal write --help,terminal input --help,terminal await --help, orterminal read --helpmarks compact asSuggestedorAvailable, the matching command also accepts--compactpositional arrays. If the positional array becomes unclear, go straight back to standard object JSON. - If raw vs mixed choice is unclear, read
references/input-modes.mdbefore guessing. - If
terminal write --helporterminal input --helpstill is not enough, runskill info agenter-terminal, derive the real skill directory, and read only the reference file you need. - If the durable launch truth is unclear, read
references/terminal-config.mdbefore guessing. - For multi-line writes, nested JSON, or heredoc-heavy payloads, the next file to open is
references/file-writing.md.
References:
references/terminal-lifecycle.md: create/recover/bootstrap/await/read/write/stop strategy and recovery patternsreferences/terminal-config.md: durable launch/config inspection and mutation rulesreferences/input-modes.md: when to use raw vs mixed, and how<raw>...</raw>worksreferences/file-writing.md: safe patterns for sending multi-line file writes through terminal raw/mixed input