CLI

Deploy from your terminal

dhq is the official DeployHQ command-line tool. Deploy, watch a deployment, read its logs and roll back from your terminal or your CI, with JSON output for scripts and AI agents. It is the recommended way to run deployments and automation.

brew install deployhq/tap/dhq
Terminal
dhq deploy -p my-app --wait
✓ Deployed to production in 42s
# Something wrong? Read the logs, or roll back.
dhq deployments logs dep-abc123 -p my-app
dhq rollback dep-abc123 -p my-app
Illustrative example

Install

Homebrew

macOS and Linux.

Terminal
brew install deployhq/tap/dhq

Script

macOS and Linux. Downloads the installer from deployhq.com.

Terminal
curl -fsSL https://www.deployhq.com/install/cli | sh

Scoop

Windows.

PowerShell
scoop bucket add deployhq https://github.com/deployhq/scoop-bucket
scoop install dhq

Go

Any platform with Go installed.

Terminal
go install github.com/deployhq/deployhq-cli/cmd/dhq@latest

You can also download a binary for Linux, macOS or Windows from the GitHub releases page. Then run dhq auth login to sign in, or dhq hello for a guided setup.

What you can do with it

  • Deploy a project or a server, and watch it live with --wait (dhq deploy, dhq deployments watch)
  • Read the logs of any deployment step (dhq deployments logs)
  • Retry, abort or roll back a deployment (dhq retry, dhq deployments abort, dhq rollback)
  • Manage projects, servers, server groups, environment variables, config files, SSH keys, build commands and scheduled deployments
  • Get a quick dashboard across all your projects (dhq status) and open anything in the browser (dhq open)
  • Call any API endpoint directly when there is no command for it yet (dhq api)

The CLI has more than 60 commands, and dhq --help lists them all. The full reference is in the CLI documentation.

Scripts, CI and AI agents

Every command can print JSON, and the CLI never has to ask a question when you run it non-interactively.

  • --json prints machine-readable output, and --json=name,status picks only the fields you need
  • --non-interactive fails with a clear error instead of waiting for a prompt
  • DEPLOYHQ_ACCOUNT, DEPLOYHQ_EMAIL and DEPLOYHQ_API_KEY replace the interactive login in CI
  • dhq commands and --agent describe the command set as JSON, so an agent can discover it
  • dhq skills install teaches your AI coding agents, such as Claude Code, Cursor and Codex, to use dhq
CI
export DEPLOYHQ_ACCOUNT=your-account
export DEPLOYHQ_EMAIL=you@example.com
export DEPLOYHQ_API_KEY=your-api-key

dhq deploy -p my-app --wait --json

For agent setups, see DeployHQ for AI agents.

CLI, MCP or API

  • CLI: recommended for deployments, rollbacks, logs and automation.
  • Hosted MCP server: recommended for read-only access to accounts, projects, servers and deployment status from an AI assistant. It cannot deploy, change configuration or read deployment logs.
  • REST API: for building your own integration.
  • Local MCP package: still supported for now. It runs on your computer with an API key.

Frequently Asked Questions

Which platforms does the CLI support?

macOS, Linux and Windows, on amd64 and arm64. Install it with Homebrew, the install script, Scoop (Windows) or Go, or download a binary from the GitHub releases page. Run dhq update to move to the latest release.

How does it sign in?

Run dhq auth login to sign in interactively. The CLI keeps your credentials in your operating system's keyring when one is available, and otherwise in private files in the ~/.deployhq directory (readable only by you). In CI, or for an agent, set DEPLOYHQ_ACCOUNT, DEPLOYHQ_EMAIL and DEPLOYHQ_API_KEY instead, and no login is needed.

Can I use it from CI or a script?

Yes. Set the three environment variables above, add --json for machine-readable output and --non-interactive so it never waits for a prompt, and use --wait to block until a deployment finishes.

Which should I use: the CLI, the hosted MCP server or the API?

Use the CLI to deploy, roll back, read logs and automate. Use the hosted MCP server when you only want an AI assistant to look at your projects, servers and deployment status. Use the REST API when you are building your own integration. The local MCP package is still supported for now.

Does the CLI collect any data?

It sends anonymous usage telemetry unless you turn it off: the command name, exit code, duration, CLI version, operating system and architecture, and a sanitised one-line error summary on failure. It never collects your account, project or credentials. Error summaries can include command argument values, such as a branch name. Run dhq telemetry disable, or set DEPLOYHQ_NO_TELEMETRY=1, to turn it off.

Is the CLI open source?

Yes. It is released under the MIT licence, and the source is on GitHub, where you can read the code, see the changelog and report issues.

Last updated on 30th October 2026