VeltrixDB Docs
v1.1.0 GitHub FAQ Quickstart

CLI Reference

Every command-line tool that ships with VeltrixDB — the operator CLI, backup/restore tool, migration and chaos-testing utilities, load generator, and Kubernetes integrations — with real invocation syntax pulled from each tool's source.

All tools live under cmd/ in the VeltrixDB repository and build independently with go build -o <name> ./cmd/<dir>. None of them require the full server dependency tree at runtime; each talks to a running veltrixdb server over TCP and/or the admin HTTP API, except where noted as an offline/file-based tool.

veltrix — operator CLI

The primary day-to-day operator tool: cluster health, GC/compaction status, cache and WAL stats, live dashboards, and direct key read/write/delete via the text protocol. Think redis-cli merged with kubectl top.

go build -o veltrix ./cmd/veltrix

Global flags

FlagDefaultDescription
--addr127.0.0.1:2112Admin/metrics HTTP address.
--tcp127.0.0.1:9000TCP data address (text protocol).
--watch0Refresh interval in seconds for status/compaction/etc.; 0 runs once.
--jsonfalsePrint raw JSON instead of formatted tables.
--no-colorfalseDisable ANSI colors (auto-disabled when stdout is not a TTY).
--prefix(empty)Key prefix filter, used by cdc-tail.

Subcommands

SubcommandPurpose
statusFull node health + ops summary: health/readiness, index size, cache, WAL, CDC, per-disk VLog table, admission-control state.
nodesCluster topology table — role (leader/follower), Raft term, health, address, replication lag. Backed by /admin/cluster.
compaction (alias gc)Per-disk VLog GC status: size, live/dead bytes, GC ratio (color-coded), GC run counters, admission-control thresholds.
replication (alias repl)Per-replica state, consistency level, lag, ACK watermark.
cacheLIRS cache hit rate, fill bar, evictions, hot-key list.
walWAL bytes written, entry count, flush count, average batch size.
quotas (alias quota)Per-namespace quota usage table. Backed by /admin/quotas.
cdcCDC broker stats: events broadcast, dropped, active subscribers.
cdc-tailStreams live CDC events to stdout (Ctrl+C to stop). Supports --prefix.
scrubberData-integrity scrubber status: records scanned, corruption count.
metrics [filter]Raw Prometheus metrics, optionally grep-filtered by substring.
tracesRecent OTel spans (slow ops and errors) from the in-process ring buffer.
topLive full-screen dashboard, refreshing every --watch seconds (default 2 if --watch is unset for this subcommand).
pingRound-trip latency check — 5 TCP PINGs plus one HTTP /healthz check.
put KEY VALUEWrite a key via the text protocol.
get KEYRead a key via the text protocol.
del KEYDelete a key via the text protocol.
checkpointForce a WAL checkpoint on all disks. Calls POST /admin/checkpoint.
backup DEST_DIRTrigger a full backup to DEST_DIR on the server host. Calls POST /admin/backup.
versionPrint engine schema version + encryption status.

Examples

veltrix status
veltrix top --watch 2
veltrix compaction --watch 5
veltrix cdc-tail --prefix orders/
veltrix metrics vlog_gc
veltrix put mykey "hello world"
veltrix get mykey
veltrix backup /mnt/backup/2026-07-05
veltrix checkpoint
veltrix --addr 10.0.0.5:2112 status

veltrixdb-backup — backup and restore tool

Offline/online backup and restore, including point-in-time recovery (PITR) and direct cloud upload/download to S3, GCS, or Azure. The engine must be stopped before restore or restore-pitr; full and incremental backups are safe to run against a live engine.

go build -o veltrixdb-backup ./cmd/backup

Local backup subcommands

SubcommandKey flagsPurpose
full--data-dirs (required), --dest (required), --cache-mb (default 64)Create a full backup. Engine can be running.
incremental--data-dirs, --dest, --base (all required), --cache-mbCreate an incremental backup relative to a base backup's manifest.
restore--chain, --data-dirs (both required)Restore from a comma-separated backup chain (oldest first). Engine must be stopped.

Point-in-time recovery subcommands

SubcommandKey flagsPurpose
archive-status--archive (required)Show WAL-archive segments, version range, and time coverage per disk.
restore-pitr--base-backup, --archive, --until, --data (all required)Restore a full base backup plus archived WAL up to an exact version:N or RFC3339 timestamp. Target data dirs must be fresh/empty.

