Migration Guide: Old CLI → Unified CLI
On this page
- What Changed?
- Command Mapping
- Core Commands
- Tenant Management
- Cluster Management
- Migration Workflow
- Simulation Testing
- Configuration
- Studio UI
- Shell Completions
- Breaking Changes
- 1. REPL Requires --tenant Flag
- 2. Crate Names Changed
- 3. Studio Port Flag
- 4. Dev Server Replaces Multiple Terminals
- New Features
- 1. Unified Dev Command (kmb dev)
- 2. Tenant Safety
- 3. Migration Management
- 4. Local Cluster Testing
- 5. Config Management
- 6. Integrated Simulation Testing
- Migration Steps
- Step 1: Update Dependencies
- Step 2: Update Scripts
- Step 3: Create Config File
- Step 4: Migrate Environment Variables
- Step 5: Update Aliases
- Step 6: Install Shell Completions
- Compatibility
- Backward Compatibility
- Forward Compatibility
- Troubleshooting
- “Command not found: kmb”
- “Tenant is required”
- “Migration checksum mismatch”
- “Port already in use”
- FAQ
- Q: Can I use both old and new CLI?
- Q: Will the old CLI be maintained?
- Q: Do I need to migrate my data?
- Q: What about the standalone vopr binary?
- Q: Can I still use environment variables?
- Q: How do I migrate CI/CD pipelines?
- Getting Help
- Summary
- Next Steps
This guide helps you migrate from the old Kimberlite CLI structure to the new unified kmb command.
What Changed?
The new unified CLI consolidates all Kimberlite tools into a single kmb command with hierarchical subcommands. This provides:
- Single entry point: One command instead of many binaries
- Consistent UX: Unified flag conventions and output styling
- Better discovery:
kmb helpshows all available commands - Shell completions: Tab completion for all commands
Command Mapping
Core Commands
| Old CLI | New CLI | Notes |
|---|---|---|
kimberlite init | kmb init | Compatible |
kimberlite start <path> | kmb start <path> | Compatible |
| N/A | kmb dev | 🆕 New: All-in-one dev server |
kimberlite-repl | kmb repl --tenant <ID> | Requires --tenant flag |
| N/A | kmb query "SQL" --tenant <ID> | 🆕 New: One-shot queries |
Tenant Management
| Old CLI | New CLI | Notes |
|---|---|---|
| N/A | kmb tenant create --id <ID> --name <NAME> | 🆕 New |
| N/A | kmb tenant list | 🆕 New |
| N/A | kmb tenant delete --id <ID> | 🆕 New |
| N/A | kmb tenant info --id <ID> | 🆕 New |
Cluster Management
| Old CLI | New CLI | Notes |
|---|---|---|
| N/A | kmb cluster init --nodes <N> | 🆕 New |
| N/A | kmb cluster start | 🆕 New |
| N/A | kmb cluster stop | 🆕 New |
| N/A | kmb cluster status | 🆕 New |
Migration Workflow
| Old CLI | New CLI | Notes |
|---|---|---|
| N/A | kmb migration create <name> | 🆕 New |
| N/A | kmb migration apply | 🆕 New |
| N/A | kmb migration rollback | 🆕 New |
| N/A | kmb migration status | 🆕 New |
Simulation Testing
| Old CLI | New CLI | Notes |
|---|---|---|
vopr --seed <SEED> | kmb sim verify --seed <SEED> | Integration |
vopr -n <N> | kmb sim run --iterations <N> | Integration |
| N/A | kmb sim report --output <FILE> | 🆕 New |
vopr <advanced-flags> | vopr <advanced-flags> | Standalone binary still available |
Configuration
| Old CLI | New CLI | Notes |
|---|---|---|
| Manual TOML editing | kmb config show | 🆕 New: View config |
| Manual TOML editing | kmb config set <key> <value> | 🆕 New: Update config |
| N/A | kmb config validate | 🆕 New: Validate config |
Studio UI
| Old CLI | New CLI | Notes |
|---|---|---|
| N/A | kmb studio | 🆕 New: Standalone Studio |
| N/A | kmb dev | 🆕 New: Auto-launch with dev server |
Shell Completions
| Old CLI | New CLI | Notes |
|---|---|---|
| N/A | kmb completion bash | 🆕 New |
| N/A | kmb completion zsh | 🆕 New |
| N/A | kmb completion fish | 🆕 New |
Breaking Changes
1. REPL Requires --tenant Flag
Old:
New:
Rationale: Prevents accidental cross-tenant data access (compliance-first design).
Workaround: Add alias to your shell config:
2. Crate Names Changed
Old: kmb-* (e.g., kmb-sim, kmb-client)
New: kimberlite-* (e.g., kimberlite-sim, kimberlite-client)
Impact: If you depend on Kimberlite crates in your Cargo.toml, update package names:
# Old
[dependencies]
kmb-client = { path = "../kmb-client" }
# New
[dependencies]
kimberlite-client = { path = "../kimberlite-client" }
CLI binary name unchanged: kmb command still works.
3. Studio Port Flag
Old: kmb studio -p 8080 (if it existed)
New: kmb studio --port 8080
Impact: Short flag -p removed to avoid conflict with --project flag.
4. Dev Server Replaces Multiple Terminals
Old workflow:
# Terminal 1
# Terminal 2
# Terminal 3
New workflow:
# Single terminal
# Opens browser to Studio automatically
# Connect with: kmb repl --tenant 1 (in new terminal)
New Features
1. Unified Dev Command (kmb dev)
The star feature of the new CLI:
This single command:
- Starts database server
- Launches Studio UI
- Applies pending migrations
- Sets up auto-reload (future)
- Provides aggregated logging
Benefits:
- No more juggling multiple terminals
- Zero-config development
- Integrated migration workflow
2. Tenant Safety
All commands require explicit --tenant flag:
# ERROR: No tenant specified
# CORRECT: Explicit tenant
Benefits:
- Prevents accidental cross-tenant queries
- Clear audit trail (tenant always logged)
- HIPAA/GDPR compliance
3. Migration Management
File-based SQL migrations:
# Create migration
# Edit migrations/0001_add_users_table.sql
# CREATE TABLE users (...);
# Apply
# Check status
Benefits:
- Version-controlled schema changes
- Checksum validation (tamper detection)
- Rollback support
4. Local Cluster Testing
Test multi-node scenarios without complex setup:
Benefits:
- Test failover locally
- Verify replication
- No Docker/Kubernetes required
5. Config Management
Structured configuration with validation:
# View current config
# Update setting
# Validate config files
Benefits:
- No manual TOML editing
- Validation on write
- Environment-specific overrides
6. Integrated Simulation Testing
VOPR simulations now accessible via CLI:
Benefits:
- Discover bugs before production
- Reproduce failures exactly
- Automated failure diagnosis
Migration Steps
Step 1: Update Dependencies
If you’re using Kimberlite crates:
# Update Cargo.toml
[dependencies]
kimberlite = "0.2" # or latest version
kimberlite-client = "0.2"
kimberlite-types = "0.2"
Step 2: Update Scripts
Update any scripts or CI/CD pipelines:
# Old
# New
Step 3: Create Config File
Initialize config in existing projects:
Step 4: Migrate Environment Variables
Old environment variables still work:
# These still work
New config file approach (recommended):
# kimberlite.toml
[database]
data_dir = "/var/lib/kimberlite"
bind_address = "0.0.0.0:5432"
Step 5: Update Aliases
Add helpful aliases to your shell config:
# ~/.bashrc or ~/.zshrc
Step 6: Install Shell Completions
# Bash
# Zsh
# Fish
Compatibility
Backward Compatibility
- Config files: Old
kimberlite.tomlformat still works - Environment variables:
KMB_*variables still work - Data format: Existing data files compatible
- VOPR binary: Standalone
voprstill available
Forward Compatibility
New features are opt-in:
- Migrations: Only used if
migrations/directory exists - Cluster: Only used if explicitly initialized
- Studio: Can be disabled with
--no-studio
Troubleshooting
“Command not found: kmb”
Problem: Old CLI binaries still in PATH
Solution: Rebuild and ensure new binary is in PATH:
“Tenant is required”
Problem: Old scripts don’t specify --tenant
Solution: Add --tenant flag to all commands:
# Old
# New
“Migration checksum mismatch”
Problem: Migration files were edited after being applied
Solution: Don’t edit applied migrations. Create a new one:
“Port already in use”
Problem: Old server still running
Solution: Stop old server or use different port:
# Stop old server
# Or use custom port
FAQ
Q: Can I use both old and new CLI?
A: Yes, but not recommended. The new CLI is the supported version. Migrate as soon as possible.
Q: Will the old CLI be maintained?
A: No. All future development is on the unified CLI. The old CLI is deprecated.
Q: Do I need to migrate my data?
A: No. The data format is unchanged. Just update the CLI.
Q: What about the standalone vopr binary?
A: It’s still available for advanced use cases. Use kmb sim for common scenarios.
Q: Can I still use environment variables?
A: Yes. Environment variables have highest precedence over config files.
Q: How do I migrate CI/CD pipelines?
A: Update scripts to use new commands. Example:
# Old
- run: kimberlite start /data &
- run: kimberlite-repl < test.sql
# New
- run: kmb start /data &
- run: kmb query "$(cat test.sql)" --tenant 1
Getting Help
If you encounter issues during migration:
- Check this guide: Most common scenarios are covered
- CLI help: Run
kmb help <command>for detailed info - GitHub Issues: https://github.com/kimberlite/kimberlite/issues
- Discussions: Ask in GitHub Discussions
Summary
The unified CLI provides:
- Better developer experience
- Consistent command structure
- New features (dev server, migrations, cluster)
- Improved safety (tenant requirements)
- Backward compatibility (data, config)
Recommended migration timeline: Within 1-2 weeks
Deprecation timeline: Old CLI will be removed in version 0.3
Next Steps
- Getting Started: Learn the new CLI
- Shell Completions: Set up tab completion
- Configuration Guide: Understanding config files
Happy migrating! 🚀