Durango Code CLI

Durango Code from your terminal

Deploy applications, manage Durango Cloud, and work with Durango Source repositories, changes, and pull requests. Commands are designed for people at a terminal and for agents consuming structured output.

Node.js 20+Zero runtime dependenciesAgent-safe JSON

Install, sign in, deploy

Install the durango-code package globally with Bun. orion-cli, durango-source and ds are installed as aliases of the same command.

Quickstart
bun add --global durango-code
durango-code login
durango-code whoami
durango-code deploy

The first deploy creates or links a Durango Code repository, pushes the committed revision, starts a build, waits for it to finish, and prints the live URL. Later deploys reuse the repository linked in local Git configuration.

To run without a global install, use bunx durango-code deploy. Run durango-code help or append --help to a command to see its current options.

Deploy committed code

Durango Code deploys HEAD. Uncommitted work stays local, so commit the exact state you want to release first.

Deploy
git add -A
git commit -m "Describe the release"
durango-code deploy --json
Monorepos

Use --root, --build-command, and --start-command on deploy, or persist them with configure.

Existing projects

Use --project <id-or-name> to target a specific Cloud repository. Use list --json to discover accessible projects.

Configure and inspect
durango-code configure --root web --build-command "bun run build"
durango-code deploy --environment production --json
durango-code status --json
durango-code activity --json

deploy exits with code 0 only after the app reaches the deployed state. A failed build returns a non-zero exit code and structured error details when --json is present.

Workspaces and changes

On a Durango Source repository, each task gets its own workspace and finishes as a change. Landing merges it into main and deploys the targets it touched.

One task, one change
durango-code ws new fix-sidebar && cd "$(durango-code ws path fix-sidebar)"
# edit, test, commit
durango-code change create --title "Fix the sidebar" --description-file change.md
durango-code change amend
durango-code land

change create runs the fast checks of the targets you touched before it opens the change. land merges into main on Durango Source and starts the deploys of the affected targets; deploys shows them and deploys retry redeploys a failed target from the newest main.

Review and merge pull requests

Pull requests
durango-code pr list --json
durango-code pr view 5 --json
durango-code pr create --title "Add repository stars" --body "Ready for review" --json
durango-code pr merge 5 --merge --json

Resolve a conflicting pull request

  1. Inspect mergeability and the exact conflict paths with pr view.
  2. Check out the pull request's pinned head commit with pr checkout.
  3. Run pr update-branch to merge the current base into the head.
  4. If Git reports conflicts, resolve them and commit the merge.
  5. Push the exact head branch with pr push, inspect again, then merge.
Resolve and merge
durango-code pr view 5 --json
durango-code pr checkout 5
durango-code pr update-branch 5
# Resolve files only if Git reports conflicts, then commit.
durango-code pr push 5 --json
durango-code pr view 5 --json
durango-code pr merge 5 --merge --json

pr update-branch pushes automatically when the merge is clean. When conflicts exist, it leaves the Git merge in progress so you can resolve and verify it locally.

Manage the whole application

The CLI covers the same repositories, services, environments, variables, domains, buckets, and deployment activity shown on the Durango Cloud canvas.

Cloud
durango-code service list --json
durango-code environment create Staging --slug staging --json
durango-code preview configure --enable --branch-previews --ttl 48 --json
durango-code domain add example.com --json
durango-code bucket create app-assets --json
durango-code resources list --json

Keep secrets out of arguments

Write individual values through standard input or sync dotenv files. env list returns names, not values. Only use env reveal when plaintext output is explicitly required.

Secrets
printf '%s' "$API_KEY" | durango-code env set API_KEY --stdin --environment production
durango-code env push .env.production --environment production
durango-code env list --environment production --json

Agent guide

Rules for an agent operating the Durango Code CLI, compact enough to place in an agent instruction file.

  • Run inside the linked Git clone, or pass an explicit --project.
  • Prefer --json; parse stdout as one JSON object and use the process exit code.
  • Inspect with whoami, status, list, or pr view before changing state.
  • Never print tokens or secret values. Provide secrets through DURANGO_CODE_TOKEN, --stdin, or an environment file.
  • Commit before deploy: the CLI deploys HEAD, not the working tree.
  • Use exact targets, and --yes only after verifying destructive operations.
Agent loop
# Establish identity and context
durango-code whoami --json
durango-code status --json

# Inspect the current command contract when needed
durango-code help
durango-code pr --help

# Change state with structured output, then verify
durango-code deploy --json
durango-code status --json

Environment

Authentication comes from a saved login or DURANGO_CODE_TOKEN. Headless systems can sign in once with login --token <token>, but an environment variable avoids writing credentials to disk. Login accepts desktop session tokens and personal access tokens.

DURANGO_CODE_ORIGINDurango origin (default https://durango.sh)
DURANGO_CODE_TOKENBearer token override; wins over saved credentials (CI)
DURANGO_CODE_CONFIG_DIRCredentials directory (default ~/.config/durango-code)
DURANGO_CODE_NO_UPDATE_CHECKSet to 1 to skip the daily new-version check

The legacy ORION_* names (for example ORION_TOKEN) still work; the DURANGO_CODE_* name wins when both are set.

Command map

Source control

durango-code wsCreate, list, run in, or remove parallel workspaces
durango-code changeOpen, amend, show, list, revert, approve, or abandon changes
durango-code landMerge a change into main and deploy the targets it affects
durango-code deploysShow, run, or retry the deploys of main
durango-code sourceInspect or move a repository to Durango Source; manage GitHub mirroring
durango-code prCreate, inspect, resolve, and merge pull requests
durango-code repoCreate, configure, list, or delete repositories
durango-code collaboratorManage repository access and roles

Deployments

durango-code deployPush HEAD, configure the app, and wait for deployment
durango-code statusShow the linked app and its latest deployment
durango-code activityList recent app or service deployments
durango-code logsRead build or deployment logs
durango-code openOpen the deployed app in a browser

Durango Cloud

durango-code serviceManage services attached to an app
durango-code environmentCreate and remove Cloud environments
durango-code previewConfigure preview-environment policy
durango-code configureSet build and monorepo configuration
durango-code envManage encrypted environment variables
durango-code domainManage app and service domains
durango-code bucketManage object-storage buckets
durango-code resourcesList or sync Cloud canvas resources

login, logout, and whoami manage the local session. See also the changelog for what changed in each release.