DeployHQ from your terminal -- for humans and agents.
brew install deployhq/tap/dhqcurl -fsSL https://deployhq.com/install/cli | shscoop bucket add deployhq https://github.com/deployhq/scoop-bucket
scoop install dhqgo install github.com/deployhq/deployhq-cli/cmd/deployhq@latestDownload from Releases (Linux, macOS, Windows — amd64/arm64).
dhq update# Guided setup (login or signup, pick a project, optional first deploy)
dhq hello
# Or step-by-step
dhq signup
dhq auth login
dhq configure
# Deploy and watch in real-time
dhq deploy -p my-app --wait
# Check deployment logs
dhq deployments logs <id> -p my-app
# Open in browser
dhq open my-app# Interactive login (stores in OS keyring)
dhq auth login
# Environment variables (CI/agents — no login needed)
export DEPLOYHQ_API_KEY=your-api-key
export DEPLOYHQ_ACCOUNT=your-account
export DEPLOYHQ_EMAIL=your-emailNo dhq auth login needed — set secrets and go:
# .github/workflows/deploy.yml
env:
DEPLOYHQ_ACCOUNT: ${{ secrets.DEPLOYHQ_ACCOUNT }}
DEPLOYHQ_EMAIL: ${{ secrets.DEPLOYHQ_EMAIL }}
DEPLOYHQ_API_KEY: ${{ secrets.DEPLOYHQ_API_KEY }}
DEPLOYHQ_PROJECT: my-app
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- run: curl -fsSL https://deployhq.com/install/cli | sh
- run: dhq deploy --server production --revision ${{ github.sha }} --wait --jsonSee examples/github-actions/ for complete workflows:
- deploy.yml — Deploy on push to main with polling and failure logs
- deploy-multi-env.yml — Staging on push, production on release, auto-rollback
- deploy-on-pr-merge.yml — Deploy on PR merge with status comment on the PR
dhq projects list | show | create | update | delete | star | insights | upload-key | badge
dhq servers list | show | create | update | delete | reset-host-key
dhq server-groups list | show | create | update | delete
dhq deployments list | show | create | abort | rollback | logs | watch
dhq repos show | create | update | branches | commits | commit-info | latest-revision
dhq deploy [-p project] [-s server] [--wait] (deploy with live progress)
dhq retry <deployment-id> -p <project>
dhq rollback <deployment-id> -p <project>
dhq insights [project] (deployment insights: totals, success rate, duration)
dhq test-access [-p project] [-s server] [--wait] (test repo + server connectivity)
dhq open [project] (open DeployHQ in browser)
dhq hello (guided onboarding: login/signup + project setup)
dhq init (interactive project setup wizard)
dhq api GET|POST|PUT|PATCH|DELETE <path> (escape hatch)
dhq auth login | logout | status | token
dhq signup (create a new DeployHQ account)
dhq config show | init | set | unset
dhq configure (interactive setup wizard)
dhq commands (full catalog as JSON for agents)
dhq show <url> (show any DeployHQ resource by URL)
dhq env-vars list | show | create | update | delete
dhq config-files list | show | create | update | delete
dhq build-commands list | create | update | delete
dhq build-configs list | show | default | create | update | delete
dhq ssh-commands list | show | create | update | delete
dhq excluded-files list | show | create | update | delete
dhq integrations list | show | create | update | delete
dhq templates list | show | public | public-show | create | update | delete
dhq agents list | create | update | delete | revoke
dhq ssh-keys list | create | delete
dhq global-servers list | show | create | update | delete | copy-to-project
dhq global-env-vars list | show | create | update | delete
dhq global-config-files list | show | create | update | delete
dhq build-cache-files list | create | update | delete
dhq build-languages set <language-id> --version <ver> [-p project]
dhq build-known-hosts list | create | delete
dhq auto-deploys list | enable
dhq scheduled-deploys list | show | create | update | delete
dhq activity list | stats
dhq status (quick dashboard across all projects)
dhq assist [question] (AI deployment assistant, requires Ollama)
dhq completion bash | zsh | fish | powershell
dhq doctor (health check)
dhq update (self-update to latest version)
dhq setup claude | codex | cursor | windsurf (install agent plugins, --project for project-level)
dhq mcp (start MCP server in stdio mode)
# Deploy and watch steps in real-time (TUI in interactive terminals)
dhq deploy -p my-app -s production --wait
# Server names are fuzzy-matched
dhq deploy -p my-app -s fedora --wait
# Watch an existing deployment
dhq deployments watch <id> -p my-appOn failure, logs are shown automatically with suggested next commands.
Get AI-powered help for your deployments using a local LLM. All data stays on your machine.
If you are already using an AI coding agent (Claude Code, Codex, Cursor, etc.), your agent can use dhq commands and the API directly — you don't need dhq assist. The local assistant is for developers who want a privacy-first, offline-capable option using an open-source model via Ollama, without relying on an external coding agent.
# One-time setup (installs Ollama + downloads model)
dhq assist --setup
# Ask questions about your deployments
dhq assist "why did my deploy fail?" -p my-app
dhq assist "what should I do?" -p my-app
dhq assist "what does transfer_files do?"
# Check status
dhq assist --statusRequires Ollama running locally. Default model: qwen2.5:3b (~2GB).
All commands support --json for machine-readable output:
# Full JSON
dhq projects list --json
# Selected fields
dhq projects list --json name,permalink,zone
# Pipe to jq
dhq deployments show abc123 -p my-app --json | jq '.data.status'JSON responses include breadcrumbs with suggested next commands:
{
"ok": true,
"data": { ... },
"summary": "Deployment abc123 completed",
"breadcrumbs": [
{"action": "logs", "cmd": "dhq deployments logs abc123 -p my-app"},
{"action": "rollback", "cmd": "dhq rollback abc123 -p my-app"}
]
}# Zsh (add to ~/.zshrc)
source <(dhq completion zsh)
# Bash (add to ~/.bashrc)
source <(dhq completion bash)
# Fish
dhq completion fish | sourceCompletions include dynamic project and server name suggestions for --project, show, open, and server commands.
4 layers (highest to lowest precedence):
- CLI flags (
--account,--project) - Environment variables (
DEPLOYHQ_ACCOUNT,DEPLOYHQ_PROJECT) - Project config (
.deployhq.tomlin current directory) - Global config (
~/.deployhq/config.toml)
# Interactive setup (recommended)
dhq configure
# Or manual
dhq config init
dhq config set project my-app
dhq config show --resolvedThe CLI is designed for AI agents that can run shell commands.
Agent skill guides are available at .claude/SKILL.md, .codex/SKILL.md, .cursor/SKILL.md, .windsurf/SKILL.md, and docs/SKILL.md.
# Install agent plugin (Claude Code, Codex, Cursor, or Windsurf)
dhq setup claude
# Full command catalog with agent safety metadata
dhq commands --json
# Agent-optimized workflow
DEPLOYHQ_AGENT=my-bot dhq deploy -p my-app --jsonUse --non-interactive to guarantee the CLI never prompts. Auto-enabled when output is piped.
# Explicit strict mode — errors instead of prompting
dhq deploy -p my-app --non-interactive --json
# Piped output auto-enables non-interactive
dhq deploy -p my-app --json | jq .dhq commands --json includes per-command safety metadata:
{
"agent": {
"interactive": false,
"destructive": true,
"idempotent": false,
"requires_confirmation": true,
"supports_json": true,
"safe_for_automation": true,
"resource_types": ["project"]
}
}Set DEPLOYHQ_OUTPUT_FILE to capture all operations as JSONL:
export DEPLOYHQ_OUTPUT_FILE=/tmp/deployhq.jsonl
dhq deploy -p my-app
cat /tmp/deployhq.jsonlThe skills/deployhq/ directory contains structured reference docs that AI agents consume to correctly use the CLI:
SKILL.md— Entry point: auth, output contract, decision trees, gotchasreferences/— 8 per-domain docs (projects, servers, deployments, repos, configuration, global resources, operations, auth/setup)
skill-evals/deployhq/ contains 57 evaluation cases that test whether an LLM correctly translates natural language into dhq commands:
# Dry-run (no API calls)
./skill-evals/deployhq/run-evals.sh --dry-run
# Run all evals
ANTHROPIC_API_KEY=sk-... ./skill-evals/deployhq/run-evals.sh
# Run one category
./skill-evals/deployhq/run-evals.sh --category deployments
# Test a specific model
./skill-evals/deployhq/run-evals.sh --model claude-haiku-4-5-20251001dhq api covers all 144+ API endpoints:
dhq api GET /projects/my-app/environment_variables
dhq api POST /projects/my-app/config_files --body '{"config_file":{"path":".env","body":"KEY=val"}}'
dhq api DELETE /projects/my-app/excluded_files/abc123The SDK at pkg/sdk/ is a clean public interface:
import "github.com/deployhq/deployhq-cli/pkg/sdk"
client, _ := sdk.New("myco", "user@example.com", "api-key")
projects, _ := client.ListProjects(ctx)
dep, _ := client.CreateDeployment(ctx, "my-app", sdk.DeploymentCreateRequest{
Branch: "main",
})go build ./cmd/deployhq/
go test ./... -v
go vet ./...MIT
