CLI Reference
Complete reference for every Doku CLI command. All commands support --help for inline documentation.
Global Flags
These flags are available on every command:
| Flag | Short | Description |
|---|---|---|
| --verbose | -v | Enable verbose output with debug information |
| --json | — | Output results as JSON (useful for scripting) |
| --config | -c | Path to doku.yaml (default: ./doku.yaml) |
| --help | -h | Show help for any command |
Commands
doku init
Initialize a new Doku project in the current directory. Scans your codebase to detect framework, language, and dependencies, then generates a doku.yaml configuration file.
Usage
doku init [flags]Flags
| Flag | Short | Description | Default |
|---|---|---|---|
| --template | -t | Use a specific project template | auto-detect |
| --provider | -p | Set cloud provider (aws, gcp, azure) | — |
| --region | -r | Set deployment region | — |
| --force | -f | Overwrite existing doku.yaml | — |
Examples
Initialize with auto-detection:
doku initInitialize for a specific provider and region:
doku init --provider gcp --region us-central1doku deploy
Deploy the current project. Builds the application, provisions infrastructure if needed, and performs a canary rollout. Defaults to the staging environment unless --env is specified.
Usage
doku deploy [flags]Flags
| Flag | Short | Description | Default |
|---|---|---|---|
| --env | -e | Target environment | staging |
| --dry-run | — | Preview changes without deploying | — |
| --force | -f | Skip canary and deploy immediately | — |
| --skip-canary | — | Deploy to all instances at once (no gradual rollout) | — |
| --skip-build | — | Skip the build step (use existing artifacts) | — |
| --message | -m | Deployment description / release note | — |
Examples
Deploy to staging (default):
doku deployDeploy directly to production:
doku deploy --env productionPreview what would change:
doku deploy --dry-runDeploy with a release note:
doku deploy --env production -m "Fix checkout timeout"doku status
Show the current status of all environments for this project, including deployment health, instance counts, and URLs.
Usage
doku status [flags]Flags
| Flag | Short | Description | Default |
|---|---|---|---|
| --env | -e | Show status for a specific environment | — |
| --watch | -w | Continuously refresh status | — |
Examples
View all environments:
doku statusWatch production status in real-time:
doku status --env production --watchdoku logs
Stream or fetch logs from your deployed application. Outputs structured logs with timestamps, severity, and source instance.
Usage
doku logs [flags]Flags
| Flag | Short | Description | Default |
|---|---|---|---|
| --env | -e | Target environment | staging |
| --follow | -f | Stream logs in real-time | — |
| --since | — | Show logs since a duration (e.g., 5m, 1h, 24h) | 1h |
| --level | -l | Filter by log level (info, warn, error) | — |
Examples
Stream production logs:
doku logs --env production --followView recent errors:
doku logs --env production --since 30m --level errordoku rollback
Roll back to the previous stable deployment. Doku restores the previous container image and infrastructure configuration.
Usage
doku rollback [flags]Flags
| Flag | Short | Description | Default |
|---|---|---|---|
| --env | -e | Target environment | production |
| --to | — | Roll back to a specific deployment ID | — |
| --yes | -y | Skip confirmation prompt | — |
Examples
Roll back production to the previous version:
doku rollback --env productionRoll back to a specific deployment:
doku rollback --env production --to deploy_abc123doku destroy
Tear down all infrastructure and resources for a project environment. This is a destructive action.
Usage
doku destroy [flags]Flags
| Flag | Short | Description | Default |
|---|---|---|---|
| --env | -e | Target environment | staging |
| --all | — | Destroy all environments | — |
| --yes | -y | Skip confirmation prompt | — |
Examples
Tear down staging environment:
doku destroy --env stagingTear down everything (all environments):
doku destroy --all --yesdoku auth login
Authenticate with Doku. Opens a browser window for OAuth login and stores the API token locally.
Usage
doku auth loginFlags
| Flag | Short | Description | Default |
|---|---|---|---|
| --token | -t | Authenticate with an API token directly (for CI) | — |
Examples
Interactive login (opens browser):
doku auth loginToken-based login for CI:
doku auth login --token $DOKU_API_KEYdoku auth logout
Remove stored authentication credentials from the local machine.
Usage
doku auth logoutExamples
Log out:
doku auth logoutdoku auth whoami
Display the currently authenticated user and team.
Usage
doku auth whoamiExamples
Check current identity:
doku auth whoamidoku env set
Set environment variables for a deployment environment. Variables are encrypted at rest and injected at runtime.
Usage
doku env set KEY=VALUE [KEY=VALUE...] [flags]Flags
| Flag | Short | Description | Default |
|---|---|---|---|
| --env | -e | Target environment | staging |
Examples
Set a database URL for production:
doku env set DATABASE_URL=postgres://... --env productionSet multiple variables:
doku env set REDIS_URL=redis://... CACHE_TTL=3600 --env productiondoku env list
List all environment variables for a deployment environment. Values are masked by default.
Usage
doku env list [flags]Flags
| Flag | Short | Description | Default |
|---|---|---|---|
| --env | -e | Target environment | staging |
| --show-values | — | Display unmasked values | — |
Examples
List production variables:
doku env list --env productiondoku env unset
Remove environment variables from a deployment environment.
Usage
doku env unset KEY [KEY...] [flags]Flags
| Flag | Short | Description | Default |
|---|---|---|---|
| --env | -e | Target environment | staging |
Examples
Remove a variable:
doku env unset OLD_API_KEY --env production