Introduction
The DBOS CLI (dbos) provides command-line tools for managing your DBOS applications, workflows, and databases.
Installation
The DBOS CLI is automatically installed with thedbos Python package:
Command Structure
The CLI uses the following structure:Main Commands
| Command | Description |
|---|---|
dbos version | Show DBOS CLI version |
dbos init | Initialize a new DBOS application |
dbos start | Start your DBOS application |
dbos migrate | Run database migrations |
dbos reset | Reset the system database |
dbos workflow | Manage workflows |
dbos postgres | Manage local PostgreSQL with Docker |
Common Options
Many commands accept database connection options:Application database URL. Overrides configuration file.
System database URL. Overrides configuration file.
Schema name for DBOS system tables.
Database URL Resolution
The CLI resolves database URLs in the following order:-
DBOS Cloud environment variables (if
DBOS__CLOUD=true):DBOS_SYSTEM_DATABASE_URLDBOS_DATABASE_URL
-
Command-line options:
--sys-db-url--db-url
-
Configuration file (
dbos-config.yaml):system_database_urlapplication_database_urlordatabase_url
-
Default SQLite database:
sqlite:///{app_name}.sqlite
Application Commands
dbos version
Display the DBOS CLI version.dbos init
Initialize a new DBOS application from a template.Application name. If not provided, you’ll be prompted to select a template and enter a name.
Template to use. Available templates:
dbos-toolbox- Full-featured starter with examplesdbos-app-starter- Basic application templatedbos-cron-starter- Scheduled workflow template
Only add
dbos-config.yaml to an existing project.dbos start
Start your DBOS application using commands defined indbos-config.yaml.
runtimeConfig.start:
dbos-config.yaml
- Executes each command sequentially
- Forwards signals (SIGINT, SIGTERM) to child processes
- Exits when any command fails or is terminated
On Windows, signal forwarding is limited. Use Ctrl+C to stop the process.
Database Management
dbos migrate
Create DBOS system tables and run application migrations.Application database URL.
System database URL.
PostgreSQL role to grant permissions to (PostgreSQL only).
Schema name for DBOS system tables.
dbos reset
Reset the DBOS system database, deleting all workflow history and metadata.Skip confirmation prompt.
Application database URL.
System database URL.
PostgreSQL Docker Management
Manage a local PostgreSQL instance using Docker.dbos postgres start
Start a local PostgreSQL database in Docker.- Starts PostgreSQL 16 in a Docker container
- Exposes port 5432
- Uses persistent volume
dbos_postgres_data - Default credentials:
postgres:dbos
dbos postgres stop
Stop the local PostgreSQL database.Workflow Management
Workflow commands are documented in detail on the Workflow Commands page. Quick reference:Queue Commands
Manage enqueued workflows:Output Formats
Most commands output JSON for easy parsing:Parsing JSON Output
Usejq for JSON processing:
Configuration File
The CLI usesdbos-config.yaml by default. This file must be in your current directory or a parent directory.
Example:
Environment Variables
The CLI respects these environment variables:| Variable | Description |
|---|---|
DBOS__CLOUD | Set to true when running in DBOS Cloud |
DBOS_SYSTEM_DATABASE_URL | System database URL (DBOS Cloud) |
DBOS_DATABASE_URL | Application database URL (DBOS Cloud) |
Error Handling
The CLI exits with non-zero status codes on errors:| Exit Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error (configuration, database connection, etc.) |
Getting Help
Get help for any command:Common Patterns
Development Workflow
Production Deployment
Debugging Failed Workflows
See Also
- Workflow Commands - Workflow management
- Database Commands - Database operations
- Configuration - Configuration file reference
- Workflow Management Guide - Workflow patterns