⚙ Global Flags
Available on every command.
| Flag | Description |
|---|---|
| --json | Output as JSON |
| --quiet | Minimal output |
| --verbose | Debug output |
| --output <file> | Save output to file |
tdb version
Print CLI version
Shell
$ tdb version tdb v1.0.1 (built 2026-01-02)
🔐 Auth & Config
tdb signup
Create new account
Usage
tdb signup --email <email> --password <password> [--project <name>]
| Flag | Default | Description | |
|---|---|---|---|
| required | — | Email address | |
| --password | required | — | Password (min 8 chars) |
| --project | optional | My Project | Project name |
Example
Shell
$ tdb signup --email you@company.com --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,
"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>
| Flag | Description | |
|---|---|---|
| --name | required | Workspace name |
| --database | required | PostgreSQL, MySQL, MongoDB, Redis |
Example
Shell
$ tdb workspaces create --name myapp --database PostgreSQL ✓ Workspace 'myapp' created
JSON Response
JSON
{
"success": true,
"id": "myapp",
"blueprint": "myapp",
"database": "PostgreSQL",
"connection_string": "postgresql://tdb_2abf90d3:tdb_d2bf66ed@pg.tenantsdb.com:5432/myapp_dev"
}
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>]
| Flag | Description |
|---|---|
| --template | Template name (ecommerce, saas, blog, fintech) |
| --json | JSON schema definition |
| --database | Database connection JSON for import |
Example
Shell
$ tdb workspaces schema myapp --template fintech
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> \ [--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>
Check progress
Usage
tdb workspaces import-status <workspace_id> --import-id <id>
📐 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>]
| Flag | Default | Description | |
|---|---|---|---|
| --name | required | — | Tenant name (lowercase, numbers, underscores) |
| --blueprint | required | — | Blueprint name |
| --isolation | optional | 1 | 1 = shared, 2 = dedicated |
Example
Shell
$ tdb tenants create --name acme --blueprint fintech ✓ Tenant 'acme' created
JSON Response
JSON
{
"success": true,
"tenant_id": "acme",
"status": "ready",
"databases": [
{
"blueprint": "fintech",
"database_type": "PostgreSQL",
"isolation_level": 1,
"connection": {
"database": "fintech__acme",
"connection_string": "postgresql://tdb_2abf90d3:tdb_d2bf66ed@pg.tenantsdb.com:5432/fintech__acme"
}
}
]
}
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]
| Flag | Default | Description |
|---|---|---|
| --hard | false | Permanently 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>
Example
Shell
# Upgrade to dedicated VM
$ tdb tenants migrate acme --level 2
tdb tenants backup / backups / rollback
Backup management
Usage
tdb tenants backup <tenant_id> tdb tenants backups <tenant_id> tdb tenants rollback <tenant_id> [--date <date>] [--path <path>]
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>]
| Flag | Default | Description | |
|---|---|---|---|
| --query | required | — | OQL or native query |
| --blueprint | required | — | Blueprint name |
| --tenant | optional* | — | Target tenant |
| --all | optional* | false | Query all tenants |
| --type | optional | PostgreSQL | Database type |
* Either
--tenant or --all is required.Examples
Shell
# Single tenant $ tdb query --tenant acme --query "SELECT * FROM accounts" --blueprint fintech # All tenants $ tdb query --all --query "SELECT count(*) FROM users" --blueprint myapp