Documents
cli-reference
cli-reference
Type
External
Status
Published
Created
Mar 4, 2026
Updated
Mar 4, 2026

CLI Reference#

This document provides comprehensive reference information for all DaemonEye command-line interfaces.


Table of Contents#

[TOC]


Overview#

DaemonEye provides three main command-line tools:

  • procmond: Privileged process collector daemon
  • daemoneye-agent: Detection orchestrator and lifecycle manager
  • daemoneye-cli: Command-line interface for queries and management

procmond#

The privileged process monitoring daemon that collects process information with minimal attack surface.

Usage#

procmond [OPTIONS]

Options#

OptionShortDefaultDescription
--database-d/var/lib/daemoneye/processes.dbDatabase path for storing process data
--log-level-linfoLog level (debug, info, warn, error)
--interval-i30Collection interval in seconds (5-3600)
--max-processes0Maximum processes per cycle (0 = unlimited)
--enhanced-metadataEnable enhanced metadata collection
--compute-hashesEnable executable hashing for integrity
--help-hPrint help information
--version-VPrint version information

Examples#

# Basic process monitoring with 30-second intervals
procmond --database /var/lib/daemoneye/processes.db --interval 30

# Enhanced collection with metadata and hashing
procmond --enhanced-metadata --compute-hashes --interval 60

# Debug mode with verbose logging
procmond --log-level debug --interval 10

# Limited collection for testing
procmond --max-processes 100 --interval 5

Configuration#

procmond is orchestrated by daemoneye-agent; collectors do not consume component-specific configuration files. When the binary is launched directly (for example during development or troubleshooting) it honours the following sources:

  1. Command-line flags (highest precedence)
  2. Environment variables (PROCMOND_*) typically injected by the agent
  3. System DaemonEye configuration file (/etc/daemoneye/config.toml)
  4. Embedded defaults (lowest precedence)

Per-user configuration is not supported for collectors; only the operator-facing CLI honours user-scoped overrides when invoked directly.

Operators should configure collection behaviour through the agent, which materialises these settings when spawning the collector.

Exit Codes#

CodeDescription
0Success
1Unhandled error returned from the runtime (includes configuration, permission, database)
2CLI argument parsing failure reported by clap

daemoneye-agent#

The detection orchestrator that manages procmond lifecycle, executes detection rules, and handles alerting.

Usage#

daemoneye-agent [OPTIONS]

Options#

OptionShortDefaultDescription
--database-d/var/lib/daemoneye/processes.dbDatabase path for process data
--log-level-linfoLog level (debug, info, warn, error)
--help-hPrint help information
--version-VPrint version information

Examples#

# Start orchestrator with default settings
daemoneye-agent

# Use custom database location
daemoneye-agent --database /custom/path/processes.db

# Enable debug logging
daemoneye-agent --log-level debug

# Test mode (exits immediately for integration tests)
DAEMONEYE_AGENT_TEST_MODE=1 daemoneye-agent

Environment Variables#

VariableDescription
DAEMONEYE_AGENT_TEST_MODESet to 1 to enable test mode (immediate exit)

Features#

  • Embedded EventBus Broker: Runs daemoneye-eventbus broker for multi-collector coordination
  • IPC Server: Provides IPC server for CLI communication via protobuf over Unix sockets/named pipes
  • IPC Client: Communicates with procmond via protobuf over Unix sockets/named pipes
  • Detection Engine: Executes SQL-based detection rules against collected data
  • Alert Management: Multi-channel alert delivery (stdout, syslog, webhooks, email)
  • Graceful Shutdown: Handles SIGTERM/SIGINT for clean shutdown

Configuration#

daemoneye-agent supports hierarchical configuration loading:

  1. Command-line flags (highest precedence)
  2. Environment variables (DAEMONEYE_AGENT_*)
  3. User configuration file (~/.config/daemoneye-agent/config.yaml)
  4. System configuration file (/etc/daemoneye-agent/config.yaml)
  5. Embedded defaults (lowest precedence)

daemoneye-cli#

The command-line interface for querying database statistics, health checks, and system management.

Usage#

daemoneye-cli [OPTIONS]

Options#

OptionShortDefaultDescription
--database-d/var/lib/daemoneye/processes.dbDatabase path for queries
--format-fhumanOutput format (human, json)
--help-hPrint help information
--version-VPrint version information

Examples#

# View database statistics in human-readable format
daemoneye-cli --database /var/lib/daemoneye/processes.db --format human

# Get statistics in JSON format for scripting
daemoneye-cli --database /var/lib/daemoneye/processes.db --format json

# Use default database location
daemoneye-cli --format json

Output Formats#

Human Format#

DaemonEye Database Statistics
============================
Processes: 1234
Rules: 5
Alerts: 42
System Info: 1
Scans: 100
Health status: Healthy

JSON Format#

{
  "processes": 1234,
  "rules": 5,
  "alerts": 42,
  "system_info": 1,
  "scans": 100,
  "health_status": "Healthy"
}

