Every ./shard-db <cmd> subcommand in one place. Shortcuts for the common operations — for full expressiveness see the Query protocol.
All data-plane commands (anything besides start/stop/status/server) talk to the running server over TCP at $PORT. Start the server first.
Looking for a TUI?shard-cli is a separate ncurses binary built alongside shard-db — full menu-driven access to every JSON mode (browse / query / schema / maintenance / auth / stats), no JSON typing required.
JSON array of {"key":"<key>","value":{...}} objects, or dict form {"k1":{...},"k2":{...}}. File path or stdin. Acts as upsert (overwrites existing keys; if_not_exists available via JSON mode).
bulk-delete
<dir> <obj> [file]
JSON array of keys (e.g. ["k1","k2"]). For criteria-based deletes, use JSON mode.
bulk-update has no CLI shortcut — use JSON mode. It has three sub-shapes: (1) criteria + value to filter then patch matching records, (2) records: for per-key patches inline, (3) file: for the same from disk. CSV input via bulk-update-delimited.
Fast in-place tombstone reclaim (no schema changes). For compact/reshard, use JSON mode.
recount
<dir> <obj>
Rescans shards and rewrites the cached counts file.
truncate
<dir> <obj>
Delete all records. Schema + indexes survive.
backup
<dir> <obj>
Copy the object's data + metadata + indexes to a timestamped backup directory.
edit-field
<dir> <obj> <name:type[:param]>
Single-field shortcut for edit-field. Same-type edits only (varchar grow/shrink, integer family widen/narrow, numeric scale change, float→double). v2 only. Use JSON mode for batch edits.
Global snapshot: uptime, active connections, in-flight writes, cache hit rates, recent slow queries. Prints as table.
stats-prom
—
Same counters as stats, rendered as Prometheus text-format exposition. Wire to your scrape pipeline.
shard-stats
[dir] [obj]
Per-shard load table. Without args, shows all objects; with one arg, all objects in that dir; with both, just that object.
db-dirs
—
List registered tenant directories (from dirs.conf).
vacuum-check
—
List objects where tombstoned ≥ 10 % AND live ≥ 1000. Suggests candidates for vacuum.
reindex
[dir] [obj]
Rebuild indexes — wipes per-field idx directories and rebuilds at the current index_splits_for(splits) shard count. No args = all tenants.
orphaned
<dir> <obj>
Bare integer count of tombstoned-but-not-vacuumed slots. O(1) metadata read. New in 2026.05.1.
(./migrate)
—
Per-release one-shot upgrade runner — separate binary at build/bin/migrate. Stops the daemon, runs every required migration for the release, restarts the daemon, exits. For 2026.05.1: migrate-files (lift pre-2026.05.2 XX/XX/<filename> to flat) + reindex (per-shard btree rebuild).