Cloud subcommands

SubcommandKey flagsPurpose
upload--src, --provider, --bucket, plus provider auth flagsUpload a local backup directory to S3 / GCS / Azure.
download--cloud-path, --dest, --provider, --bucketDownload a cloud backup to a local directory.
list-cloud--provider, --bucketList all backups stored in cloud storage.
full-cloud--data-dirs, --provider, --bucket, --cache-mbFull local backup + upload to cloud in one step.

Shared cloud flags (from cloudFlags): --provider (s3|gcs|azure), --bucket, --prefix (default veltrixdb-backups), and provider-specific credentials: --region/--aws-access-key/--aws-secret-key for S3, --gcs-token/--gcs-cred-file for GCS, --azure-account/--azure-key for Azure. Each credential flag can instead be supplied via environment variable: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION, AWS_SESSION_TOKEN, GOOGLE_APPLICATION_CREDENTIALS, GCS_ACCESS_TOKEN, AZURE_STORAGE_ACCOUNT, AZURE_STORAGE_KEY, AZURE_STORAGE_CONTAINER.

Examples

# Full local backup of a single-disk server
veltrixdb-backup full --data-dirs=/data --dest=/backup/full-2026-07-05

# Upload a local backup to S3
veltrixdb-backup upload \
    --src=/backup/full-2026-07-05 \
    --provider=s3 --bucket=my-veltrix-backups --region=us-east-1

# Full backup straight to GCS in one step
veltrixdb-backup full-cloud \
    --data-dirs=/data \
    --provider=gcs --bucket=my-bucket --gcs-cred-file=/sa.json

# Restore (engine must be stopped)
veltrixdb-backup restore --chain=/backup/full,/backup/inc1 --data-dirs=/data-new

# Inspect the PITR WAL archive
veltrixdb-backup archive-status --archive=/backup/wal-archive

# Point-in-time restore to an exact moment
veltrixdb-backup restore-pitr \
    --base-backup=/backup/full-2026-07-05 \
    --archive=/backup/wal-archive \
    --until=2026-07-05T14:30:00Z \
    --data=/data-new
# ...or exact to a single write:  --until=version:123456

See Backup & Restore for the full disaster-recovery workflow.

veltrix-admin — low-level administrative CLI

A separate, lower-level admin tool (cmd/admin) for offline VLog integrity checks and direct text-protocol operations that don't go through the HTTP admin API.

go build -o veltrix-admin ./cmd/admin
SubcommandKey flagsPurpose
scan--addr, --user, --passwordPrints server INFO, then attempts a SCAN over the text protocol (not currently implemented server-side — falls back to a note pointing at stats or offline check).
stats--addr, --user, --passwordPrints the server's INFO response as a formatted key/value table.
compact--addr, --user, --passwordSends a COMPACT text command. Not currently wired server-side — the engine's GC runs automatically every 30s regardless; this subcommand is a documented no-op stub today.
check--data or --data-dirsOffline CRC32C corruption scan — walks each disk's vlog_active.dat directly, verifying every record's stored checksum. No running server required.
repair--addr, --key, --user, --passwordTombstones (deletes) a specific key on a running server.
hash-password--user, --passwordGenerates a SHA-256 password hash and a ready-to-paste JSON snippet for the RBAC --auth-config file.

Examples

veltrix-admin scan --addr :9000
veltrix-admin stats --addr :9000 --user admin --password secret
veltrix-admin check --data-dirs /mnt/nvme0,/mnt/nvme1
veltrix-admin repair --addr :9000 --key corrupt-key-001 --user admin --password secret
veltrix-admin hash-password --user alice --password secret
veltrix vs. veltrix-admin These are two distinct binaries. veltrix (cmd/veltrix) is the modern, richly-formatted operator CLI covered above and is the one referenced by the top-level README. veltrix-admin (cmd/admin) is an older, lower-level tool focused on offline VLog integrity checks and RBAC password hashing.

veltrix-migrate — bulk data movement

Exports keys to JSONL, imports JSONL into a cluster, or copies directly between two clusters, using only the binary protocol plus /admin/stats for progress reporting.

go build -o veltrix-migrate ./cmd/veltrix-migrate
ModeFlagsPurpose
export--src (required), --src-admin, --prefix, --progress-everyReads every key from a cluster and emits JSONL ({"k": "...", "v": "<base64>"}) to stdout.
import--dst (required), --progress-everyReads JSONL from stdin and PUTs each entry into the target cluster. Idempotent.
migrate--src, --dst (both required), --prefix, --progress-everyCombines export + import in one pass, copying directly from --src to --dst.
veltrix-migrate export --src 127.0.0.1:9000 --prefix orders/ > out.jsonl
veltrix-migrate import --dst replica:9000 < out.jsonl
veltrix-migrate migrate --src primary:9000 --dst replica:9000 --prefix orders/
Key enumeration is a known gap Per an explicit PRODUCTION GAP comment in the source, there is no /admin/scan-keys endpoint yet, so listKeys() cannot actually enumerate keys from /admin/stats alone — it returns an empty list on stock builds. export and migrate are effectively non-functional for full-keyspace enumeration until that endpoint lands; import (reading pre-staged JSONL from stdin) works today.

veltrix-chaos — chaos-engineering harness

Inflicts controlled failures on running processes or Kubernetes pods to verify resilience claims: process kills, pause/resume (simulating GC pauses), network loss/delay, clock skew, and randomized soak testing.

go build -o veltrix-chaos ./cmd/veltrix-chaos
CommandUsagePurpose
killkill TARGETSIGKILL the target (process or pod).
pausepause TARGET DURATIONSIGSTOP the target, sleep for DURATION (e.g. 5s), then SIGCONT. Local targets only.
networknetwork drop|delay TARGET PCT_OR_MSInjects packet loss or delay via tc/iptables. Kubernetes targets only.
slow-diskslow-disk TARGET DURATIONIntended to inject artificial fdatasync delay via charybdefs. Currently a placeholder — warns if charybdefs isn't on PATH and performs no real fault injection.
clock-skewclock-skew TARGET ±SECONDSAdjusts the system clock on a Kubernetes pod by the given signed seconds (requires SYS_TIME).
soaksoak TARGET DURATIONApplies randomized faults (currently just pause) at random intervals across the given duration window.

Target descriptor syntax: pid:NUMBER (local process by PID), process:NAME (local process by exec name, first match via pgrep -f), or k8s:NAMESPACE/POD (Kubernetes pod, operated on via kubectl).

veltrix-chaos kill process:veltrixdb
veltrix-chaos pause pid:4821 5s
veltrix-chaos network drop k8s:veltrixdb/veltrixdb-0 10
veltrix-chaos clock-skew k8s:veltrixdb/veltrixdb-1 +30
veltrix-chaos soak k8s:veltrixdb/veltrixdb-0 10m

All faults assume root or CAP_SYS_ADMIN on the target host. Compared to Jepsen, the source notes this trades formal rigor for zero JVM/Clojure dependency and trivial embedding in Go test suites via Inflict(...).

loadtest — concurrent load generator

A read/write load tester supporting single-op and batched (MPut/MGet) modes, with live throughput reporting and P50–P99.9 latency percentiles.

go run ./cmd/loadtest [flags]
FlagDefaultDescription
--addr127.0.0.1:9000VeltrixDB TCP address.
--modemixedWorkload mode: write | read | mixed.
--concurrency50Number of parallel worker goroutines.
--duration30Test duration in seconds.
--warmup5Warmup seconds before recording stats (write-only warmup phase).
--num-keys1000000Keyspace size (key:0key:N-1).
--value-size64Value payload size in bytes.
--read-ratio0.7Fraction of reads in mixed mode.
--dial-timeout5TCP dial timeout in seconds.
--report-every1Live stats interval in seconds.
--safe-readsfalseOnly read keys that have already been written (eliminates not-found errors during mixed ingestion).
--key-offset0Start key index offset, for continuing a previous run without overlap.
--batch-size1Entries per MPut/MGet batch. Values >1 switch to the batched code path, engaging server-side block packing (up to ~25× disk density gain for tiny values). Latency is reported per-batch; per-key amortized = batch-P99 / batch-size.
--log-errors5Log the first N distinct errors per worker to stderr. 0 = silent.

Examples

# 30-second mixed 70% reads / 30% writes, 64 workers, 1M keyspace
go run ./cmd/loadtest --mode=mixed --read-ratio=0.7 --concurrency=64 --duration=30

# Write-only warmup then read-only benchmark
go run ./cmd/loadtest --mode=write --duration=10
go run ./cmd/loadtest --mode=read  --duration=30

# Batched writes via MPut-1024 (engages block packing)
go run ./cmd/loadtest --mode=write --batch-size=1024 \
                      --concurrency=8 --duration=30 --value-size=128

# Batched reads via MGet-256
go run ./cmd/loadtest --mode=read --batch-size=256 \
                      --concurrency=64 --duration=30

kubectl-veltrix — kubectl plugin

A dependency-free kubectl plugin that resolves a VeltrixDB pod by label selector, opens a kubectl port-forward to its admin port, and hits the HTTP admin API on localhost. No client-go or cobra dependency — it shells out to kubectl directly so auth and kubeconfig behavior always match the operator's normal workflow.

go build -o kubectl-veltrix ./cmd/kubectl-veltrix
# install: place the binary on PATH; kubectl auto-discovers it by the
# kubectl-PLUGIN naming convention.

Flags

FlagDefaultDescription
--namespace, -nveltrixdbKubernetes namespace.
--label-selector, -lapp.kubernetes.io/name=veltrixdbPod selector.
--admin-port2112Admin HTTP port on the pod.
--prefix(empty)Key prefix filter for cdc-tail.

Commands

CommandBacking endpointPurpose
statsGET /admin/statsPrint engine stats from the first matching pod.
gc-statusGET /metrics (filtered)Print VLog GC + scrubber metric lines.
checkpointPOST /admin/checkpointForce a WAL checkpoint.
migratePOST /admin/migrateRun schema migrations.
quotasGET /admin/quotasList per-namespace quotas.
quota-set NS WPS MAXPOST /admin/quotasSet writes_per_sec=WPS, max_keys=MAX for namespace NS.
cdc-tail [--prefix=]GET /admin/cdcStream CDC events to stdout until interrupted.
versionGET /admin/versionPrint engine + schema version.
kubectl veltrix stats
kubectl veltrix gc-status
kubectl veltrix quota-set tenant_42 5000 1000000
kubectl veltrix cdc tail --prefix orders/
kubectl veltrix -n veltrixdb-prod -l app.kubernetes.io/name=veltrixdb stats
backup subcommand not implemented The plugin's usage banner lists kubectl veltrix backup s3://... as a one-shot backup command, but it is marked TODO in source and not wired into the command switch — only stats, gc-status, checkpoint, migrate, quotas, quota-set, cdc-tail, and version are functional today.

repl-ship — cross-region replication shipper

Tails a local server's /admin/cdc stream and forwards each event to a remote VeltrixDB cluster's binary protocol — PUT events become a remote MultiPut, DEL events become a remote delete. Designed for asynchronous, eventually-consistent geo-replication, with exponential-backoff retries and a deadletter file for permanent failures.

go build -o repl-ship ./cmd/repl-ship

repl-ship --src http://primary:2112 \
          --src-token "$VELTRIX_ADMIN_TOKEN" \
          --dst-tcp replica.us-east:9000 \
          --batch 64 \
          --checkpoint /var/lib/repl-ship/ckpt
Asynchronous by design With --checkpoint (v1.1.0), a restarted shipper replays exactly the delta it missed via the durable /admin/changes feed — shipper downtime no longer loses events. The remaining limits: replication is async (writes committed at the source but not yet shipped are lost if the source region dies), conflict resolution is last-write-wins only, and there is no back-pressure signal to the source when the destination is degraded.

admin (cmd/admin)

This is the same binary documented above as veltrix-admin — its source lives at cmd/admin/main.go and it is conventionally built with the output name veltrix-admin. See that section for its full subcommand table.

Tool index

BinarySource directoryOne-line purpose
veltrixcmd/veltrixPrimary operator CLI — status, compaction, nodes, top, put/get/del, backup.
veltrixdb-backupcmd/backupFull/incremental backup, restore, PITR, and cloud upload/download.
veltrix-admincmd/adminOffline VLog integrity checks and low-level text-protocol admin.
veltrix-migratecmd/veltrix-migrateBulk export/import/migrate of keys between clusters via JSONL.
veltrix-chaoscmd/veltrix-chaosChaos-engineering fault injection (kill, pause, network, clock-skew, soak).
loadtestcmd/loadtestConcurrent read/write load generator with latency percentiles.
kubectl-veltrixcmd/kubectl-veltrixkubectl plugin wrapping the admin HTTP API via port-forward.
repl-shipcmd/repl-shipCross-region CDC-based replication shipper.