Configuration#

daemoneye-cli supports hierarchical configuration loading:

  1. Command-line flags (highest precedence)
  2. Environment variables (DAEMONEYE_CLI_*)
  3. User configuration file (~/.config/daemoneye-cli/config.yaml)
  4. System configuration file (/etc/daemoneye-cli/config.yaml)
  5. Embedded defaults (lowest precedence)

Common Patterns#

Basic Monitoring Setup#

# Terminal 1: Start the orchestrator
daemoneye-agent --log-level info

# Terminal 2: Monitor database statistics
watch -n 5 'daemoneye-cli --format json'

# Terminal 3: Run procmond directly (optional)
procmond --enhanced-metadata --compute-hashes

Testing and Development#

# Test procmond collection
procmond --interval 5 --max-processes 10 --log-level debug

# Test agent in test mode
DAEMONEYE_AGENT_TEST_MODE=1 daemoneye-agent

# Check database growth
daemoneye-cli --format json | jq '.processes'

Production Deployment#

# Start agent as service
systemctl start daemoneye-agent

# Monitor health
daemoneye-cli --format json | jq '.processes, .alerts'

# Check logs
journalctl -u daemoneye-agent -f

Shell Completions#

All DaemonEye CLI tools support shell completions for bash, zsh, fish, and PowerShell.

Generate Completions#

# Bash
daemoneye-cli --generate-completion bash > /etc/bash_completion.d/daemoneye-cli

# Zsh
daemoneye-cli --generate-completion zsh > ~/.zsh/completions/_daemoneye-cli

# Fish
daemoneye-cli --generate-completion fish > ~/.config/fish/completions/daemoneye-cli.fish

# PowerShell
daemoneye-cli --generate-completion powershell > DaemonEye.ps1

Error Handling#

All CLI tools follow consistent error handling patterns:

  • Exit Code 0: Success
  • Exit Code 1: General error
  • Exit Code 2: CLI argument parsing failure
  • Exit Code 3: Permission denied
  • Exit Code 4: Database error

Common Error Messages#

ErrorCauseSolution
Permission deniedInsufficient privilegesRun with appropriate privileges or check file permissions
Database lockedAnother process is using the databaseStop other DaemonEye processes or check for stale locks
Invalid intervalInterval outside 5-3600 rangeUse interval between 5 and 3600 seconds
Configuration errorInvalid configuration fileCheck configuration syntax and values

Environment Variables#

Global Environment Variables#

VariableDescriptionDefault
NO_COLORDisable colored outputNot set
TERMTerminal type (affects color detection)System default
RUST_LOGRust logging configurationNot set
RUST_BACKTRACEEnable Rust backtracesNot set

Component-Specific Variables#

procmond#

VariableDescriptionDefault
PROCMOND_DATABASEDatabase path/var/lib/daemoneye/processes.db
PROCMOND_LOG_LEVELLog levelinfo
PROCMOND_INTERVALCollection interval30

daemoneye-agent#

VariableDescriptionDefault
DAEMONEYE_AGENT_DATABASEDatabase path/var/lib/daemoneye/processes.db
DAEMONEYE_AGENT_LOG_LEVELLog levelinfo
DAEMONEYE_AGENT_TEST_MODEEnable test modeNot set

daemoneye-cli#

VariableDescriptionDefault
DAEMONEYE_CLI_DATABASEDatabase path/var/lib/daemoneye/processes.db
DAEMONEYE_CLI_FORMATOutput formathuman

Integration Examples#

Systemd Service#

[Unit]
Description=DaemonEye Agent
After=network.target

[Service]
Type=simple
User=daemoneye
Group=daemoneye
ExecStart=/usr/local/bin/daemoneye-agent --database /var/lib/daemoneye/processes.db
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target

Docker Deployment#

FROM rust:1.91-slim as builder
COPY . /app
WORKDIR /app
RUN cargo build --release

FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*
COPY --from=builder /app/target/release/daemoneye-agent /usr/local/bin/
COPY --from=builder /app/target/release/daemoneye-cli /usr/local/bin/
COPY --from=builder /app/target/release/procmond /usr/local/bin/

VOLUME ["/data"]

CMD ["daemoneye-agent", "--database", "/data/processes.db"]

Kubernetes DaemonSet#

apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: daemoneye
spec:
  selector:
    matchLabels:
      app: daemoneye
  template:
    metadata:
      labels:
        app: daemoneye
    spec:
      hostPID: true
      containers:
        - name: daemoneye-agent
          image: daemoneye/daemoneye:latest
          securityContext:
            privileged: true
          volumeMounts:
            - name: data
              mountPath: /data
            - name: proc
              mountPath: /host/proc
              readOnly: true
      volumes:
        - name: data
          hostPath:
            path: /var/lib/daemoneye
        - name: proc
          hostPath:
            path: /proc

This CLI reference provides comprehensive information for using DaemonEye command-line tools. For additional help, use the --help flag with any command or consult the user guides.