CLI Reference
The Kolaybase CLI lets you manage projects, push schemas, run migrations, generate types, and more — all from your terminal.
Installation
npm install -g kolaybase-cliAuthentication
kb login
Log in to your Kolaybase account. The CLI opens your default browser, where you authenticate via Keycloak. After signing in you are shown a confirmation page — click Allow access to connect the CLI to your account, or Cancel to abort. The browser tab can be closed once the terminal confirms you are logged in.
kb login
# Custom API URL
kb login --api-url https://api.your-domain.comCredentials are stored in ~/.kolaybase/config.json. Run kb login again at any time to switch accounts.
Project Setup
kb init
Create a new project and link the current directory.
kb init
# Interactive — prompts for name, team, etc.
kb init --name my-appkb link
Link current directory to an existing project.
kb link --project-id <uuid>kb unlink
Remove project link from current directory.
kb unlinkkb status
Show project info, credentials, and connection strings.
kb status
# Show API keys (masked by default)
kb status --show-keysProject Management
kb projects
List all projects in your active team.
kb projects
# or
kb listkb projects:create
kb projects:create --name "My App" --description "Production app"kb projects:delete
kb projects:delete <projectId>Database
kb db push
Push a local schema to the remote database. Supports Prisma schema files and raw SQL.
# Push Prisma schema
kb db push
# Push SQL file
kb db push --file schema.sqlkb db pull
Introspect the remote database and save schema locally.
kb db pullkb db reset
Drop all tables in the project database.
kb db reset
# Skips confirmation
kb db reset --forcekb db seed
Run a seed file against the database.
kb db seedkb db dump
Export database schema as SQL.
kb db dump
kb db dump --output schema.sqlkb db diff
Show differences between local Prisma schema and remote database.
kb db diffkb db execute
Run arbitrary SQL.
# From file
kb db execute --file query.sql
# Inline
kb db execute --query "SELECT * FROM users LIMIT 5"Inspect
kb inspect
Show tables with row counts and sizes.
# All tables
kb inspect
# Specific table
kb inspect --table usersMigrations
kb migration new
Create a new migration file.
kb migration new add_orders_tablekb migration up
Apply pending migrations.
# Apply all pending
kb migration up
# Apply one step
kb migration up --step 1
# Dry run (show SQL without executing)
kb migration up --dry-runkb migration down
Rollback migrations.
kb migration down
kb migration down --step 2
kb migration down --dry-runkb migration status
Show applied and pending migrations.
kb migration statusCode Generation
kb gen types
Generate TypeScript type definitions from your database schema.
kb gen types
kb gen types --output src/types/database.tskb gen client
Generate a typed API client.
kb gen client
kb gen client --lang typescript --output src/lib/client.tsUtilities
kb logs
View SQL audit logs.
kb logs
kb logs --tail 50kb secrets
Manage project environment variables.
# List (values are masked)
kb secrets list
# Set
kb secrets set DATABASE_URL "postgres://..."
# Remove
kb secrets unset DATABASE_URLConfiguration
The CLI stores configuration in .kolaybase in your project directory and credentials in ~/.kolaybase/config.json.
# .kolaybase (project config)
{
"projectId": "uuid",
"apiUrl": "https://api.kolaybase.com"
}