CLI Reference

IndexBus ships three command-line tools for inspection, routing, and application scaffolding.

indexbus-inspect

Inspect shared-memory regions from the command line. Output includes region kind, initialized state, layout version, capability bits, queue depths, and slot pool utilization.

Human-Readable Output

cargo run -p indexbus-inspect -- /dev/shm/my_region

Machine-Readable JSON

cargo run -p indexbus-inspect -- --json /dev/shm/my_region

Journal Commands

# Dump all journal records
cargo run -p indexbus-inspect -- --journal-dump /dev/shm/my_journal

# Watch for new journal records (tail mode)
cargo run -p indexbus-inspect -- --journal-watch /dev/shm/my_journal

indexbus-route

Run a standalone router process for a SHM fanout region.

cargo run -p indexbus-route -- \
    --path /dev/shm/my_region \
    --mode work \
    --policy drop

Modes

ModeBehavior
broadcastDeliver to all consumers (best-effort)
workWork-queue with round-robin selection

Policies

PolicyBehavior
dropDrop on full queue or no credit
parkBlock until space is available

Periodic Stats Output

The router prints periodic statistics to stdout:

sent/sec: 1200000  routed/sec: 1200000  delivered/sec: 1200000
recv/sec: 1200000  drops/sec: 0  qdepth: src_0 consumers=[0]

Credit Flags

FlagDescription
--credit-maxMaximum credit budget per consumer
--credit-policyPolicy on exhaustion: drop, detach, or park
--detach-after-msSustained exhaustion duration before detach

indexbus-app

Application template with multi-process roles and platform wiring.

Subcommands

Run each subcommand in a separate terminal for multi-process operation:

cargo run -p indexbus-app -- ingest
cargo run -p indexbus-app -- process --consumer-index 0
cargo run -p indexbus-app -- sink --consumer-index 0

All-in-One Mode

Run all roles in a single process:

cargo run -p indexbus-app -- all --process-consumer-index 0 --sink-consumer-index 0

Configuration Flags

FlagEnv VarDescription
--cleanRemove stale SHM files on start
--shm-dir <path>INDEXBUS_TEMPLATE_SHM_DIRSHM directory
--raw-stream <name>Raw region name
--processed-stream <n>Processed region name
--http-bind <addr>INDEXBUS_TEMPLATE_HTTP_BINDAdmin server bind address

The HTTP admin server exposes /healthz, /readyz, and /metrics (with the prometheus feature).

Provenance
Need the canonical source?
Use the public hub to orient yourself, then jump to repo-owned docs or rustdoc when you need contract-level detail.