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 startRun in foreground for debugging:
# Run in foreground to see real-time output
cmdop agent start --foregroundHow do I stop the agent?
# Gracefully shut down the agent
cmdop agent stopHow do I restart the agent?
# Stop and start the agent in one command
cmdop agent restartHow do I check the agent status?
# Show agent PID, connectivity, and uptime
cmdop agent statusOutput:
Agent Status: Running
PID: 12345
Machine ID: abc123xyz
Connected: Yes
Last Ping: 2s ago
Uptime: 4h 23mHow do I view agent logs?
# View recent agent log entries
cmdop agent logsFollow logs in real-time:
# Stream logs continuously (like tail -f)
cmdop agent logs -fWhere are the log files stored?
| Platform | Location |
|---|---|
| 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 installLinux (systemd)
# Install as a systemd service (starts on boot)
cmdop agent install --systemdWindows (Service)
# Install as a Windows service (starts on boot)
cmdop agent install --serviceHow do I uninstall auto-start?
# Remove the auto-start service configuration
cmdop agent uninstallHow 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 endpointHow 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
- Check if already running:
cmdop agent status - Check logs:
cmdop agent logs - Verify credentials:
cmdop login
Connection Issues
- Check network:
curl https://api.cmdop.com/health - Check firewall settings
- Try restart:
cmdop agent restart
Last updated on