Agent CLI
How to use the CLI to manage Agent projects
The city CLI is a local City host. It reads Agent and Power configuration, constructs Agents, Workspaces, and one instance of each Power separately, then lets City own their composition and long-running lifecycle.
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— open the Agent list; Federation and global Power actions are in its Settings groupcity on— start the CLI City and restore all bound Agentscity status— inspect City, HTTP/RPC ports, and configured Agentscity restart— restart City and reload configurationcity off— stop the CLI Citycity agent chat [agent_id]— chat with an Agent even while City is off
Chat TUI security policy
After selecting an Agent and entering its most recent conversation, use /security to choose the current Session security policy:
Default— maps to the Sessionaskmode; every host Shell action requires explicit approval.Always Allow— maps toalways-allow; future host 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(...) - Reads configuration through repositories, creates Agents explicitly, and registers them with
new City(agents) - Exposes Agents by
agent_idover one HTTP port and one RPC port
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: