| Crates.io | aimdb-cli |
| lib.rs | aimdb-cli |
| version | 0.4.0 |
| created_at | 2025-11-06 22:35:58.846097+00 |
| updated_at | 2025-12-25 21:00:58.171408+00 |
| description | Command-line interface for AimDB - development and administration tool |
| homepage | https://aimdb.dev |
| repository | https://github.com/aimdb-dev/aimdb |
| max_upload_size | |
| id | 1920837 |
| size | 70,648 |
Command-line interface for introspecting and managing running AimDB instances.
The AimDB CLI is a thin client over the AimX v1 remote access protocol, providing intuitive commands for:
Build from source:
cd /aimdb
cargo build --release -p aimdb-cli
The binary will be available at target/release/aimdb.
aimdb instance list
Example output:
┌──────────────────────┬────────────────┬──────────┬─────────┬──────────┬───────────────┐
│ Socket Path │ Server Version │ Protocol │ Records │ Writable │ Authenticated │
├──────────────────────┼────────────────┼──────────┼─────────┼──────────┼───────────────┤
│ /tmp/aimdb-demo.sock │ aimdb │ 1.0 │ 2 │ 0 │ no │
└──────────────────────┴────────────────┴──────────┴─────────┴──────────┴───────────────┘
aimdb record list
Example output:
┌──────────────────────┬────────────────────────────────────────────┬───────────────┬───────────┬───────────┬──────────┐
│ Name │ Type ID │ Buffer Type │ Producers │ Consumers │ Writable │
├──────────────────────┼────────────────────────────────────────────┼───────────────┼───────────┼───────────┼──────────┤
│ server::Temperature │ TypeId(0xaee15e261d918c67cee5a96c2f604ce0) │ single_latest │ 1 │ 2 │ no │
│ server::Config │ TypeId(0xc2af5c8376864a24e916c87f88505fac) │ mailbox │ 0 │ 3 │ yes │
└──────────────────────┴────────────────────────────────────────────┴───────────────┴───────────┴───────────┴──────────┘
aimdb record get server::Temperature
Example output:
{
"celsius": 23.5,
"sensor_id": "sensor-001",
"timestamp": 1730379296
}
aimdb watch server::Temperature
Example output:
📡 Watching record: server::Temperature (subscription: sub-123)
Press Ctrl+C to stop
2025-11-02 10:30:45.123 | seq:42 | {"celsius":23.5,"sensor_id":"sensor-001","timestamp":1730379296}
2025-11-02 10:30:47.456 | seq:43 | {"celsius":23.6,"sensor_id":"sensor-001","timestamp":1730379298}
2025-11-02 10:30:49.789 | seq:44 | {"celsius":23.7,"sensor_id":"sensor-001","timestamp":1730379300}
^C
✅ Stopped watching
aimdb record set server::Config '{"log_level":"debug","max_connections":100}'
instance listList all running AimDB instances by scanning for Unix domain socket files.
aimdb instance list [--format <FORMAT>]
Options:
-f, --format <FORMAT>: Output format (table, json, json-compact, yaml)instance infoShow detailed information about a specific instance.
aimdb instance info [--socket <PATH>]
Options:
-s, --socket <PATH>: Socket path (uses auto-discovery if not specified)instance pingTest connection to an instance.
aimdb instance ping [--socket <PATH>]
record listList all registered records in an AimDB instance.
aimdb record list [OPTIONS]
Options:
-s, --socket <PATH>: Socket path (uses auto-discovery if not specified)-f, --format <FORMAT>: Output format (table, json, json-compact, yaml)-w, --writable: Show only writable recordsrecord getGet the current value of a specific record.
aimdb record get <RECORD> [OPTIONS]
Arguments:
<RECORD>: Record name (e.g., server::Temperature)Options:
-s, --socket <PATH>: Socket path-f, --format <FORMAT>: Output format (default: json)record setSet the value of a writable record.
aimdb record set <NAME> <VALUE> [OPTIONS]
Arguments:
<NAME>: Record name<VALUE>: JSON value to setOptions:
-s, --socket <PATH>: Socket path--dry-run: Validate but don't actually setNote: Only records without producers can be set remotely.
watchWatch a record for live updates, displaying updates as they arrive.
aimdb watch <RECORD> [OPTIONS]
Arguments:
<RECORD>: Record name to watchOptions:
-s, --socket <PATH>: Socket path-q, --queue-size <SIZE>: Subscription queue size (default: 100)-c, --count <N>: Maximum number of events to receive (0 = unlimited)-f, --full: Show full pretty-printed JSON for each eventPress Ctrl+C to stop watching and unsubscribe cleanly.
The CLI supports multiple output formats:
yaml feature)The CLI automatically discovers running AimDB instances by scanning:
/tmp directory/var/run/aimdb directorySocket files must have a .sock extension.
You can override auto-discovery by specifying --socket <PATH> for any command.
The CLI provides clear, actionable error messages:
Error: Connection failed: /tmp/aimdb.sock
Reason: connection timeout
Hint: Check if AimDB instance is running
Error: Permission denied: record.set
Record 'server::Temperature' is not writable
Hint: Check 'writable' column in 'aimdb record list'
# Discover instances
aimdb instance list
# Check connectivity
aimdb instance ping
# List all records
aimdb record list
# Get specific values
aimdb record get server::Temperature
aimdb record get server::SystemStatus
# Find writable records
aimdb record list --writable
# Watch live updates
aimdb watch server::Temperature --count 10
# Update configuration
aimdb record set server::Config '{"log_level":"debug"}'
# Verify change
aimdb record get server::Config
# Export metrics as JSON
aimdb record list --format json > records.json
# Check specific value in script
TEMP=$(aimdb record get server::Temperature | jq '.celsius')
if (( $(echo "$TEMP > 80" | bc -l) )); then
echo "Warning: High temperature!"
fi
# Continuous monitoring
watch -n 1 'aimdb record get server::Temperature | jq ".celsius"'
The CLI uses the AimX v1 remote access protocol over Unix domain sockets with NDJSON message format.
See docs/design/008-M3-remote-access.md for the full protocol specification.
Run tests:
cargo test -p aimdb-cli
Run with logging:
RUST_LOG=debug cargo run -p aimdb-cli -- record list
See LICENSE file.