Crates.io | slatedb-cli |
lib.rs | slatedb-cli |
version | 0.8.2 |
created_at | 2025-06-30 21:30:00.16494+00 |
updated_at | 2025-09-12 01:01:39.098806+00 |
description | A command-line interface for interacting with SlateDB databases. |
homepage | https://slatedb.io |
repository | https://github.com/slatedb/slatedb |
max_upload_size | |
id | 1732399 |
size | 110,252 |
A command-line interface for interacting with SlateDB databases.
cargo install --locked slatedb-cli
Clone the repository and build from source:
git clone https://github.com/slatedb/slatedb.git
cd slatedb
cargo build --release -p slatedb-cli
The binary will be available at target/release/slatedb
.
The SlateDB CLI provides various commands for interacting with SlateDB databases:
slatedb [OPTIONS] --path <PATH> <COMMAND>
-e, --env-file <ENV_FILE>
: A .env file to use to supply environment variables-p, --path <PATH>
: The path in the object store to the root directory, starting from within the object store bucket (specified when configuring the object store provider)-h, --help
: Print help information-V, --version
: Print version informationReads the latest manifest file and outputs a readable string representation:
slatedb --path <PATH> read-manifest [OPTIONS]
Options:
-i, --id <ID>
: Specify a specific manifest ID to read. If not specified, the latest manifest will be returned.Lists all available manifests:
slatedb --path <PATH> list-manifests [OPTIONS]
Options:
-s, --start <START>
: Optionally specify a start ID for the range of manifests to lookup-e, --end <END>
: Optionally specify an end ID for the range of manifests to lookupSlateDB supports creating, refreshing, deleting, and listing checkpoints:
slatedb --path <PATH> create-checkpoint [OPTIONS]
Options:
-l, --lifetime <LIFETIME>
: Optionally specify a lifetime for the created checkpoint in a human-friendly format (e.g., "7days 30min 10s"). Without this, the checkpoint has no expiry.-s, --source <SOURCE>
: Optionally specify the UUID of an existing checkpoint to use as the base for the newly created checkpoint. If not provided, the checkpoint will be taken against the latest manifest.slatedb --path <PATH> refresh-checkpoint --id <ID> [OPTIONS]
Options:
-i, --id <ID>
: The UUID of the checkpoint to refresh (required)-l, --lifetime <LIFETIME>
: Optionally specify a new lifetime for the checkpoint. Without this, the checkpoint is updated with no expiry.slatedb --path <PATH> delete-checkpoint --id <ID>
Options:
-i, --id <ID>
: The UUID of the checkpoint to delete (required)slatedb --path <PATH> list-checkpoints
SlateDB provides garbage collection functionality for various resources:
slatedb --path <PATH> run-garbage-collection --resource <RESOURCE> --min-age <MIN_AGE>
Options:
-r, --resource <RESOURCE>
: The type of resource to clean up. Possible values: manifest
, wal
, compacted
-m, --min-age <MIN_AGE>
: The minimum age of the resource before considering it for garbage collection (e.g., "24h", "7days")slatedb --path <PATH> schedule-garbage-collection [OPTIONS]
Options (at least one required):
--manifest <MANIFEST>
: Configuration for manifest garbage collection, in the format min_age=<duration>,period=<duration>
(e.g., min_age=7days,period=1day
)--wal <WAL>
: Configuration for WAL garbage collection, in the format min_age=<duration>,period=<duration>
--compacted <COMPACTED>
: Configuration for compacted SST garbage collection, in the format min_age=<duration>,period=<duration>
slatedb --path my-database read-manifest
slatedb --path my-database list-manifests
slatedb --path my-database create-checkpoint --lifetime "7days"
slatedb --path my-database run-garbage-collection --resource wal --min-age "24h"
slatedb --path my-database schedule-garbage-collection --manifest "min_age=7days,period=1day" --wal "min_age=24h,period=6h"
SlateDB CLI uses environment variables for object store configuration. You can either set these in your environment or provide them through an .env file using the --env-file
option.
Required environment variables will depend on your chosen object store provider. See the SlateDB documentation for more details.
Apache-2.0