Install
One command. No dependencies. Works on macOS, Linux, and Windows.
macOS / Linux
Shell
curl -sSL get.tenantsdb.com | sh
Windows (PowerShell)
PowerShell
irm get.tenantsdb.com/windows | iex
Verify
Shell
$ tdb version
tdb v1.0.55 (built 2026-02-27)
PlatformArchitectureSupported
macOSApple Silicon (M1–M4)
macOSIntel
Linuxx64
LinuxARM64
Windowsx64
The installer detects your platform automatically and downloads the correct binary. macOS/Linux installs to /usr/local/bin/tdb (may require sudo). Windows installs to %LOCALAPPDATA%\tenantsdb\tdb.exe and adds it to PATH. Restart your terminal after installing on Windows.
Global Flags
Available on every command.
FlagDescription
--jsonOutput as JSON
--quietMinimal output
--verboseDebug output
--output <file>Save output to file
tdb version Print CLI version
Shell
$ tdb version
tdb v1.0.1 (built 2026-01-02)
tdb update Update CLI to latest version
Shell
$ tdb update
✓ Updated v1.0.1 → v1.0.2
Checks for the latest version and self-updates the binary. If already up to date, shows current version. May require sudo tdb update depending on install location.
tdb regions List available regions
Shell
$ tdb regions
Public command, does not require authentication. Use region zone values when creating dedicated tenants or migrating.
tdb errors List API error codes
Shell
$ tdb errors
Public command, does not require authentication. Lists all error codes with their HTTP status mappings. Useful for building integrations.

Auth & Config
tdb signup Create new account
Usage
tdb signup --email <email> --password <password> [--project <name>]
FlagDefaultDescription
--emailrequired-Email address
--passwordrequired-Password (min 8 chars)
--projectoptionalMy ProjectProject name
Example
Shell
$ tdb signup --email [email protected] --password secret123 --project "Demo"

✓ Account created!
✓ API key saved to ~/.tenantsdb.json
Project ID: tdb_abc123
tdb login Login to existing account
Usage
tdb login --email <email> --password <password>
tdb config set Set configuration
Usage
tdb config set [--api-url <url>] [--api-key <key>]
tdb config show Show current configuration
Shell
$ tdb config show

KEY      VALUE
API URL  https://api.tenantsdb.com
API Key  tenantsdb_sk_a91de15...

Projects
tdb projects list List all projects
Usage
tdb projects list [--json]
Response
JSON
{
  "success": true,
  "http_status": 200,
  "code": "ok",
  "count": 2,
  "projects": [
    {
      "project_id": "tdb_2abf90d3",
      "name": "Healthcare SaaS",
      "api_key_count": 2,
      "created_at": "2026-01-17T20:12:06Z"
    },
    {
      "project_id": "tdb_43cd4942",
      "name": "E-commerce Platform",
      "api_key_count": 1,
      "created_at": "2026-01-17T20:12:24Z"
    }
  ]
}
tdb projects create Create project
Usage
tdb projects create --name <name>
tdb projects switch Switch active project
Usage
tdb projects switch <project_id or name>
Examples
Shell
$ tdb projects switch tdb_43cd4942
✓ Switched to project 'E-commerce Platform' (tdb_43cd4942)

$ tdb projects switch "E-commerce Platform"
✓ Switched to project 'E-commerce Platform' (tdb_43cd4942)
tdb projects delete Delete project
Usage
tdb projects delete <project_id>

API Keys
tdb apikeys list List API keys
Usage
tdb apikeys list [--json]
tdb apikeys create Generate new API key
Usage
tdb apikeys create [--name <name>]
tdb apikeys delete Delete API key
Usage
tdb apikeys delete <key_id>

Workspaces
tdb workspaces list List all workspaces
Usage
tdb workspaces list [--json]
tdb workspaces create Create workspace
Usage
tdb workspaces create --name <name> --database <type> --mode <mode>
FlagDefaultDescription
--namerequired-Workspace name
--databaserequired-PostgreSQL, MySQL, MongoDB, Redis
--moderequired-Workspace mode: tenant (multi-tenant with blueprints) or control (single database, no tenants)
Example
Shell
$ tdb workspaces create --name myapp --database PostgreSQL --mode tenant
✓ Workspace 'myapp' created

