AgentCLIInteraction
city agent chat
Chat with a running Agent from the terminal in interactive or one-shot mode
city agent chat
Usage
city agent chat
city agent chat --to my-agent
city agent chat --to my-agent --message "Summarize this repo"
city agent chat --to my-agent --message "Return JSON" --jsonTwo modes
Interactive mode
Without --message, you enter a persistent terminal conversation:
city agent chat --to my-agentBest for:
- multi-turn interactive exploration
- iterative prompt and behavior testing
- manual project conversations
One-shot mode
With --message, the CLI sends one turn and exits:
city agent chat --to my-agent --message "Summarize the current repository structure"Best for:
- scripting
- one-off analysis
- terminal toolchain integration
Streaming behavior
- In normal terminal mode, assistant text streams to stdout as it is generated.
--jsonremains non-streaming so machine-readable output stays stable.- The command still uses the dedicated
local-cli-chat-mainsession by default.
Target resolution
- if
--tois provided, it uses that agent name directly - if not, and the terminal is interactive, it prompts from currently running agents
If the terminal is non-interactive and you do not provide --to, the CLI does not have enough information to choose a target safely.
Important limitation
The target agent must already be running.
chat will not auto-start the runtime for you.
Common parameters
--to <name>--message <text>--json--host--port--token
Useful interactive commands
/exit/quit/clear/help
A common misunderstanding
Do not treat terminal chat as "one globally shared context across every surface."
By default it uses its own dedicated local CLI session, which is excellent for terminal debugging, but it is still its own context boundary.
Continue with: