Agent CLI
How to use the CLI to manage Agent projects
Agent CLI
The city CLI is a convenience wrapper around the Agent SDK. It reads agent config from the CLI global DB, passes model, plugin, and startup options to the Agent SDK constructor, then handles lifecycle commands like start, stop, and restart.
Project initialization
city agent createWith no path, choose the current directory or another folder through the native system picker. Relative and absolute path arguments are also supported, for example city agent create . and city agent create ./my-project.
This generates:
.agents/skills/.downcity/.env- Agent config in the CLI global DB
Project directory structure
my-project/
├── .env
├── .agents/skills/
├── .downcity/ # runtime data only
└── your application codeKey commands
city agent start— start the agent in the current projectcity agent stop— stop the running agentcity agent restart— restart the agentcity agent status— check if the agent is runningcity agent logs— view runtime logs
Chat TUI security policy
After opening Chat from the Agent manager, use /security to choose the current Session security policy:
Default— maps to the Sessionaskmode; every unrestricted Shell action requires an explicit approval.Always Allow— maps toalways-allow; future unrestricted Shell actions in the current Session are approved automatically.
The active policy appears in the Chat header. A policy change affects only future Shell requests in the current Session; an already pending request still requires an explicit response. Always Allow does not bypass dangerous-command rejection, Workspace boundaries, or other runtime safety checks.
What the CLI does
- Reads agent config from the CLI global DB
- Resolves
execution.modelIdthrough the connected Federation AIService - Passes the resolved config to
new Agent(...) - Starts the Agent process
- Maintains daemon state so you can inspect, stop, or restart later
CLI vs SDK
The CLI is for day-to-day project management. The SDK is for embedding agent behavior into your own applications. Both use the same execution core.
Continue with: