--- title: Classic gateway client description: How hermes chat / --cli attach to the gateway authority --- # Classic gateway client (initial migration) Normal `hermes --cli`, `hermes chat`, `hermes chat -q '…' -Q`, and top-level `hermes -z '…'` use the gateway authority. Direct `cli.main` chat launches also hand off before constructing a local agent. Local bootstrap uses the canonical ensure lifecycle and a single-use private control ticket, not service installation. An explicit `HERMES_TUI_GATEWAY_URL` remains remote-only: failed connection or authentication never launches a local replacement. The client prints the persisted `Session:` ID to stderr. Resume with `hermes --cli chat --resume ID`. Input is admitted with a fresh `input_id`; events and final replies come from the authority. `/quit`, `/exit`, `/detach`, EOF and closing the terminal detach only. `/stop` sends an execution-generation-fenced interrupt. Pending approvals display `/approve ID once|deny|…`; clarification uses `/answer ID TEXT`. The client uses the displayed prompt ID and its captured generation, not a locally reconstructed waiter. `/discard ID` acknowledges an admission lost across an owner restart (`prompt.resolve_unknown`). `/branch [title]`, `/model [--provider name]` and `/compress [here [N] | ] [--preview]` are revision-fenced `session.mutate` operations (`hermes_cli/gateway_mutations.py`); `/yolo [on|off]` toggles this session's approval bypass on the owner (`config.set` key `yolo`). `/title [name]` (`session.mutate rename`), `/undo [N]` and `/retry` (`session.mutate rewind`; `/undo` puts the removed message back in the composer), `/new [title]` / `/reset` (`session.create` with this session's frozen launch request), `/usage` (the owner's report plus the last committed turn) and `/tools` (launch toolsets) run in the view (`hermes_cli/gateway_chat_commands.py`). Every other command goes to the owner as `slash.exec`: the reviewed reads run there and the rest print `/x is not available on the shared gateway yet` with a link to the [command parity table](gateway-command-parity.md), which lists what every local client does with every command. One-shot stdout ends with the final reply. Without `-Q`, a resumed session first prints its stored history (`user:` / `assistant:` lines), and the reply is followed by the `Resume this session with:` block (see Launch options); `-Q` prints the reply alone. Exit status is 0 for a completed admission, 1 for failed execution/connection, 2 for unsupported frontend options, 3 for a pending control that requires interactive reattachment or a turn lost in a gateway crash (clear it with `hermes sessions discard --yes`), and 130 for a keyboard detach. A pending control does not imply cancellation. `-z` no longer implicitly bypasses approval policy. ## Launch options The gateway advertises its accepted creation parameters through `runtime.describe` (`session_create.parameters`, from `gateway.session_policy.CREATE_FIELDS`). The client sends a creation option only when it is advertised; a requested option an older gateway does not advertise is refused (`Gateway does not support creation options: …`). Caller cwd is sent when advertised; an old gateway lacking cwd support prints a warning that it uses its configured execution directory, while explicit `--in` rejects. A resume may repeat the exact creation flags the session was frozen with (scripts re-run one command line); any flag that would change the frozen route rejects. **Accepted and frozen into the session at creation** (`_POLICY` in `hermes_cli/gateway_chat.py`): `--model`, `--provider`, `--base-url`, `--api-key` (memory-only, never persisted), `--reasoning`, `--toolsets`, `--max-turns`, `--skills` (rendered once into the frozen prompt), `--checkpoints`, `--yolo`, `--accept-hooks` (also `HERMES_ACCEPT_HOOKS=1`), `--pass-session-id`, `--ignore-rules`, `--ignore-user-config` and `--safe-mode` (both need an explicit `--model`; safe mode runs the turn in an isolated worker that never reads the profile). Also accepted: `--source