Skip to Content
Overview

Kalam CLI

The Kalam CLI (kalam) is the SQL-first terminal client for KalamDB. It ships as a native Rust binary and as the npm package @kalamdb/cli.

Use it for:

  • project workflowskalam init, kalam dev, migrations, and schema codegen
  • one-shot SQL and interactive shells
  • named instance profiles (dev, staging, prod)
  • live query subscriptions and topic consumers
  • remote schema watch (--watch-schema) when DDL changes on the server
  • cluster and storage meta-commands

Project workflow

  1. Setup & Install
  2. Project Init
  3. Local Development
  4. Migrations
  5. Schema Watch

SQL client

  1. Authentication
  2. Querying & SQL
  3. Live Subscriptions
  4. Topic Consumers
  5. Interactive Commands
  6. SQL Workflows
  7. Options & Timeouts

Execution modes

When you run kalam without a subcommand, these modes apply (in precedence order):

  1. --watch-schema — poll system.tables and run a local command (requires --run)
  2. --subscribe / --list-subscriptions — subscription management
  3. --consume --topic ... — topic consumer mode
  4. SQL execution:
    • --file <path> — execute file and exit
    • --command <sql> — execute one statement and exit
    • no flags — interactive shell

Project commands (init, dev, migration, db, schema, status, deploy) are always top-level subcommands.

Quick command map

BASH
# Project workflowkalam initkalam init --yes --name my-app --languages typescript --package-manager pnpmkalam devkalam migration statuskalam migration seal && kalam db migratekalam schema genkalam status # Interactive SQL shellkalam # One-shot SQLkalam -c "SELECT * FROM system.tables LIMIT 5;" # Live subscriptionkalam --subscribe "SELECT * FROM app.messages" # Topic consumerkalam --consume --topic blog.summarizer --group summarizer-agent --from latest # Remote schema watch (server-side DDL)kalam --watch-schema --namespace app --run "npm run schema:gen" --run-on-start # Login and doctorkalam login --instance prod --url https://db.example.com --user admin --passwordkalam doctor -v
Last updated on