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 create

With 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 code

Key commands

  • city agent start — start the agent in the current project
  • city agent stop — stop the running agent
  • city agent restart — restart the agent
  • city agent status — check if the agent is running
  • city 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 Session ask mode; every unrestricted Shell action requires an explicit approval.
  • Always Allow — maps to always-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

  1. Reads agent config from the CLI global DB
  2. Resolves execution.modelId through the connected Federation AIService
  3. Passes the resolved config to new Agent(...)
  4. Starts the Agent process
  5. 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: