CLI Reference
Command-line interface for DeltaBase
The DeltaBase CLI provides commands for local development and infrastructure deployment.
Installation
Section titled “Installation”npm install -g @delta-base/clipnpm add -g @delta-base/cliyarn global add @delta-base/cliOr use without installing:
npx @delta-base/cli <command>pnpx @delta-base/cli <command>bunx @delta-base/cli <command>Commands
Section titled “Commands”| Command | Description |
|---|---|
deltabase dev | Start local development environment |
deltabase deploy | Deploy infrastructure from config file |
deltabase --help | Show all available commands |
deltabase --version | Show CLI version |
Quick Start
Section titled “Quick Start”Local Development
Section titled “Local Development”Start a local DeltaBase environment with one command:
pnpx @delta-base/cli devThis starts:
- API Server at
http://localhost:8787 - Studio UI at
http://localhost:3000
Deploy Infrastructure
Section titled “Deploy Infrastructure”Deploy event stores and subscriptions from a config file:
pnpx @delta-base/cli deploy --api-key your-api-keyEnvironment Variables
Section titled “Environment Variables”The CLI respects these environment variables:
| Variable | Description |
|---|---|
DELTABASE_API_KEY | API key for authentication |
DELTABASE_API_URL | API URL (defaults to https://api.delta-base.com) |
Using environment variables:
export DELTABASE_API_KEY=your-api-keypnpx @delta-base/cli deployConfiguration File
Section titled “Configuration File”The CLI uses deltabase.config.ts for infrastructure definitions:
import type { InfrastructureConfig as DeltaBaseConfig } from '@delta-base/server';
const config: DeltaBaseConfig = { eventStores: [ { name: 'my-events', description: 'My event store', subscriptions: [ { id: 'my-webhook', eventFilter: 'user.*', subscriberType: 'webhook', webhook: { url: 'https://my-app.com/webhooks/events', }, }, ], }, ],};
export default config;Learn more: Infrastructure as Code Guide
What’s Next?
Section titled “What’s Next?”- dev command - Local development details
- deploy command - Deployment options
- Infrastructure as Code - Configuration guide