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 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 — open the Agent list; Federation and global Power actions are in its Settings group
  • city on — start the CLI City and restore all bound Agents
  • city status — inspect City, HTTP/RPC ports, and configured Agents
  • city restart — restart City and reload configuration
  • city off — stop the CLI City
  • city 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 Session ask mode; every host Shell action requires explicit approval.
  • Always Allow — maps to always-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

  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. Reads configuration through repositories, creates Agents explicitly, and registers them with new City(agents)
  5. Exposes Agents by agent_id over 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: