Docs/Reference/CLI reference

CLI reference

11 min read
On this page

The dokwe CLI deploys, configures, and monitors your projects from the terminal. This page lists every command with its usage line, description, and flags.

Install and update#

macOS / Linux
curl -sSL https://dokwe.com/install-cli.sh | bash

The macOS and Linux installer supports amd64 and arm64 and installs to /usr/local/bin, creating the folder if it's missing and asking for your password only when it needs sudo. Without sudo it installs to ~/.local/bin and tells you how to add that to your PATH. On a Mac, the CLI needs macOS 12 (Monterey) or later. The Windows installer installs dokwe.exe to %LOCALAPPDATA%\dokwe and adds that folder to your user PATH.

To update in place, run:

bash
dokwe update

dokwe upgrade is an alias. The CLI also checks for a newer version after most commands and prints a hint when one is available.

Check your installed version with dokwe --version.

Global flags#

These flags work with every command.

FlagTypeDefaultDescription
-p, --projectstringProject ID (overrides .dokwe link)
-h, --helpHelp for any command

--project also accepts a project slug or name. Without it, commands use the project linked to the current folder in .dokwe/. Link a folder with dokwe link, or automatically with dokwe create or dokwe pull.

Set DOKWE_API_URL to point the CLI at a different API before you run dokwe login.

Auth#

dokwe login#

text
dokwe login [flags]

Log in to Dokwe (email + password, or --api-key). Without flags, the CLI prompts for the API URL, then your email and password.

FlagTypeDefaultDescription
-k, --api-keystringAuthenticate non-interactively with an API key (dk_pak_…)
--api-urlstringOverride the API URL for this run

dokwe logout#

text
dokwe logout

Log out.

dokwe whoami#

text
dokwe whoami

Show current user.

Projects#

dokwe projects#

text
dokwe projects [flags]

List all projects.

FlagTypeDefaultDescription
--jsonboolfalseOutput as JSON

dokwe create#

text
dokwe create [name]

Create a new project. Prompts for a name if you don't pass one, then for a GitHub repo URL. Leave the URL blank to deploy with the CLI. If you enter a URL, it also prompts for a branch (default main). Links the current folder to the new project.

text
dokwe link

Link current directory to a project. Shows a numbered list of your projects to pick from.

dokwe pull#

text
dokwe pull [project] [flags]

Clone a project and configure credentials. Uses your stored GitHub credentials, so you don't need to set up GitHub locally.

FlagTypeDefaultDescription
--pathstring arraySparse-checkout path (repeatable). Implies --filter=blob:none when not otherwise set.
--filterstringPartial clone filter (e.g. blob:none, tree:0) — passed straight to git clone.
bash
dokwe pull my-repo                                    # full clone
dokwe pull my-repo --path apps/frontend               # only apps/frontend + top-level files
dokwe pull my-repo --path apps/frontend --path libs   # multiple paths
dokwe pull my-repo --filter blob:none                 # full tree, blobs on demand

dokwe sparse#

text
dokwe sparse <command>

Manage sparse-checkout on the current project. Wraps git sparse-checkout and must run inside a Dokwe-linked project.

CommandUsageDescription
listdokwe sparse listShow the active sparse-checkout paths
setdokwe sparse set <path>...Replace the sparse-checkout paths
adddokwe sparse add <path>...Add paths to sparse-checkout
removedokwe sparse remove <path>...Drop paths from sparse-checkout
disabledokwe sparse disableTurn off sparse-checkout and materialise the full tree
reapplydokwe sparse reapplyRe-materialise the working tree from the current sparse config

Deploy#

dokwe deploy#

text
dokwe deploy [flags]

Deploy from current directory. Pushes the folder to Dokwe's built-in git server, initialising a git repository first if there isn't one. See Deploy from the CLI.

FlagTypeDefaultDescription
--from-gitboolfalseTrigger Git-based deploy

With --from-git, Dokwe deploys from the project's connected repository instead and streams the build logs.

dokwe push#

text
dokwe push [flags]

Commit changes and trigger a deployment. Stages, commits, and pushes to GitHub. The webhook then starts a new deployment.

FlagTypeDefaultDescription
-m, --messagestringCommit message
-a, --allboolfalseStage all changes without prompting

dokwe rollback#

text
dokwe rollback [deployment-id]

Rollback to a previous deployment. Without an ID, the CLI picks a recent deployment from the project's last five. See Rollbacks.

dokwe status#

text
dokwe status

Show project status.

dokwe open#

text
dokwe open

Open project in browser.

dokwe restart#

text
dokwe restart

Restart project containers.

dokwe stop#

text
dokwe stop

Stop project. Asks you to confirm, because this takes the app offline.

dokwe start#

text
dokwe start

Start/unpause project.

dokwe serve#

text
dokwe serve [flags]

Expose your local app on a public preview URL. Builds a Docker image of the current folder and serves it on a random preview subdomain while the command runs. Press Ctrl+C to stop and clean up.

FlagTypeDefaultDescription
--portint3000Port your app listens on inside the container
--skip-buildboolfalseSkip Docker build (use existing image)
--imagestringauto-generatedDocker image tag to use

Check and secure#

dokwe check#

text
dokwe check [flags]

Check that this project is ready to deploy. Reads the project's build files (never source code or .env), runs rule checks against how Dokwe will build it, then an AI review. Each workspace gets 5 free AI reviews a week; after that it uses your own AI key from Settings → AI and integrations. Exits with status 1 when something will break the deploy. See Check before you deploy.

FlagTypeDefaultDescription
-d, --dirstringthe linked project's rootFolder to check
--jsonboolfalsePrint the result as JSON
--no-aiboolfalseRun the rule checks only

dokwe security#

text
dokwe security [folder] [flags]

Scan this codebase for security problems, on this machine: vulnerable dependencies, leaked secrets, insecure code and risky deploy configuration. Nothing is uploaded. The scanner is a one-time download of about 45 MB, which it asks about first. Exits with status 1 at --fail-on severity or above. See Security scan.

FlagTypeDefaultDescription
--jsonboolfalsePrint the result as JSON
--sarifstringAlso write SARIF 2.1.0 to this file (GitHub code scanning)
--fail-onstringhighExit with status 1 at this severity or above: critical, high, medium, low
--historyboolfalseAlso scan git history for secrets (slower)
--update-dbboolfalseRefresh the vulnerability database now
--offlineboolfalseNever download anything
--include-testsboolfalseAlso check tests and fixtures for insecure code
--excludestring arrayPaths or globs to leave out (repeatable)
--skipstring arrayLeave out a check: deps, secrets, code, config
-y, --yesboolfalseDownload the scanner without asking (for CI)

Environment#

dokwe env#

text
dokwe env [flags]
dokwe env <command>

Manage environment variables. On its own, lists the project's variables. These commands manage project-level variables. See Environment variables.

FlagTypeDefaultDescription
--jsonboolfalseOutput as JSON
CommandUsageDescription
setdokwe env set KEY=VALUESet an environment variable
getdokwe env get KEYGet an environment variable
removedokwe env remove KEYRemove an environment variable
importdokwe env import [file]Import from .env file (defaults to .env)
pulldokwe env pull [flags]Download env vars to .dokwe/.env.prod
pushdokwe env push [flags]Upload .dokwe/.env.prod to Dokwe (resolves 1Password refs)
editdokwe env edit [flags]Open env file in your editor

Flags for pull, push, and edit:

CommandFlagTypeDefaultDescription
pull--envstringprodEnvironment name (prod, staging, etc.)
push--envstringprodEnvironment name (prod, staging, etc.)
edit--envstringprodEnvironment name

--env selects the local file .dokwe/.env.<name>. edit opens it with $EDITOR, then $VISUAL, then vi (notepad on Windows).

dokwe vault#

text
dokwe vault <command>

Manage 1Password vault integration. Requires the 1Password CLI (op).

