Daemon Commands
All Cmd+Ctrl daemons share the same CLI structure and commands.
Command Overview
| Command | Description |
|---|---|
register | Register this device with a Cmd+Ctrl server |
unregister | Remove local registration data |
start | Start the daemon and connect to the server |
stop | Stop the running daemon |
status | Check daemon connection status |
Commands
register
Register this device with a Cmd+Ctrl server.
bash
cmdctrl-<agent> register [options]Options:
| Option | Description | Default |
|---|---|---|
-s, --server <url> | Cmd+Ctrl server URL | http://localhost:4000 |
-n, --name <name> | Device name | System 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.aiFlow:
- CLI requests a device code from the server
- Displays a verification URL and code
- User opens URL in browser and signs in
- User authorizes the device
- CLI receives access token and stores it locally
unregister
Remove local registration data.
bash
cmdctrl-<agent> unregisterThis 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:
| Option | Description | Default |
|---|---|---|
-f, --foreground | Run 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 -fNotes:
- 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> stopSends a termination signal to the daemon process.
status
Check the daemon's registration and connection status.
bash
cmdctrl-<agent> statusOutput 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: ConnectedGlobal Options
All commands support:
| Option | Description |
|---|---|
--version | Show version number |
--help | Show help |
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Not registered |
| 3 | Already running (for start) |
| 4 | Not running (for stop) |
Environment Variables
| Variable | Description |
|---|---|
CMDCTRL_SERVER | Default server URL (overrides built-in default) |
CMDCTRL_CONFIG_DIR | Override config directory location |
CMDCTRL_LOG_LEVEL | Log level: debug, info, warn, error |
Configuration Files
Each daemon stores configuration in ~/.<daemon-name>/:
| Daemon | Config Directory |
|---|---|
| Claude Code | ~/.cmdctrl-claude-code/ |
| Cursor IDE | ~/.cmdctrl-cursor-ide/ |
| Aider | ~/.cmdctrl-aider/ |
Files:
| File | Purpose | Permissions |
|---|---|---|
config.json | Server URL, device name, device ID | 644 |
credentials | Access token | 600 |
daemon.pid | PID of running daemon | 644 |
config.json format:
json
{
"server": "https://api.cmd-ctrl.ai",
"deviceName": "Work MacBook",
"deviceId": "dev_abc123xyz"
}Daemon-Specific Notes
Claude Code
- Spawns
claudeCLI 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
aiderandagentapiin PATH
