CLI Quick Start
The taidb command is useful for quick experiments, automation, smoke tests,
and languages that do not yet have an official binding.
Install
Section titled “Install”cargo install taidbCheck the command:
taidb --helpPut and get values
Section titled “Put and get values”taidb put ./app.taidb user:1 Alicetaidb get ./app.taidb user:1Expected output:
AliceStore and search vectors
Section titled “Store and search vectors”taidb vector-put ./app.taidb doc:1 "0.1,0.9,0.2"taidb vector-put ./app.taidb doc:2 "0.9,0.1,0.1"taidb vector-search ./app.taidb "0.0,1.0,0.2" --limit 1Output is tab-separated:
doc:1 0.993944Use compression
Section titled “Use compression”Compression is configured per command invocation. Use the same compression settings for writes, compaction, and repack operations when you want consistent storage behavior.
taidb --compression zstd-fast put ./compressed.taidb doc:1 "large text..."taidb --compression zstd-fast stats ./compressed.taidbDense compression is slower but can reduce size for archival workloads:
taidb --compression zstd-dense repack ./compressed.taidbUse encryption
Section titled “Use encryption”Generate a key file:
taidb keygen ./taidb.keyWrite encrypted data:
taidb --key-file ./taidb.key put ./secure.taidb secret:1 "private value"Read encrypted data:
taidb --key-file ./taidb.key get ./secure.taidb secret:1Keep key files out of Git and out of backups that should not decrypt the database.
Inspect and verify
Section titled “Inspect and verify”taidb stats ./app.taidbtaidb stats ./app.taidb --jsontaidb verify ./app.taidbCompact
Section titled “Compact”Append-only writes leave stale records behind after updates and deletes. Compact rewrites live records into a smaller file.
taidb compact ./app.taidbUse repack when you want to rewrite live records with the current compression
settings.
taidb --compression zstd-dense repack ./app.taidbSnapshot
Section titled “Snapshot”Create a copy:
taidb snapshot ./app.taidb ./backup.taidbCreate a read-only snapshot:
taidb snapshot ./app.taidb ./backup.taidb --read-only