Service and daemon
The daemon owns the Local API, remote-control connection, and state that must continue beyond the current terminal. Service commands keep the daemon available through the current user's operating-system service mechanism.
Use the App to confirm service or device status. Use the CLI commands to install, bind, restart, or troubleshoot the daemon. See Connect the CLI from the App for the connection flow.
Run the daemon in the foreground
originrouter daemon
| Flag | Purpose |
|---|---|
--relay <url> | Set the relay URL |
--relay-mode auto|cloud|local|custom | Select the relay source; auto uses authenticated cloud when signed in and otherwise remains local |
--device <device-id> | Override the device identifier |
--local-port <port> | Set the Local API port |
--bind 127.0.0.1|0.0.0.0 | Set the listen address |
--allow-lan | Explicitly permit LAN access |
Keep the default loopback bind unless a trusted network, valid token, and explicit access requirement all exist.
originrouter daemon-port reads the current Local API URL from daemon.state.json. It returns a non-zero status when no running daemon state is available.
System service
originrouter service install
originrouter service start
originrouter service status
Run these commands in order:
service installregisters the current-user service.service startstarts the daemon.service statusconfirms that it is running.
Available actions are install, start, stop, restart, status, and uninstall. Every action supports --dry-run so you can inspect operating-system commands without writing service configuration.
Service mechanism
The service uses the current-user mechanism provided by each supported platform.
Install and start
After installing the service, run service start to launch the daemon.
Automatic start
“Start at boot” means the current user's login or session startup: a macOS LaunchAgent, Linux systemctl --user, or a Windows logon-triggered task. It is not a privileged system-boot service.
Uninstall impact
Uninstalling the service removes its service configuration, but does not remove account, provider, route, or conversation data.
Local API configuration
originrouter local config show
originrouter local config set \
--port 43110 \
--bind 127.0.0.1 \
--allow-lan off \
--relay-mode auto
Run local config show first, then apply changes with local config set. Restart the service after changing the configuration.
Settings include --port, --bind, --allow-lan on|off, --relay-mode auto|cloud|local|custom, and --relay-url. Restart the service after a change, then verify with daemon-port and the App connection state.
Agents and ordinary commands
| Command | Runtime |
|---|---|
claude [args...] | Native Claude Code TUI with OriginRouter remote control |
codex [args...] | Native Codex TUI with OriginRouter remote control |
claude-terminal / claude-sdk | Managed Claude Agent SDK session |
codex-terminal / codex-app-server | Managed Codex app-server session |
run -- <command> | Run an ordinary child process through the wrapper and propagate its exit status |
--native-config preserves native-agent authentication, model, environment, and configuration while adding remote control.
Recovery order
originrouter service statusoriginrouter daemon-portoriginrouter doctororiginrouter service restart- Inspect bind, port, LAN, and relay settings in
local config show
If a collaboration run is daemon-owned, losing the local terminal does not prove that the run stopped. Restore the service, then inspect it with collaboration show or attach.