Skip to content

Recorder agent CLI reference

Recorder agent CLI reference

The recorder agent binary is rakkr-recorder-agent (crates/recorder-agent). Run it with cargo run -p rakkr-recorder-agent -- <flags> in development, or as the deployed binary on a node. Every flag has a matching RAKKR_* environment variable (via clap env) except the two pure-CLI print modes noted below.

For how these fit together, see the recorder agent architecture.

Run modes

Without a mode flag, the agent runs as a long-lived daemon.

FlagEnvBehavior
--print-inventory(CLI only)Print node inventory JSON and exit.
--print-meter-frame(CLI only)Capture/generate one meter frame, print JSON, exit.
--print-channel-map-assignmentsRAKKR_PRINT_CHANNEL_MAP_ASSIGNMENTSPrint this node’s channel-map assignments (needs a token).
--run-next-jobRAKKR_RUN_NEXT_JOBClaim and run one queued job, then exit (needs a token).
--capture-recording-idRAKKR_CAPTURE_RECORDING_IDOne-shot capture → render → upload for a recording ID.
--attach-cache-fileRAKKR_ATTACH_CACHE_FILEUpload an existing local file as a recording’s cache.

Controller / identity / transport

VariableDefaultPurpose
RAKKR_CONTROLLER_URLhttp://localhost:8787Controller base URL. HTTPS required for non-loopback hosts unless insecure is allowed.
RAKKR_ALLOW_INSECURE_CONTROLLERfalsePermit plaintext HTTP to a non-loopback controller (dev only).
RAKKR_CONTROLLER_CA_CERT_PATHPEM CA bundle to trust for the controller TLS connection.
RAKKR_CONTROLLER_TOKENNode bearer token. Without it, the daemon runs offline (no sync, no jobs).
RAKKR_NODE_IDnode_local_devStable node identifier.
RAKKR_NODE_ALIASLocal Recorder NodeHuman alias.
RAKKR_NODE_SITEUnassigned SiteSite/location.
RAKKR_NODE_ROOMUnassigned RoomRoom/location.
RAKKR_HEARTBEAT_SECONDS5Daemon tick interval.
RAKKR_JOB_POLL_SECONDS2Poll interval while a job runs (min 1).
RAKKR_MAX_CONCURRENT_RECORDINGS1Max concurrent capture workers (controller can override).
RAKKR_MONITOR_CHUNK_SYNC_ENABLEDtrueWhether to POST live-listen monitor audio chunks.

CLI names for identity are --node-id, --node-alias, --node-site, --node-room (the underlying config fields are alias/site/room).

Capture

VariableDefaultPurpose
RAKKR_CAPTURE_BACKENDalsaalsa / jack / pipewire.
RAKKR_CAPTURE_COMMANDarecordCapture executable. Auto-swaps to pw-record / jack_capture if left at arecord for those backends.
RAKKR_CAPTURE_DEVICEdefaultDevice / target / port string.
RAKKR_CAPTURE_FORMATS16_LEPCM sample format.
RAKKR_CAPTURE_SAMPLE_RATE48000Sample rate (Hz).
RAKKR_CAPTURE_CHANNELS2Channel count.
RAKKR_CAPTURE_SECONDS60Duration for one-shot/local capture mode.
RAKKR_CAPTURE_ARGS_TEMPLATEOverride capture args (placeholders; see below).
RAKKR_CHANNEL_RENDER_COMMANDffmpegTool used to render channel maps / re-encode.
RAKKR_CAPTURE_MIN_OUTPUT_BYTES128Minimum acceptable output size (smaller = “too small” failure).
RAKKR_CAPTURE_GROWTH_GRACE_SECONDS10Grace before growth-stall checks begin.
RAKKR_CAPTURE_STALLED_SECONDS30If output stops growing this long (after grace), capture is “stalled”.
RAKKR_CAPTURE_OUTPUTExplicit output path for one-shot capture.
RAKKR_CAPTURE_OUTPUT_CODECinferred (wav)wav / flac / mp3.
RAKKR_CAPTURE_OUTPUT_BITRATE_KBPS128 (mp3)mp3 bitrate.
RAKKR_CAPTURE_OUTPUT_VBRtruemp3 VBR (mp3 only).

