cmdop service
Register cmdop agent as a system service so it survives reboot. Cross-platform: launchd on macOS, systemd user service on Linux, Windows Service on Windows.
Subcommands
cmdop service install # platform-detect; install + enable
cmdop service uninstall # remove the service
cmdop service start # start it
cmdop service stop # stop it
cmdop service restart # restart it
cmdop service status # show service stateWhere it installs
| Platform | Backend |
|---|---|
| macOS | LaunchAgent plist at ~/Library/LaunchAgents/com.cmdop.agent.plist |
| Linux | systemd user service at ~/.config/systemd/user/cmdop.service |
| Windows | Windows Service named “CMDOP Agent” |
When to use it
Once a machine is “production” — a VPS, a build runner, a kiosk — install the service. The daemon then starts at boot, survives kill, and auto-restarts on crash.
cmdop service install
cmdop service statusFor ephemeral machines (your laptop, dev VMs), cmdop agent start once per session is usually enough.
Status output
$ cmdop service status
Service: com.cmdop.agent (LaunchAgent)
State: running
PID: 12345
Loaded at: 2026-04-22T08:15:12Z
Last exit: -If the service crashes, the platform supervisor restarts it. If it crashes within seconds repeatedly, supervisor backs off — check cmdop logs for the failure cause.
Linger on Linux
On Linux, the systemd user service runs only while you have an active login session unless you enable lingering:
sudo loginctl enable-linger $USERAfter this, the service runs even when no user is logged in (the typical case for headless servers).
Without lingering, your daemon dies when you log out. On a headless VPS where you only ever SSH in occasionally, this means the machine will appear offline as soon as you disconnect.
Uninstalling
cmdop service uninstallRemoves the platform-level registration but keeps your config, tokens, logs, and database in place. Reinstall any time with cmdop service install.
Combining with auto-update
Pair the service with cmdop update schedule to get a fully unattended deployment:
cmdop service install
cmdop update schedule --interval 24h --auto-applyThe service stays registered; the daemon checks for updates daily and swaps the binary in-place. See ./update.
Foreground mode for debugging
If the service won’t start, run the daemon in foreground to see why:
cmdop service stop
cmdop agent start --foregroundLogs print to your terminal directly. Stop with Ctrl+C, then cmdop service start to restore the service.