Deploy with the CLI
On this page
The dokwe CLI deploys straight from your working directory. You don't need a GitHub repository: Dokwe runs its own git server, and dokwe deploy pushes your code there and streams the build log back to you.
Install and log in#
curl -sSL https://dokwe.com/install-cli.sh | bashirm https://dokwe.com/install-cli.ps1 | iexThen log in:
dokwe loginDeploy a new project without GitHub#
Create the project#
From your project folder, run:
bashdokwe create my-appWhen asked for a GitHub repo URL, leave it blank to deploy with the CLI. If you enter a URL instead, the CLI also asks for a branch (default
main).dokwe createlinks the current directory to the new project by writing a.dokwefile.Deploy#
bashdokwe deployRun
dokwe checkfirst to catch what would break the build, anddokwe securityto scan the code for security problems on your machine.
What dokwe deploy does#
- Runs
git initif the folder isn't a git repository yet. - If there are uncommitted changes, stages everything and commits it with the message
Deploy via dokwe CLI. - Force-pushes your current
HEADto themainbranch of the project's repository on Dokwe's git server, at/git/<slug>.git. Your login token authenticates the push. - Waits for the deployment that the push starts, then streams its build log until it finishes.
If nothing changed since your last push, the CLI starts a fresh deployment of the existing code instead.
dokwe deploy commits every change in the folder and force-pushes. Check git status first if you don't want everything included.
Deploy a GitHub-connected project#
For a project that builds from GitHub, use the --from-git flag. It asks Dokwe to deploy from the connected repository and streams the build log, without pushing local code:
dokwe deploy --from-gitOn a GitHub-connected project, dokwe deploy stops and explains your options instead of uploading your local folder. Use dokwe deploy --from-git to deploy the latest commit from GitHub, dokwe push to commit and push to GitHub, or dokwe deploy --switch-to-cli to move the project to CLI deploys on purpose. After switching, GitHub pushes no longer deploy the project until you reconnect the repository in the project's settings.
Before it pushes, dokwe deploy tells you what it's doing: it commits any changed files (git add -A) unless you pass --no-commit, then force-pushes that commit to Dokwe's built-in git as main. Your local branches and other remotes aren't touched.
Link an existing directory#
If you already have a project, link a folder to it:
dokwe linkThe CLI lists your projects and asks you to choose one. Most commands use this link. To target another project for one command, pass --project (or -p) with a project ID or slug:
dokwe deploy --project my-appClone a project with dokwe pull#
dokwe pull clones a project using credentials Dokwe provides, so you don't need to set up GitHub access on your machine. It works for both GitHub-backed projects and projects on Dokwe's git server.
dokwe pull my-appRun it without an argument to pick from a list. The CLI clones into a folder named after the slug, checks out the project's branch, removes the token from the saved remote, and writes the .dokwe link.
If the project is already cloned, dokwe pull fast-forwards it instead. If that fails because of local changes or a diverged branch, resolve them and run git pull yourself.
Clone part of a large repository#
For big monorepos, clone only the paths you work on:
dokwe pull my-app --path apps/frontend --path libs--path turns on sparse checkout and implies --filter=blob:none. Pass --filter on its own (for example --filter blob:none) to keep the full tree but fetch file contents on demand.
Change the sparse paths later with dokwe sparse:
| Command | What it does |
|---|---|
dokwe sparse list | Show the active paths. |
dokwe sparse set <path>... | Replace the paths. |
dokwe sparse add <path>... | Add paths. |
dokwe sparse remove <path>... | Remove paths. |
dokwe sparse disable | Check out the full tree. |
dokwe sparse reapply | Rebuild the working tree from the current settings. |
Commit and push with dokwe push#
dokwe push stages, commits, and pushes your changes to the project's repository. The push starts a deployment: through the webhook for a GitHub repository, or directly for a repository on Dokwe's git server.
dokwe push -m "Fix pricing page" -a-m,--messagesets the commit message. Without it, the CLI asks.-a,--allstages all changes without asking.
The CLI pushes your current branch with short-lived credentials, then restores the clean remote URL. If the branch has no upstream yet, it sets one. Run dokwe logs --build to watch the build.
Preview locally with dokwe serve#
dokwe serve builds a Docker image of the current folder on your machine, runs it, and gives you a temporary public URL on preview.dokwe.com. The URL works while the command runs. Press Ctrl+C to stop the container and close the tunnel.
dokwe serve --port 8080| Flag | Default | Meaning |
|---|---|---|
--port | 3000 | Port your app listens on inside the container. |
--skip-build | off | Skip the Docker build and use an existing image. |
--image | auto-generated | Image tag to build or use. |
You need Docker installed locally. If there's no Dockerfile, the CLI tries to detect your stack and offers to write one.
Next steps#
- See every command in the CLI reference.
- Move a deploy from staging to production in Staging and production.