CLI Reference
On this page
- Installation
- Global Options
- Commands
- kimberlite version
- kimberlite init
- kimberlite dev
- kimberlite start
- kimberlite repl
- kimberlite query
- Tenant Management
- kimberlite tenant create
- kimberlite tenant list
- kimberlite tenant delete
- kimberlite tenant info
- Cluster Management
- kimberlite cluster init
- kimberlite cluster start
- kimberlite cluster stop
- kimberlite cluster status
- kimberlite cluster destroy
- Migration Management
- kimberlite migration create
- kimberlite migration apply
- kimberlite migration rollback
- kimberlite migration status
- kimberlite migration validate
- Stream Management
- kimberlite stream create
- kimberlite stream list
- kimberlite stream append
- kimberlite stream read
- Backup & Restore
- kimberlite backup create
- kimberlite backup restore
- kimberlite backup list
- kimberlite backup verify
- Configuration
- kimberlite config show
- kimberlite config set
- kimberlite config validate
- Utilities
- kimberlite info
- kimberlite completion
- Exit Codes
- Environment Variables
- Examples
- Common Workflows
- Next Steps
Complete reference for the Kimberlite command-line interface (kimberlite).
Installation
See Start for installation instructions.
Global Options
These options work with all commands:
Environment variables:
NO_COLOR=1 # Disable colored output (respects standard)
Commands
kimberlite version
Show version information.
Output shows a version table with Rust version, target architecture, and OS.
kimberlite init
Initialize a new Kimberlite project with scaffolding.
Interactive Mode:
Running kimberlite init without arguments launches an interactive wizard that
guides you through project setup:
- Welcome — shows the Kimberlite version
- Path prompt — where to create your project (default:
./my-app) - Template selection — choose from Default, Healthcare, Finance, Legal, or Multi-tenant
- Scaffolding — creates directories, config,
.gitignore, and README - Summary — shows what was created and next steps
Arguments:
PATH- Project directory path. If omitted, the wizard prompts for it
Options:
--yes- Run in non-interactive mode (skip wizard, use defaults). Auto-enabled in CI/piped environments--template <NAME>- Use a project template (skips template prompt in wizard)
Templates:
healthcare- HIPAA-compliant healthcare applicationfinance- SOX/PCI-DSS financial applicationlegal- Legal industry templatemulti-tenant- Multi-tenant SaaS template
Example:
# Interactive wizard (recommended)
# Create new project with healthcare template
# Non-interactive init (CI-friendly)
Creates:
project/
├── kimberlite.toml # Configuration
├── migrations/ # Database migrations
│ └── 001_init.sql
├── .gitignore
└── README.md
kimberlite dev
Start development server with database, Studio UI, and auto-migration.
Options:
-p, --project <DIR>- Project directory (default:.)--no-migrate- Skip automatic migrations--no-studio- Skip Studio web UI--cluster- Start in cluster mode (3 nodes)--port <PORT>- Custom database port--studio-port <PORT>- Custom Studio port
Example:
# Start dev server (DB on 5432, Studio on default port)
# Custom ports
# Database only (no Studio)
# Cluster mode for testing replication
What it does:
- Applies pending migrations
- Starts database server
- Launches Studio web UI (unless
--no-studio) - Watches for migration changes (unless
--no-migrate)
Press Ctrl+C to stop all services.
kimberlite start
Start the Kimberlite server in production mode.
Arguments:
PATH- Path to data directory
Options:
-a, --address <ADDR>- Bind address (default:5432)--development- Development mode (no replication)
Address formats:
- Port only:
5432(binds to127.0.0.1:5432) - Full address:
0.0.0.0:5432(binds to all interfaces) - IPv6:
[::1]:5432
Example:
# Start on default port
# Bind to all interfaces on port 8000
# Development mode (single node, no replication)
Production checklist:
- Use absolute path for data directory
- Run as dedicated user (not root)
- Use systemd or equivalent for process management
- Configure firewall rules
- Enable TLS (see Security)
kimberlite repl
Interactive SQL REPL for running queries.
Options:
-a, --address <ADDR>- Server address (default:127.0.0.1:5432)-t, --tenant <ID>- Tenant ID (required)
Example:
# Connect to local server as tenant 1
REPL commands:
-- Execute SQL
SELECT * FROM patients;
-- Multi-line queries
(
id INT PRIMARY KEY,
email TEXT NOT NULL
);
-- REPL-specific commands
.help -- Show help message
.tables -- List all tables
.exit -- Exit the REPL (also .quit or .q)
Keyboard shortcuts:
Ctrl+D- Exit REPLCtrl+R- Search command historyUp/Down- Browse command historyTab- SQL keyword and table name completion
kimberlite query
Execute a single SQL query.
Arguments:
SQL- SQL query string
Options:
-s, --server <ADDR>- Server address (default:127.0.0.1:5432)-t, --tenant <ID>- Tenant ID (required)-a, --at <OFFSET>- Query at specific offset (time-travel)
Example:
# Simple query
# Parameterized query (use $1, $2, etc.)
# Time-travel query
# Remote server
Output: Results are displayed as a table.
Tenant Management
kimberlite tenant create
Create a new tenant.
Options:
-i, --id <ID>- Tenant ID (numeric)-n, --name <NAME>- Tenant name-s, --server <ADDR>- Server address (default:127.0.0.1:5432)--force- Skip confirmation prompt
Example:
# Create tenant
# Production (requires confirmation)
kimberlite tenant list
List all tenants.
Options:
-s, --server <ADDR>- Server address (default:127.0.0.1:5432)
Example:
Output:
ID Name Created
1 Acme Corp 2026-01-15 10:00:00
2 Beta Inc 2026-01-20 14:30:00
kimberlite tenant delete
Delete a tenant and all its data.
Options:
-i, --id <ID>- Tenant ID-s, --server <ADDR>- Server address (default:127.0.0.1:5432)--force- Skip confirmation prompt
Example:
# Delete tenant (prompts for confirmation)
# Force delete without confirmation
Warning: This permanently deletes all data for the tenant. Use with caution.
kimberlite tenant info
Show tenant information.
Options:
-i, --id <ID>- Tenant ID-s, --server <ADDR>- Server address (default:127.0.0.1:5432)
Example:
Output:
Tenant: Acme Corp (ID: 1)
Created: 2026-01-15 10:00:00
Tables: 12
Total size: 1.2 GB
Last activity: 2026-02-11 09:45:00
Cluster Management
kimberlite cluster init
Initialize a new cluster configuration.
Options:
-n, --nodes <COUNT>- Number of nodes (default: 3)-p, --project <DIR>- Project directory (default:.)
Example:
# Create 3-node cluster config
# Create 5-node cluster
Creates:
.kimberlite/
├── cluster.toml
├── node-0/
├── node-1/
└── node-2/
kimberlite cluster start
Start all cluster nodes.
Options:
-p, --project <DIR>- Project directory (default:.)
Example:
Output:
Starting cluster...
✓ Node 0 started on port 5432
✓ Node 1 started on port 5433
✓ Node 2 started on port 5434
Cluster ready (leader: node 0)
kimberlite cluster stop
Stop cluster node(s).
Options:
--node <ID>- Node ID to stop (if not specified, stops all)-p, --project <DIR>- Project directory (default:.)
Example:
# Stop all nodes
# Stop specific node
kimberlite cluster status
Show cluster status.
Options:
-p, --project <DIR>- Project directory (default:.)
Example:
Output:
Cluster Status
--------------
Leader: node-0
View: 5
Node Status Address Role Last Heartbeat
0 Healthy 127.0.0.1:5432 Leader 0.1s ago
1 Healthy 127.0.0.1:5433 Follower 0.2s ago
2 Healthy 127.0.0.1:5434 Follower 0.1s ago
kimberlite cluster destroy
Destroy cluster configuration and data.
Options:
-p, --project <DIR>- Project directory (default:.)--force- Skip confirmation prompt
Example:
# Destroy cluster (prompts for confirmation)
# Force destroy
Warning: This deletes all cluster data. Cannot be undone.
Migration Management
kimberlite migration create
Create a new migration file.
Arguments:
NAME- Migration name (use snake_case)
Options:
-p, --project <DIR>- Project directory (default:.)
Example:
Creates:
migrations/
└── 20260211_094500_add_users_table.sql
Migration template:
-- Migration: add_users_table
-- Created: 2026-02-11 09:45:00
-- Up migration
(
id INT PRIMARY KEY,
email TEXT NOT NULL
);
-- Down migration (for rollback)
-- DROP TABLE users;
kimberlite migration apply
Apply pending migrations.
Options:
--to <NUMBER>- Apply up to specific migration-p, --project <DIR>- Project directory (default:.)
Example:
# Apply all pending migrations
# Apply up to migration 5
Output:
Applying migrations...
✓ 001_init.sql
✓ 002_add_users.sql
✓ 003_add_patients.sql
Applied 3 migrations in 1.2s
kimberlite migration rollback
Rollback migrations.
Arguments:
COUNT- Number of migrations to rollback (default: 1)
Options:
-p, --project <DIR>- Project directory (default:.)
Example:
# Rollback last migration
# Rollback last 3 migrations
Output:
Rolling back migrations...
✓ Rolled back 003_add_patients.sql
Rolled back 1 migration
kimberlite migration status
Show migration status.
Options:
-p, --project <DIR>- Project directory (default:.)
Example:
Output:
Migration Status
----------------
Applied:
✓ 001_init.sql (2026-02-10 10:00:00)
✓ 002_add_users.sql (2026-02-10 11:00:00)
Pending:
003_add_patients.sql
004_add_rbac.sql
2 applied, 2 pending
kimberlite migration validate
Validate migration files.
Options:
-p, --project <DIR>- Project directory (default:.)
Example:
Output:
Validating migrations...
✓ All migration files are valid
✓ No duplicate migration numbers
✓ All migrations have down migrations
Stream Management
kimberlite stream create
Create a new event stream.
Arguments:
NAME- Stream name
Options:
-c, --class <CLASS>- Data classification (default:non-phi)-s, --server <ADDR>- Server address (default:127.0.0.1:5432)-t, --tenant <ID>- Tenant ID (required)
Classifications:
non-phi- Non-sensitive dataphi- Protected Health Information (HIPAA)deidentified- De-identified data
Example:
# Create stream for PHI data
# Create stream for logs
kimberlite stream list
List all streams.
Options:
-s, --server <ADDR>- Server address (default:127.0.0.1:5432)-t, --tenant <ID>- Tenant ID (required)
Example:
Output:
ID Name Classification Events Size
1 patient_events PHI 1,234 1.2MB
2 audit_logs NON-PHI 5,678 3.4MB
kimberlite stream append
Append events to a stream.
Arguments:
STREAM_ID- Stream IDEVENTS- One or more event JSON strings
Options:
-s, --server <ADDR>- Server address (default:127.0.0.1:5432)-t, --tenant <ID>- Tenant ID (required)
Example:
# Append single event
# Append multiple events
kimberlite stream read
Read events from a stream.
Arguments:
STREAM_ID- Stream ID
Options:
-f, --from <OFFSET>- Starting offset (default: 0)-m, --max-bytes <BYTES>- Maximum bytes to read (default: 65536)-s, --server <ADDR>- Server address (default:127.0.0.1:5432)-t, --tenant <ID>- Tenant ID (required)
Example:
# Read from beginning
# Read from offset 100
# Read with size limit
Output:
Offset: 0
Data: {"type":"admission","patient_id":"P123"}
Offset: 1
Data: {"type":"diagnosis","patient_id":"P123","code":"I10"}
Read 2 events (1.2 KB)
Backup & Restore
kimberlite backup create
Create a full backup of the data directory.
Options:
-d, --data-dir <DIR>- Data directory to back up (required)-o, --output <DIR>- Backup output directory (default:./backups)
Example:
# Create backup
# Custom output directory
Output:
Creating backup...
✓ Copied 1,234 files (5.6 GB)
✓ Verified checksums
Backup created: ./backups/kimberlite-backup-20260211-094500
kimberlite backup restore
Restore a backup to a target directory.
Arguments:
BACKUP- Path to backup directory
Options:
-t, --target <DIR>- Target directory (required)--force- Overwrite if target is not empty
Example:
# Restore backup
# Force overwrite
Warning: Use --force carefully. It will overwrite existing data.
kimberlite backup list
List available backups.
Arguments:
BACKUP_DIR- Directory containing backups (default:./backups)
Example:
Output:
Available Backups
-----------------
kimberlite-backup-20260211-094500 (5.6 GB) 2026-02-11 09:45:00
kimberlite-backup-20260210-103000 (5.4 GB) 2026-02-10 10:30:00
kimberlite-backup-20260209-150000 (5.2 GB) 2026-02-09 15:00:00
kimberlite backup verify
Verify backup integrity.
Arguments:
BACKUP- Path to backup directory
Example:
Output:
Verifying backup...
✓ All checksums valid
✓ All files present
✓ Backup is intact
Configuration
kimberlite config show
Show current configuration.
Options:
-p, --project <DIR>- Project directory (default:.)-f, --format <FORMAT>- Output format:text,json,toml(default:text)
Example:
# Show as text
# Show as JSON
# Show as TOML
kimberlite config set
Set a configuration value.
Arguments:
KEY- Configuration key (e.g.,database.bind_address)VALUE- Configuration value
Options:
-p, --project <DIR>- Project directory (default:.)
Example:
# Set bind address
# Set replica count
# Set log level
kimberlite config validate
Validate configuration files.
Options:
-p, --project <DIR>- Project directory (default:.)
Example:
Output:
Validating configuration...
✓ kimberlite.toml is valid
✓ cluster.toml is valid
✓ All settings within valid ranges
Utilities
kimberlite info
Show server information.
Options:
-s, --server <ADDR>- Server address (default:127.0.0.1:5432)-t, --tenant <ID>- Tenant ID (required)
Example:
Output:
Server Information
------------------
Version: 0.4.0
Uptime: 3 days, 5 hours
Cluster: 3 nodes (healthy)
Database size: 10.2 GB
Active connections: 42
Current view: 157
kimberlite completion
Generate shell completions.
Arguments:
SHELL- Shell type:bash,elvish,fish,powershell,zsh
Example:
# Bash
# Zsh
# Fish
# PowerShell
Usage:
- Bash: Add to
~/.bashrc:source ~/.local/share/bash-completion/completions/kimberlite - Zsh: Add to
~/.zshrc:fpath=(~/.zfunc $fpath)thenautoload -Uz compinit && compinit - Fish: Completions auto-load from
~/.config/fish/completions/ - PowerShell: Add to profile:
. kimberlite.ps1
Exit Codes
The CLI uses standard exit codes:
0- Success1- General error2- Command line usage error3- Connection error4- Authentication error5- Permission denied6- Resource not found
Example:
Environment Variables
The CLI respects these environment variables:
NO_COLOR=1 # Disable colored output
KIMBERLITE_ADDRESS=:5432 # Default server address
KIMBERLITE_TENANT=1 # Default tenant ID
RUST_LOG=info # Logging level (error, warn, info, debug, trace)
Example:
# Set defaults
# Now --address and --tenant are optional
Examples
Common Workflows
Initialize and start a project:
# Initialize
# Start dev environment
Production deployment:
# Initialize cluster
# Start cluster
# Check status
Database operations:
# Create tenant
# Create migration
# Apply migrations
# Query data
Backup workflow:
# Create backup
# List backups
# Verify backup
# Restore if needed
Next Steps
- SQL Reference - SQL dialect and extensions
- SDK Overview - Client libraries
- Deployment Guide - Production deployment
- Security Guide - Hardening and best practices