CommandUsageDescription
statusdokwe vault statusCheck 1Password CLI status
resolvedokwe vault resolve [flags]Resolve 1Password references in env file (dry run)
CommandFlagTypeDefaultDescription
resolve--envstringprodEnvironment name

Domains#

dokwe domains#

text
dokwe domains
dokwe domains <command>

Manage custom domains. On its own, lists the project's domains with their type and SSL status. See Custom domains and HTTPS.

CommandUsageDescription
adddokwe domains add <domain>Add a custom domain
removedokwe domains remove <id-or-domain>Remove a custom domain
verifydokwe domains verify <id-or-domain>Verify domain DNS. Exits with an error and lists the missing records if a check fails

Services#

dokwe services#

text
dokwe services [flags]
dokwe services <command>

Manage services (databases, caches). On its own, lists your services. See Databases.

FlagTypeDefaultDescription
--jsonboolfalseOutput as JSON
CommandUsageDescription
createdokwe services create [name]Create a new service. Prompts for the type: postgres, mysql, or redis.
infodokwe services info <id-or-slug>Show service details and connection info
stopdokwe services stop <id-or-slug>Stop a service
startdokwe services start <id-or-slug>Start a service
deletedokwe services delete <id-or-slug>Delete a service

Logs#

dokwe logs#

text
dokwe logs [flags]

Stream container logs. See Logs and terminal.

FlagTypeDefaultDescription
--buildboolfalseShow build logs instead of container logs
--tokenstringShare token — stream logs without logging in

dokwe logs share#

text
dokwe logs share [flags]

Generate a share token for log streaming. Anyone with the token can run dokwe logs --token <token>.

FlagTypeDefaultDescription
--labelstringHuman-readable label for this token

dokwe ps#

text
dokwe ps

Show container metrics.

Fleet#

dokwe fleet#

text
dokwe fleet <command>

Manage Dokwe Fleet hosts and workloads. These are read-only commands. See Fleet.

dokwe fleet list#

text
dokwe fleet list [flags]

List Fleet hosts in your workspace.

FlagTypeDefaultDescription
--clusterstringFilter by cluster id
--sitestringFilter by site id
--osstringFilter by OS family (linux | windows | darwin)
--statusstringFilter by status (online | offline | degraded | error)
-q, --qstringFree-text search (hostname, IP, OS version)
--jsonboolfalseOutput as JSON

dokwe fleet describe#

text
dokwe fleet describe <host> [flags]

Show detail for one Fleet host (by id or hostname).

FlagTypeDefaultDescription
--jsonboolfalseOutput as JSON

dokwe fleet workloads#

text
dokwe fleet workloads [flags]

List managed workloads.

FlagTypeDefaultDescription
--hoststringFilter by host id
--clusterstringFilter by cluster id
--kindstringFilter by execution kind (systemd, container, …)
--modestringFilter by management mode (1, 2, or 3)
--jsonboolfalseOutput as JSON

Utilities#

dokwe init#

text
dokwe init [flags]

Detect the framework in the current directory and write a starter dokwe.yml. The generated file always uses mode: native and is validated before the command exits. See dokwe.yml reference.

FlagTypeDefaultDescription
-o, --outstringdokwe.ymlOutput path
--frameworkstringForce framework: laravel | nextjs | node | php | generic
--non-interactiveboolfalseSkip prompts; use flags + defaults (CI mode)
--hoststringBYOS server name
--domainstringPrimary domain (services.web.domain)
--destinationstringHost filesystem path (deploy.destination)
--forceboolfalseOverwrite an existing dokwe.yml

dokwe validate#

text
dokwe validate [flags]

Validate dokwe.yml against the manifest schema (no network). Runs JSON Schema validation plus native-mode cross-field checks and prints errors and warnings. Exits with status 1 if there are errors.

FlagTypeDefaultDescription
-f, --filestringdokwe.ymlPath to manifest

dokwe update#

text
dokwe update

Update Dokwe CLI to the latest version. Alias: upgrade.