Skip to content

CLI Reference

Command-line interface for DeltaBase

The DeltaBase CLI provides commands for local development and infrastructure deployment.

Terminal window
npm install -g @delta-base/cli

Or use without installing:

Terminal window
npx @delta-base/cli <command>

CommandDescription
deltabase devStart local development environment
deltabase deployDeploy infrastructure from config file
deltabase --helpShow all available commands
deltabase --versionShow CLI version

Start a local DeltaBase environment with one command:

Terminal window
pnpx @delta-base/cli dev

This starts:

  • API Server at http://localhost:8787
  • Studio UI at http://localhost:3000

Deploy event stores and subscriptions from a config file:

Terminal window
pnpx @delta-base/cli deploy --api-key your-api-key

The CLI respects these environment variables:

VariableDescription
DELTABASE_API_KEYAPI key for authentication
DELTABASE_API_URLAPI URL (defaults to https://api.delta-base.com)

Using environment variables:

Terminal window
export DELTABASE_API_KEY=your-api-key
pnpx @delta-base/cli deploy

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