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.0Default 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:
- explicit path wins
- if the current directory is already initialized, use it
- otherwise prompt from registered agents if the terminal is interactive
This makes scripted usage predictable while keeping human usage convenient.
--foreground
city agent start --foregroundUse 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.modelIdis 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:
city agent status- Agent won't start
Continue with: