Skip to Content

Agent Management

TL;DR

The CMDOP agent is a lightweight background daemon that maintains machine connectivity. Manage it with cmdop agent start/stop/restart/status. View logs with cmdop agent logs -f. Install as a system service for auto-start on macOS (launchd), Linux (systemd), or Windows. Uses approximately 20-50 MB memory and less than 1% CPU when idle.

The Cmdop agent runs in the background, maintaining connectivity.

How do I start the agent?

# Start the agent as a background daemon cmdop agent start

Run in foreground for debugging:

# Run in foreground to see real-time output cmdop agent start --foreground

How do I stop the agent?

# Gracefully shut down the agent cmdop agent stop

How do I restart the agent?

# Stop and start the agent in one command cmdop agent restart

How do I check the agent status?

# Show agent PID, connectivity, and uptime cmdop agent status

Output:

Agent Status: Running PID: 12345 Machine ID: abc123xyz Connected: Yes Last Ping: 2s ago Uptime: 4h 23m

How do I view agent logs?

# View recent agent log entries cmdop agent logs

Follow logs in real-time:

# Stream logs continuously (like tail -f) cmdop agent logs -f

Where are the log files stored?

PlatformLocation
macOS~/Library/Logs/cmdop/agent.log
Linux~/.cmdop/logs/agent.log
Windows%APPDATA%\cmdop\logs\agent.log

How do I set up auto-start?

macOS (launchd)

# Install as a launchd service (starts on boot) cmdop agent install

Linux (systemd)

# Install as a systemd service (starts on boot) cmdop agent install --systemd

Windows (Service)

# Install as a Windows service (starts on boot) cmdop agent install --service

How do I uninstall auto-start?

# Remove the auto-start service configuration cmdop agent uninstall

How do I configure the agent?

Config file: ~/.cmdop/config.yaml

agent: log_level: info # Logging verbosity (debug, info, warn, error) reconnect_interval: 5s # Wait time before reconnect attempts ping_interval: 30s # Heartbeat interval to keep connection alive connection: relay_url: wss://relay.cmdop.com # WebSocket relay server api_url: https://api.cmdop.com # Control Plane API endpoint

How much resources does the agent use?

The agent is designed to be lightweight:

  • Memory: ~20-50 MB
  • CPU: Less than 1% idle
  • Network: Minimal (WebSocket keepalive)

How do I troubleshoot agent issues?

Agent Won’t Start

  1. Check if already running: cmdop agent status
  2. Check logs: cmdop agent logs
  3. Verify credentials: cmdop login

Connection Issues

  1. Check network: curl https://api.cmdop.com/health
  2. Check firewall settings
  3. Try restart: cmdop agent restart
Last updated on