Installing the DeployHQ CLI
The DeployHQ CLI (dhq) is a single binary with no runtime dependencies. It runs on macOS, Linux, and Windows.
System Requirements
- macOS (Intel or Apple Silicon), Linux (x8664 or ARM64), or Windows (x8664 or ARM64)
- No Ruby, Node.js, or other runtime required
Installation Methods
Homebrew (macOS/Linux)
The recommended method for macOS and Linux:
brew install deployhq/tap/dhq
Install Script (macOS/Linux)
A one-liner that downloads the latest binary for your platform:
curl -fsSL https://raw.githubusercontent.com/deployhq/deployhq-cli/main/install.sh | sh
This is the recommended method for CI/CD environments where Homebrew is not available.
Go Install
If you have Go installed:
go install github.com/deployhq/deployhq-cli/cmd/deployhq@latest
Binary Download
Download the latest release for your platform from the GitHub Releases page. Extract the binary and place it somewhere in your PATH.
Verifying Installation
After installation, verify that the CLI is working:
dhq --version
Run the health check to verify your setup and connectivity:
dhq doctor
Updating
Self-Update
The CLI can update itself:
dhq update
This uses Homebrew if available, otherwise downloads the latest release from GitHub.
Homebrew Update
If you installed via Homebrew:
brew upgrade dhq
Uninstalling
Homebrew
brew uninstall dhq
Manual
Remove the dhq binary from your PATH and optionally delete the configuration directory:
rm $(which dhq)
rm -rf ~/.deployhq
Migrating from the Old Ruby Gem
The previous Ruby gem CLI (deployhq) is deprecated. To migrate:
- Uninstall the old gem:
gem uninstall deployhq
Install the new CLI using any method above.
Authenticate with the new CLI:
dhq auth login
- Set up your project:
cd /path/to/your-project
dhq configure
The new CLI stores credentials securely in your OS keyring instead of a Deployfile. Your old Deployfile is no longer needed, but keep it until you have confirmed the new CLI is working.
Command Mapping
| Old (Ruby gem) | New (dhq) |
|---|---|
deployhq configure |
dhq configure |
deployhq servers |
dhq servers list |
deployhq deploy |
dhq deploy --wait |
Troubleshooting
"command not found" After Installation
Ensure the binary is in your PATH. Check with:
which dhq
If nothing is returned, add the installation directory to your PATH. For the install script, the default location is /usr/local/bin/.
Permission Denied on macOS
If macOS blocks the binary, allow it in System Settings > Privacy & Security, or run:
xattr -d com.apple.quarantine $(which dhq)
Doctor Fails
Run dhq doctor to diagnose issues. It checks:
- CLI version and update availability
- Authentication status
- API connectivity
- Configuration file validity