Deployhq-cli deployhq
install
source · Clone the upstream repo
git clone https://github.com/deployhq/deployhq-cli
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/deployhq/deployhq-cli "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/deployhq" ~/.claude/skills/deployhq-deployhq-cli-deployhq && rm -rf "$T"
manifest:
skills/deployhq/SKILL.mdsource content
DeployHQ CLI — Agent Skill Guide
Identity
DeployHQ is a deployment automation platform. The
dhq CLI (binary name: deployhq) manages projects, servers, deployments, and infrastructure via the DeployHQ REST API. Designed for both humans and AI agents.
Authentication
Three methods (checked in order):
- Environment variables (CI/agents):
+DEPLOYHQ_ACCOUNT
+DEPLOYHQ_EMAILDEPLOYHQ_API_KEY - Config files:
or~/.deployhq/config.toml
in project directory.deployhq.toml - Interactive login:
dhq auth login
Verify with:
dhq auth status
Output Contract
Critical rule: stdout is ALWAYS data (table or JSON). stderr is ALWAYS human messages.
- TTY mode: Table output with headers
- Piped/non-TTY: Auto-switches to JSON
: Force JSON output. Optionally select fields:--json--json name,status,identifier- Breadcrumbs: JSON responses include
array with suggested next commandsbreadcrumbs - Exit codes: 0 = success, non-zero = failure
Non-Interactive Guarantee
The CLI never prompts when all required flags are provided. For agent usage, always supply all required flags explicitly. The only interactive commands are
dhq init, dhq hello, and dhq auth login (when flags are omitted).
Command Groups
| Group | Description | Reference |
|---|---|---|
| projects | Create, list, update, delete projects | projects.md |
| servers | Manage deployment targets (SSH, FTP, S3, etc.) | servers.md |
| deployments | Create, monitor, rollback deployments | deployments.md |
| repos | Repository configuration, branches, commits | repos.md |
| configuration | Env vars, config files, build commands, exclusions, cache files, build languages, known hosts | configuration.md |
| global resources | Global servers, env vars, config files, SSH keys, templates | global-resources.md |
| operations | Activity, status, test-access, doctor | operations.md |
| auth & setup | Authentication, CLI config, agent setup | auth-setup.md |
Decision Trees
"Deploy code"
— find project permalinkdhq projects list --json
— find server identifierdhq servers list -p <project> --json
— create deploymentdhq deploy -p <project> -s <server> --json
— monitor progressdhq deployments watch <id> -p <project>
"Check what's deployed"
— recent deploymentsdhq deployments list -p <project> --json
— details + stepsdhq deployments show <id> -p <project> --json
"Something went wrong"
— read step logsdhq deployments logs <id> -p <project>
— rollback if neededdhq rollback <id> -p <project> --json
— abort if runningdhq deployments abort <id> -p <project>
"Set up a new project"
— create projectdhq projects create --name "My App" --json
— connect repodhq repos create -p <project> --scm-type git --url <repo-url> --json
— add serverdhq servers create -p <project> --name Production --protocol-type ssh --hostname <host> --username <user> --json
— first deploymentdhq deploy -p <project> --json
"Configure deployment"
— add env vardhq env-vars create -p <project> --name KEY --value val
— add config filedhq config-files create -p <project> --path .env --body "..." --json
— add exclusiondhq excluded-files create -p <project> --pattern "node_modules" --json
— add build stepdhq build-commands create -p <project> --name "Install" --command "npm install" --json
"Escape hatch (any API endpoint)"
dhq api GET /projects dhq api GET /projects/<permalink>/deployments dhq api POST /projects/<permalink>/deployments --body '{"deployment":{...}}'
Invariants
- Always use
for machine-readable output when scripting or in agent context--json - JSON responses include
with suggested next commands — use them for workflow chainingbreadcrumbs - Empty results return exit 0 with empty
array (not an error)data
covers all 144+ API endpoints not in the command treedhq api- Project flag (
/-p
) accepts permalink or identifier--project - Server flag (
/-s
) uses fuzzy matching: exact > normalized > substring--server - Config precedence: flags > env vars >
>.deployhq.toml~/.deployhq/config.toml
Gotchas
- Some API fields return strings OR numbers inconsistently (handled internally by
)FlexString
auto-fetches latest revision ifdhq deploy
is omitted--revision
blocks until deployment completes (usedhq deploy --wait
to cap)--timeout- Deployment
uses TUI in TTY mode, append-only in pipeswatch
prompts for value ifdhq env-vars create
is omitted (not agent-friendly — always pass--value
)--value
Triggers
- User mentions "deploy", "deployment", "release", "ship" → deployment workflow
- User mentions "server", "hosting", "target" → server management
- User mentions "rollback", "revert", "undo" → rollback workflow
- User mentions "environment variable", "env var", "config", "secret" → configuration
- User mentions "branch", "commit", "repository" → repo management
- User mentions "DeployHQ", "deployhq", "dhq" → general CLI usage