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 subtreeLog file locations
| Platform | Path |
|---|---|
| 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.0Use 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: 60Log 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 restartLevels: debug, info (default), warn, error.
JSON format
Switch to JSON logs for ingestion into Loki / Splunk / Elastic:
cmdop --log-format json agent start --foregroundOr persist:
cmdop config set logging.format json
cmdop agent restartFilter 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")'Print the path only
cmdop logs --path
# → /Users/you/Library/Logs/cmdop/cmdop.logUseful in scripts or when piping to other tools:
tail -F "$(cmdop logs --path)"
less "$(cmdop logs --path)"Related
Last updated on