# Control mode (no tenants, direct database access)
$ tdb workspaces create --name controlplane --database PostgreSQL --mode control
✓ Workspace 'controlplane' created
JSON Response
JSON
{
  "success": true,
  "http_status": 201,
  "code": "created",
  "id": "myapp",
  "blueprint": "myapp",
  "database": "PostgreSQL",
  "connection_string": "postgresql://tdb_2abf90d3:[email protected]:5432/myapp_workspace?sslmode=require"
}
Connection strings always include TLS. The format varies by database type, see API Reference for MySQL, MongoDB, and Redis examples.
tdb workspaces get Get workspace details
Usage
tdb workspaces get <workspace_id> [--json]
tdb workspaces delete Delete workspace
Usage
tdb workspaces delete <workspace_id>
tdb workspaces query Run query in workspace
Usage
tdb workspaces query <workspace_id> --query <query>
Example
Shell
$ tdb workspaces query myapp --query "SELECT * FROM accounts"
tdb workspaces schema Import schema
Usage
tdb workspaces schema <workspace_id> [--template <name>] [--json <json>] [--database <conn>]
FlagDescription
--templateTemplate name (ecommerce, saas, blog, fintech)
--jsonJSON schema definition
--databaseDatabase connection JSON for import
Example
Shell
$ tdb workspaces schema myapp --template fintech
tdb workspaces settings Get workspace settings
Usage
tdb workspaces settings <workspace_id> [--json]
Example
Shell
$ tdb workspaces settings myapp --json
Returns database-specific settings. PostgreSQL/MySQL/MongoDB: query_timeout_ms, max_rows_per_query, max_connections. Redis: default_ttl, max_keys, patterns. Use the API to update settings: POST /workspaces/{id}/settings.
tdb workspaces diff Show pending DDL changes
Usage
tdb workspaces diff <workspace_id>
Related: tdb workspaces diff-skip <id> <ddl_id> and tdb workspaces diff-revert <id> <ddl_id>
tdb workspaces import-* Import from external database
Analyze source
Usage
tdb workspaces import-analyze <workspace_id> \
  --host <host> --database <db> --user <user> --password <pass> \
  [--port 5432] [--type postgresql] [--routing-field tenant_id]
Import data
Usage
tdb workspaces import-data <workspace_id> \
  --host <host> --database <db> --user <user> --password <pass> \
  [--port 5432] [--type postgresql] [--routing-field tenant_id] \
  [--drop-routing true] [--create-tenants true]
Full import (schema + data)
Usage
tdb workspaces import-full <workspace_id> \
  --host <host> --database <db> --user <user> --password <pass> \
  [--port 5432] [--type postgresql] [--routing-field tenant_id] \
  [--drop-routing true] [--create-tenants true]
Check progress
Usage
tdb workspaces import-status <workspace_id> --import-id <id>
FlagDefaultDescription
--hostrequired-Source database host
--databaserequired-Source database name
--userrequired-Source database user
--passwordrequired-Source database password
--portoptional5432Source database port
--typeoptionalpostgresqlDatabase type (postgresql, mysql, mongodb)
--routing-fieldoptionaltenant_idColumn used to split data by tenant
--drop-routingoptionaltrueDrop routing column after import
--create-tenantsoptionaltrueAuto-create tenants from routing values

Blueprints
tdb blueprints list List all blueprints
Usage
tdb blueprints list [--json]
tdb blueprints get Get blueprint details
Usage
tdb blueprints get <blueprint_name> [--json]
tdb blueprints versions List blueprint versions
Usage
tdb blueprints versions <blueprint_name>

Tenants
tdb tenants create Create tenant
Usage
tdb tenants create --name <name> --blueprint <blueprint> [--isolation <level>] [--region <zone>]
FlagDefaultDescription
--namerequired-Tenant name (lowercase, numbers, underscores)
--blueprintrequired-Blueprint name
--isolationoptional11 = shared, 2 = dedicated
--regionoptional-Region for dedicated tenants (e.g., eu-central). Use tdb regions to list available zones.
L2 dedicated VMs require a paid plan. Free tier accounts will receive a 403 forbidden error. Upgrade →
Example
Shell
# Shared tenant (instant)
$ tdb tenants create --name acme --blueprint fintech
✓ Tenant 'acme' created

