Skip to content
Skip to content

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:

FlagShortDescription
--verbose-vEnable verbose output with debug information
--jsonOutput results as JSON (useful for scripting)
--config-cPath to doku.yaml (default: ./doku.yaml)
--help-hShow 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

bash
doku init [flags]

Flags

FlagShortDescriptionDefault
--template-tUse a specific project templateauto-detect
--provider-pSet cloud provider (aws, gcp, azure)
--region-rSet deployment region
--force-fOverwrite existing doku.yaml

Examples

Initialize with auto-detection:

bash
doku init

Initialize for a specific provider and region:

bash
doku init --provider gcp --region us-central1

doku 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

bash
doku deploy [flags]

Flags

FlagShortDescriptionDefault
--env-eTarget environmentstaging
--dry-runPreview changes without deploying
--force-fSkip canary and deploy immediately
--skip-canaryDeploy to all instances at once (no gradual rollout)
--skip-buildSkip the build step (use existing artifacts)
--message-mDeployment description / release note

Examples

Deploy to staging (default):

bash
doku deploy

Deploy directly to production:

bash
doku deploy --env production

Preview what would change:

bash
doku deploy --dry-run

Deploy with a release note:

bash
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

bash
doku status [flags]

Flags

FlagShortDescriptionDefault
--env-eShow status for a specific environment
--watch-wContinuously refresh status

Examples

View all environments:

bash
doku status

Watch production status in real-time:

bash
doku status --env production --watch

doku logs

Stream or fetch logs from your deployed application. Outputs structured logs with timestamps, severity, and source instance.

Usage

bash
doku logs [flags]

Flags

FlagShortDescriptionDefault
--env-eTarget environmentstaging
--follow-fStream logs in real-time
--sinceShow logs since a duration (e.g., 5m, 1h, 24h)1h
--level-lFilter by log level (info, warn, error)

Examples

Stream production logs:

bash
doku logs --env production --follow

View recent errors:

bash
doku logs --env production --since 30m --level error

doku rollback

Roll back to the previous stable deployment. Doku restores the previous container image and infrastructure configuration.

Usage

bash
doku rollback [flags]

Flags

FlagShortDescriptionDefault
--env-eTarget environmentproduction
--toRoll back to a specific deployment ID
--yes-ySkip confirmation prompt

Examples

Roll back production to the previous version:

bash
doku rollback --env production

Roll back to a specific deployment:

bash
doku rollback --env production --to deploy_abc123

doku destroy

Tear down all infrastructure and resources for a project environment. This is a destructive action.

Usage

bash
doku destroy [flags]

Flags

FlagShortDescriptionDefault
--env-eTarget environmentstaging
--allDestroy all environments
--yes-ySkip confirmation prompt

Examples

Tear down staging environment:

bash
doku destroy --env staging

Tear down everything (all environments):

bash
doku destroy --all --yes

doku auth login

Authenticate with Doku. Opens a browser window for OAuth login and stores the API token locally.

Usage

bash
doku auth login

Flags

FlagShortDescriptionDefault
--token-tAuthenticate with an API token directly (for CI)

Examples

Interactive login (opens browser):

bash
doku auth login

Token-based login for CI:

bash
doku auth login --token $DOKU_API_KEY

doku auth logout

Remove stored authentication credentials from the local machine.

Usage

bash
doku auth logout

Examples

Log out:

bash
doku auth logout

doku auth whoami

Display the currently authenticated user and team.

Usage

bash
doku auth whoami

Examples

Check current identity:

bash
doku auth whoami

doku env set

Set environment variables for a deployment environment. Variables are encrypted at rest and injected at runtime.

Usage

bash
doku env set KEY=VALUE [KEY=VALUE...] [flags]

Flags

FlagShortDescriptionDefault
--env-eTarget environmentstaging

Examples

Set a database URL for production:

bash
doku env set DATABASE_URL=postgres://... --env production

Set multiple variables:

bash
doku env set REDIS_URL=redis://... CACHE_TTL=3600 --env production

doku env list

List all environment variables for a deployment environment. Values are masked by default.

Usage

bash
doku env list [flags]

Flags

FlagShortDescriptionDefault
--env-eTarget environmentstaging
--show-valuesDisplay unmasked values

Examples

List production variables:

bash
doku env list --env production

doku env unset

Remove environment variables from a deployment environment.

Usage

bash
doku env unset KEY [KEY...] [flags]

Flags

FlagShortDescriptionDefault
--env-eTarget environmentstaging

Examples

Remove a variable:

bash
doku env unset OLD_API_KEY --env production
CLI Reference — Doku Docs — Doku