Skip to content

Daemon Commands

All Cmd+Ctrl daemons share the same CLI structure and commands.

Command Overview

CommandDescription
registerRegister this device with a Cmd+Ctrl server
unregisterRemove local registration data
startStart the daemon and connect to the server
stopStop the running daemon
statusCheck daemon connection status

Commands

register

Register this device with a Cmd+Ctrl server.

bash
cmdctrl-<agent> register [options]

Options:

OptionDescriptionDefault
-s, --server <url>Cmd+Ctrl server URLhttp://localhost:4000
-n, --name <name>Device nameSystem hostname

Examples:

bash
# Register with production server
cmdctrl-claude-code register -s https://api.cmd-ctrl.ai

# Register with custom name
cmdctrl-claude-code register -s https://api.cmd-ctrl.ai -n "Work MacBook"

# Register Cursor (defaults to hostname-cursor)
cmdctrl-cursor-ide register -s https://api.cmd-ctrl.ai

Flow:

  1. CLI requests a device code from the server
  2. Displays a verification URL and code
  3. User opens URL in browser and signs in
  4. User authorizes the device
  5. CLI receives access token and stores it locally

unregister

Remove local registration data.

bash
cmdctrl-<agent> unregister

This removes the local configuration and credentials. The device will still appear in your Cmd+Ctrl account until you delete it from the web interface.

start

Start the daemon and connect to the Cmd+Ctrl server.

bash
cmdctrl-<agent> start [options]

Options:

OptionDescriptionDefault
-f, --foregroundRun in foreground (don't daemonize)false

Examples:

bash
# Start in background (default)
cmdctrl-claude-code start

# Start in foreground (for debugging or service managers)
cmdctrl-claude-code start -f

Notes:

  • The daemon must be registered before starting
  • Background mode creates a detached process
  • Foreground mode is recommended when running under a service manager (systemd, launchd, PM2)

stop

Stop the running daemon.

bash
cmdctrl-<agent> stop

Sends a termination signal to the daemon process.

status

Check the daemon's registration and connection status.

bash
cmdctrl-<agent> status

Output includes:

  • Registration status (registered/not registered)
  • Server URL
  • Device name
  • Device ID
  • Connection state (connected/disconnected/not running)

Example output:

Status: Registered
Server: https://api.cmd-ctrl.ai
Device: Work MacBook
ID: dev_abc123xyz
Connection: Connected

Global Options

All commands support:

OptionDescription
--versionShow version number
--helpShow help

Exit Codes

CodeMeaning
0Success
1General error
2Not registered
3Already running (for start)
4Not running (for stop)

Environment Variables

VariableDescription
CMDCTRL_SERVERDefault server URL (overrides built-in default)
CMDCTRL_CONFIG_DIROverride config directory location
CMDCTRL_LOG_LEVELLog level: debug, info, warn, error

Configuration Files

Each daemon stores configuration in ~/.<daemon-name>/:

DaemonConfig Directory
Claude Code~/.cmdctrl-claude-code/
Cursor IDE~/.cmdctrl-cursor-ide/
Aider~/.cmdctrl-aider/

Files:

FilePurposePermissions
config.jsonServer URL, device name, device ID644
credentialsAccess token600
daemon.pidPID of running daemon644

config.json format:

json
{
  "server": "https://api.cmd-ctrl.ai",
  "deviceName": "Work MacBook",
  "deviceId": "dev_abc123xyz"
}

Daemon-Specific Notes

Claude Code

  • Spawns claude CLI processes for sessions
  • Requires Claude Code CLI installed and authenticated

Cursor IDE

  • Connects to Cursor via Chrome DevTools Protocol (CDP)
  • Requires Cursor running with --remote-debugging-port=9222
  • Default CDP port: 9222

Aider

  • Uses AgentAPI to manage Aider sessions
  • Requires both aider and agentapi in PATH