# Dedicated tenant in specific region
$ tdb tenants create --name acme --blueprint fintech --isolation 2 --region eu-central
✓ Tenant 'acme' created
⏳ Provisioning... (waiting for ready)
JSON Response (shared)
JSON
{
  "success": true,
  "http_status": 201,
  "code": "created",
  "tenant_id": "acme",
  "status": "ready",
  "databases": [
    {
      "blueprint": "fintech",
      "database_type": "PostgreSQL",
      "isolation_level": 1,
      "connection": {
        "database": "fintech__acme",
        "connection_string": "postgresql://tdb_2abf90d3:[email protected]:5432/fintech__acme?sslmode=require"
      }
    }
  ]
}
Connection strings always include TLS. The format varies by database, see Connections for MySQL, MongoDB (?tls=true), and Redis (rediss://) examples.
tdb tenants list List all tenants
Usage
tdb tenants list [--json]
tdb tenants get Get tenant details + connections
Usage
tdb tenants get <tenant_id> [--json]
tdb tenants delete Delete tenant
Usage
tdb tenants delete <tenant_id> [--hard]
FlagDefaultDescription
--hardfalsePermanently delete (no recovery)
tdb tenants suspend / resume / restore Manage tenant state
Usage
tdb tenants suspend <tenant_id>
tdb tenants resume <tenant_id>
tdb tenants restore <tenant_id>
tdb tenants migrate Change isolation level
Usage
tdb tenants migrate <tenant_id> --level <level> --blueprint <name> [--region <zone>]
FlagDefaultDescription
--levelrequired-Target isolation level (1 = shared, 2 = dedicated)
--blueprintrequired-Blueprint to migrate
--regionoptional-Target region (for L2 migrations, e.g., eu-central)
L2 dedicated VMs require a paid plan. Free tier accounts will receive a 403 forbidden error. Upgrade →
Example
Shell
# Upgrade to dedicated VM
$ tdb tenants migrate acme --level 2 --blueprint fintech

# Migrate to a different region
$ tdb tenants migrate acme --level 2 --blueprint fintech --region us-east
tdb tenants backup / backups / rollback Backup management
Usage
tdb tenants backup <tenant_id>
          tdb tenants backups <tenant_id>
          tdb tenants rollback <tenant_id> --path <path>
Use tdb tenants backups <id> to get the exact --path value. For point-in-time recovery, use tdb tenants recover --to <timestamp> (L2 only).
tdb tenants recover / recover-undo Point-in-time recovery (L2 only)
Recover to timestamp
Usage
tdb tenants recover <tenant_id> --to <timestamp>
FlagDescription
--torequiredTarget time (ISO 8601, e.g., 2026-02-03T17:10:59Z)
Example
Shell
$ tdb tenants recover acme --to "2026-02-03T17:10:59Z"
✓ Recovery initiated
  ⚠️  Original VM preserved for 24h
      To undo: tdb tenants recover-undo acme
Undo recovery
Usage
tdb tenants recover-undo <tenant_id>
Example
Shell
$ tdb tenants recover-undo acme
✓ Recovery undone, original VM restored
Only available for L2 (dedicated) tenants. The original VM is preserved for 24 hours after recovery. After expiry, undo is no longer possible. Accepts both 2026-02-03T17:10:59Z and "2026-02-03 17:10:59" formats.
tdb tenants deployments List tenant deployment history
Usage
tdb tenants deployments <tenant_id> [--json]
Example
Shell
$ tdb tenants deployments acme --json
tdb tenants logs Get query logs
Usage
tdb tenants logs <tenant_id> [--type <error|slow>] [--since <1h|24h|7d>]
tdb tenants metrics Get performance metrics
Usage
tdb tenants metrics <tenant_id> [--json]

Deployments
tdb deployments list List deployments
Usage
tdb deployments list [--json]
tdb deployments create Create deployment
Usage
tdb deployments create --blueprint <name> [--version <v>] [--all]
Example
Shell
$ tdb deployments create --blueprint fintech --all
tdb deployments status Get deployment status
Usage
tdb deployments status <deployment_id>

Query
tdb query Run query on tenant(s)
Usage
tdb query --query <query> --blueprint <name> [--tenant <id>] [--all] [--type <type>]
FlagDefaultDescription
--queryrequired-OQL or native query
--blueprintrequired-Blueprint name
--tenantoptional*-Target tenant
--alloptional*falseQuery all tenants
* Either --tenant or --all is required.
Examples
Shell
# Query a single tenant
          $ tdb query --query "SELECT * FROM accounts" --blueprint fintech --tenant acme

          # Query all tenants
          $ tdb query --query "SELECT count(*) FROM users" --blueprint fintech --all

          # Insert data
          $ tdb query --query "INSERT INTO accounts (name, balance) VALUES ('Alice', 1000)" --blueprint fintech --tenant acme

          # Update data
          $ tdb query --query "UPDATE accounts SET balance = balance + 500 WHERE name = 'Alice'" --blueprint fintech --tenant acme
DDL statements (CREATE TABLE, ALTER TABLE, DROP TABLE, etc.) are blocked on tenant databases. Schema changes must go through your workspace and be deployed via blueprints. See Schema-First Architecture.