Downcity
AgentCLILifecycle

city agent start

Start an Agent process in background or foreground mode

city agent start

Usage

city agent start [path]
city agent start [path] --foreground
city agent start [path] --host 0.0.0.0

Default behavior

Without --foreground, the command starts the agent as a background daemon.

In the current implementation, background mode is not a completely different logic path. It uses daemon orchestration to launch the real foreground runtime entry point.

How the target project is resolved

The command follows a fixed priority:

  1. explicit path wins
  2. if the current directory is already initialized, use it
  3. otherwise prompt from registered agents if the terminal is interactive

This makes scripted usage predictable while keeping human usage convenient.

--foreground

city agent start --foreground

Use this when you want to:

  • watch startup behavior directly
  • debug runtime startup issues
  • avoid losing the actual error behind background process orchestration

It is a debugging mode, not the normal long-running mode.

Preconditions

Before startup, the following must be valid:

  • the project is initialized
  • downcity.json.execution.modelId is set correctly
  • the bound model can be resolved from the global model pool

If these conditions are missing, repeated start attempts are less useful than checking:

Continue with: