Downcity
Commands

city start

Start city runtime in background mode

city start

Start city runtime in background mode.

Startup initializes the city runtime registry and process state. If no local token exists yet, startup automatically creates a console-bootstrap token and prints the plain token once in startup output. Startup also tries to discover the machine's public IP and saves it to Console Env as DOWNCITY_PUBLIC_HOST. Later, agent contact link generation prefers this address so link codes do not fall back to 127.0.0.1.

If you also want to start Console in one step, use city start --console, city start -a, or city start -p. If you pass -p/--public or -h/--host, the CLI also starts Console automatically.

Usage

city start
city start --console
city start -p

Common options

  • -a, --all: start Console together
  • --console: start Console together
  • -p, --public [enabled]: start Console in public mode and bind it to 0.0.0.0
  • -h, --host <host>: Console host; when provided, Console is started automatically

External access

  • Plain city start only starts the runtime and does not expose the Web Console.
  • city start --console still binds Console to 127.0.0.1:5315 by default.
  • city start -p starts Console automatically and switches the bind address to 0.0.0.0:5315, which is suitable for server access from outside.
  • When Console is bound to 0.0.0.0, use the server IP or domain to connect, not 127.0.0.1.
  • In public mode, startup output also prints Public URL.
  • If the machine cannot determine a real public IP by itself (for example behind NAT / reverse proxy / load balancer), start city behind a reachable server, domain, or tunnel.
  • city start saves the auto-detected public IP as global DOWNCITY_PUBLIC_HOST; if the deployment environment already injects DOWNCITY_PUBLIC_URL or DOWNCITY_PUBLIC_HOST, it does not overwrite the existing value.

Port meanings

  • 5314: city runtime API port for health, service, task, plugin, and related endpoints.
  • 5315: Console Web UI port for browser access.

Example Output (Based on Current Implementation)

The examples below are aligned with current command implementations in packages/downcity/src (including default output mode and field structure). Placeholder values are used for environment-specific fields.

$ city start --console
city version: 1.0.0
✅ city runtime started
   pid: <runtimePid>
   log: <cityRuntimeLogPath>
   port: 5314
   usage: Runtime API / service endpoints (health, service, task, plugin)
✅ Console started
   pid: <consolePid>
   url: http://127.0.0.1:5315
   public_url: http://203.0.113.10:5315
   log: <consoleLogPath>
   port: 5315
   usage: Console Web UI / control plane
✅ Console token initialized
   subject: local-cli
   name: console-bootstrap
   token: dc_xxx
   next: paste the Bearer Token above into Console UI / Extension
$ city start
city version: 1.0.0
✅ city runtime started
   pid: <runtimePid>
   log: <cityRuntimeLogPath>
   port: 5314
   usage: Runtime API / service endpoints (health, service, task, plugin)