Skip to Content

cmdop logs

Tail or print the daemon’s log file. cmdop logs is a top-level alias for cmdop agent logs — both read the same file.

Common usage

cmdop logs # last 200 lines cmdop logs -n 1000 # last 1000 lines cmdop logs -f # follow (tail -f) cmdop logs --raw # no formatting cmdop agent logs # same thing under the agent subtree

Log file locations

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

Session boundaries

Each daemon start emits a grep-friendly marker:

=== DAEMON SESSION START === ts=2026-04-27T10:15:30Z mode=prod workspace=acme-prod version=v1.2.0

Use it to find the current session in a long-running log file:

grep -n "DAEMON SESSION START" "$(cmdop logs --path)"

Rotation policy

Logs are size-rotated by lumberjack — they accumulate across daemon restarts rather than being truncated. Defaults: rotate at 100 MB, keep 5 backups, max age 28 days. Override in ~/.cmdop/config.yaml:

logging: max_size_mb: 200 max_backups: 10 max_age_days: 60

Log level

Set verbosity with --log-level or the env var CMDOP_LOG_LEVEL:

cmdop --log-level debug agent start --foreground CMDOP_LOG_LEVEL=debug cmdop agent restart

Levels: debug, info (default), warn, error.

JSON format

Switch to JSON logs for ingestion into Loki / Splunk / Elastic:

cmdop --log-format json agent start --foreground

Or persist:

cmdop config set logging.format json cmdop agent restart

Filter examples

# Only WARN+ from the current session grep "DAEMON SESSION START" "$(cmdop logs --path)" -A 99999 | grep -E "WARN|ERROR" # Tail with grep cmdop logs -f | grep --line-buffered "permission" # Last 500 lines as JSON to jq cmdop logs -n 500 --raw | jq -r '. | select(.level == "error")'
cmdop logs --path # → /Users/you/Library/Logs/cmdop/cmdop.log

Useful in scripts or when piping to other tools:

tail -F "$(cmdop logs --path)" less "$(cmdop logs --path)"
Last updated on