Command templates

RAKKR_CAPTURE_ARGS_TEMPLATE and RAKKR_METER_ARGS_TEMPLATE replace the built-in per-backend argument list. They are shell-split (quoting works) and substitute these placeholders per token: {device}, {format}, {sample_rate}, {channels}, {seconds}, {output} / {output_path} (for meters, the output is -, i.e. stdout). The configured executable (--capture-command) is still the program run.

Attach-cache mode

VariableDefaultPurpose
RAKKR_ATTACH_CACHE_RECORDING_IDRecording to attach a file to.
RAKKR_ATTACH_CACHE_FILELocal file to upload.
RAKKR_ATTACH_CACHE_CONTENT_TYPEaudio/mpegContent-Type of the upload.
RAKKR_ATTACH_CACHE_DURATION_SECONDSOptional duration header.
RAKKR_ATTACH_CACHE_FILE_NAMEOptional override filename.

Metering

VariableDefaultPurpose
RAKKR_METER_BACKENDalsaalsa / jack / pipewire / synthetic.
RAKKR_METER_ARGS_TEMPLATEOverride meter capture args (placeholders; - = stdout).
RAKKR_METER_SAMPLE_SECONDS1Seconds sampled per meter frame (min 1).
RAKKR_METER_CLIP_DBFS-1.0Clipping threshold (peak dBFS).
RAKKR_METER_FLATLINE_DBFS-120.0Flatline threshold (all channels RMS ≤ this).
RAKKR_METER_LOW_SIGNAL_DBFS-55.0Low-signal threshold (max RMS ≤ this, not flatline).

The channel-correlation alert threshold is a fixed constant (0.98), not configurable.

Health log

VariableDefaultPurpose
RAKKR_AGENT_HEALTH_LOG_FILEdata/agent/health-events.jsonlJSONL health log path.
RAKKR_AGENT_HEALTH_LOG_STOREjsonljsonl / sqlite (SQLite unavailable under Miri).
RAKKR_AGENT_HEALTH_SQLITE_FILEdata/agent/health-events.sqlite3SQLite store path.
RAKKR_AGENT_HEALTH_LOG_MAX_BYTES1048576Rotate JSONL at this size (0 disables rotation).
RAKKR_AGENT_HEALTH_LOG_RETAINED_FILES3Rotated files kept (0 deletes instead of rotating).

System health

VariableDefaultPurpose
RAKKR_SYSTEM_HEALTH_ENABLEDtrueEnable disk/CPU/audio-backend checks.
RAKKR_SYSTEM_HEALTH_DF_COMMANDdfDisk-usage command (df -Pk <path>).
RAKKR_SYSTEM_HEALTH_DISK_PATH.Path to measure disk usage for.
RAKKR_SYSTEM_HEALTH_DISK_WARNING_PERCENT85.0Disk used% warning.
RAKKR_SYSTEM_HEALTH_DISK_CRITICAL_PERCENT95.0Disk used% critical.
RAKKR_SYSTEM_HEALTH_LOAD_WARNING_PER_CORE2.01-min loadavg/core warning.
RAKKR_SYSTEM_HEALTH_LOAD_CRITICAL_PER_CORE4.01-min loadavg/core critical.
RAKKR_SYSTEM_HEALTH_LOADAVG_PATH/proc/loadavgLoadavg source.

Inventory probes & state

VariableDefaultPurpose
RAKKR_INVENTORY_ARECORD_COMMANDarecordCommand for -l listing and --dump-hw-params.
RAKKR_INVENTORY_PROC_ASOUND_PCM_PATH/proc/asound/pcmFallback PCM device list.
RAKKR_AGENT_STATE_FILEdata/agent/job-state.jsonPersisted job state for recovery.
RAKKR_RECORDER_CACHE_MANIFEST_FILEdata/agent/recorder-cache-manifest.jsonTracks uploaded cache for retention sweeps.

Logging

Tracing verbosity is controlled by RUST_LOG (baseline info), not a RAKKR_* variable.