Skip to content

Listing and inspecting processes

daemonitor-cli provides non-interactive commands for one-shot snapshots, continuous watching, historical queries, build history, daemon logs, and host diagnostics.

All commands support --format plain|json|jsonl|csv (with --json as shorthand for --format json, except logs <pid>, health, host, and sessions, which do not support csv).

One-shot process snapshots

List currently running build processes:

daemonitor-cli ps

Show full key/value OS and JVM attributes per process:

daemonitor-cli ps --details

Output structured JSON:

daemonitor-cli ps --json

Filtering processes

Filter snapshots by PID, project substring, build system, runtime, or toolchain:

# Filter by project name (case-insensitive substring on basename or command line)
daemonitor-cli ps --project myapp

# Filter by PID
daemonitor-cli ps --pid 48210

# Filter by build system: gradle, bazel, xcode, amper (or kotlin-toolchain), unknown (or other)
daemonitor-cli ps --build-system bazel
daemonitor-cli ps --build-system gradle

# Filter by runtime: jvm, native, unknown
daemonitor-cli ps --build-system bazel --runtime native

# Distinguish Bazel Kotlin workers from Gradle Kotlin daemons
daemonitor-cli ps --build-system bazel --toolchain kotlin
daemonitor-cli ps --build-system gradle --toolchain kotlin

Path sanitization by default

To protect local directory paths in shared logs or CI artifacts, ps, history, builds, and logs strip full paths to basenames by default. Pass --include-project-path when you explicitly need full paths.

Watching processes and CI memory thresholds

Stream periodic snapshots in non-interactive mode using --watch:

# Watch every 2 seconds for 5 minutes
daemonitor-cli ps --watch --poll-interval 2s --until 5m

# Fail CI with exit code 3 if any matching process reaches 6144 MB RSS
daemonitor-cli ps --watch --project myapp --fail-on-rss 6144 --until 10m
  • --fail-on-rss requires --watch (otherwise exits with status 2).
  • Exit code 3 indicates a filtered process reached or exceeded the RSS threshold in MB.

Querying historical process samples, logs, and host diagnostics

# Historical process samples (default --since 15m, --limit 200)
daemonitor-cli history --since 1h --project myapp --json

# List discovered Gradle daemon logs, or tail a specific daemon PID
daemonitor-cli logs
daemonitor-cli logs 48210

# Check daemonitor-cored health, host resources, and metric capabilities
daemonitor-cli health
daemonitor-cli host
daemonitor-cli metrics list

For build-associated history and command-scoped observation sessions, see Build History, Observation sessions, and the complete CLI commands reference.