Skip to content

CLI Quick Start

The taidb command is useful for quick experiments, automation, smoke tests, and languages that do not yet have an official binding.

Terminal window
cargo install taidb

Check the command:

Terminal window
taidb --help
Terminal window
taidb put ./app.taidb user:1 Alice
taidb get ./app.taidb user:1

Expected output:

Alice
Terminal window
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 1

Output is tab-separated:

doc:1 0.993944

Compression is configured per command invocation. Use the same compression settings for writes, compaction, and repack operations when you want consistent storage behavior.

Terminal window
taidb --compression zstd-fast put ./compressed.taidb doc:1 "large text..."
taidb --compression zstd-fast stats ./compressed.taidb

Dense compression is slower but can reduce size for archival workloads:

Terminal window
taidb --compression zstd-dense repack ./compressed.taidb

Generate a key file:

Terminal window
taidb keygen ./taidb.key

Write encrypted data:

Terminal window
taidb --key-file ./taidb.key put ./secure.taidb secret:1 "private value"

Read encrypted data:

Terminal window
taidb --key-file ./taidb.key get ./secure.taidb secret:1

Keep key files out of Git and out of backups that should not decrypt the database.

Terminal window
taidb stats ./app.taidb
taidb stats ./app.taidb --json
taidb verify ./app.taidb

Append-only writes leave stale records behind after updates and deletes. Compact rewrites live records into a smaller file.

Terminal window
taidb compact ./app.taidb

Use repack when you want to rewrite live records with the current compression settings.

Terminal window
taidb --compression zstd-dense repack ./app.taidb

Create a copy:

Terminal window
taidb snapshot ./app.taidb ./backup.taidb

Create a read-only snapshot:

Terminal window
taidb snapshot ./app.taidb ./backup.taidb --read-only