{
  "markdown": "# deployhq-cli\n\nDeployHQ from your terminal -- for humans and agents.\n\n[![Agent skill on skills.sh](https://skills.sh/b/deployhq/deployhq-cli)](https://skills.sh/deployhq/deployhq-cli)\n\n![dhq demo](assets/demo.gif)\n\n## Install\n\n### Homebrew (macOS/Linux)\n\n```bash\nbrew install deployhq/tap/dhq\n```\n\n### Script (macOS/Linux)\n\n```bash\ncurl -fsSL https://deployhq.com/install/cli | sh\n```\n\n### Scoop (Windows)\n\n```powershell\nscoop bucket add deployhq https://github.com/deployhq/scoop-bucket\nscoop install dhq\n```\n\n### Go\n\n```bash\ngo install github.com/deployhq/deployhq-cli/cmd/dhq@latest\n```\n\n### Binary\n\nDownload from [Releases](https://github.com/deployhq/deployhq-cli/releases) (Linux, macOS, Windows — amd64/arm64).\n\n### Updating\n\n```bash\ndhq update\n```\n\n### Install as an agent skill (skills.sh)\n\nAdd the DeployHQ skill to any supported AI agent (Claude Code, Cursor, Codex,\nGemini CLI, Copilot, and more) directly from this repo:\n\n```bash\nnpx skills add deployhq/deployhq-cli\n```\n\n(This is the cross-agent equivalent of `dhq skills install`, for users\ndiscovering DeployHQ through the skills.sh directory.)\n\n## Quick Start\n\n```bash\n# One command: detect the framework, provision DeployHQ hosting\n# (Static Hosting or a Managed VPS) and deploy — to a live URL.\ndhq launch\n\n# Guided setup (login or signup, pick a project, install the DeployHQ\n# skill into your AI coding agents, optional first deploy)\ndhq hello\n\n# Or step-by-step\ndhq signup\ndhq auth login\ndhq configure\n\n# Teach your detected AI coding agents (Claude Code, Cursor, Codex, …) to drive dhq\n# (project-scope agents like Copilot are opt-in — see `dhq skills install --agent`)\ndhq skills install\n\n# Deploy and watch in real-time\ndhq deploy -p my-app --wait\n\n# Check deployment logs\ndhq deployments logs <id> -p my-app\n\n# Open in browser\ndhq open my-app\n```\n\n## One-command deploy (`dhq launch`)\n\n`dhq launch` takes a project folder to a live URL on DeployHQ's own\ninfrastructure — **Static Hosting** (global CDN, Cloudflare-backed) or a\n**Managed VPS** (DeployHQ-provisioned) — in a single command. It detects your\nframework, provisions the target, deploys, and prints the URL.\n\n```bash\ndhq launch                    # interactive: detect, pick a target, deploy\ndhq launch --static --subdomain my-app\ndhq launch --vps --accept-cost --region lon1 --size s-1vcpu-1gb\n\n# Agents / CI — structured JSON, never prompts:\ndhq launch --static --json\ndhq launch --vps --dry-run --json   # preview cost + actions, no side effects\n```\n\nA Managed VPS is a managed resource — free for early customers during the beta,\nbilled monthly afterwards — so `--accept-cost` is required for non-interactive VPS\nprovisioning (`--yes` alone never provisions one). After the first run, `launch`\nwrites `.deployhq.toml` so subsequent deploys are just `dhq deploy`. See the\n[agent guide](skills/deployhq/references/launch.md) for the full flag set and the\nstructured-error reasons agents can branch on.\n\n## Authentication\n\n```bash\n# Interactive login (stores in OS keyring)\ndhq auth login\n\n# Environment variables (CI/agents — no login needed)\nexport DEPLOYHQ_API_KEY=your-api-key\nexport DEPLOYHQ_ACCOUNT=your-account\nexport DEPLOYHQ_EMAIL=your-email\n```\n\n## CI/CD (GitHub Actions)\n\nNo `dhq auth login` needed — set secrets and go:\n\n```yaml\n# .github/workflows/deploy.yml\nenv:\n  DEPLOYHQ_ACCOUNT: ${{ secrets.DEPLOYHQ_ACCOUNT }}\n  DEPLOYHQ_EMAIL: ${{ secrets.DEPLOYHQ_EMAIL }}\n  DEPLOYHQ_API_KEY: ${{ secrets.DEPLOYHQ_API_KEY }}\n  DEPLOYHQ_PROJECT: my-app\n\njobs:\n  deploy:\n    runs-on: ubuntu-latest\n    steps:\n      - run: curl -fsSL https://deployhq.com/install/cli | sh\n      - run: dhq deploy --server production --revision ${{ github.sha }} --wait --json\n```\n\nSee `examples/github-actions/` for complete workflows:\n- **deploy.yml** — Deploy on push to main with polling and failure logs\n- **deploy-multi-env.yml** — Staging on push, production on release, auto-rollback\n- **deploy-on-pr-merge.yml** — Deploy on PR merge with status comment on the PR\n\n## Commands\n\n```\ndhq projects      list | show | create | update | delete | star | insights | upload-key | badge\ndhq servers       list | show | create | update | delete | reset-host-key\n                  protocols: ssh, ftp, ftps, rsync, s3, s3_compatible, digitalocean,\n                             hetzner_cloud, heroku, netlify, shopify,\n                             static_hosting (beta), managed_vps (beta)\ndhq server-groups list | show | create | update | delete\ndhq deployments   list | show | create | abort | rollback | logs | watch\ndhq repos         show | create | update | branches | commits | commit-info | latest-revision\ndhq deploy        [-p project] [-s server] [--wait] (deploy with live progress)\ndhq retry         <deployment-id> -p <project>\ndhq rollback      <deployment-id> -p <project>\ndhq insights      [project] (deployment insights: totals, success rate, duration)\ndhq test-access   [-p project] [-s server] [--wait] (test repo + server connectivity)\ndhq open          [project] (open DeployHQ in browser)\ndhq hello         (guided onboarding: login/signup + project setup)\ndhq init          (interactive project setup wizard)\ndhq api           GET|POST|PUT|PATCH|DELETE <path> (escape hatch)\ndhq auth          login | logout | status | token\ndhq signup        (create a new DeployHQ account)\ndhq config        show | init | set | unset\ndhq configure     (interactive setup wizard)\ndhq commands      (full catalog as JSON for agents)\ndhq show <url>    (show any DeployHQ resource by URL)\ndhq env-vars      list | show | create | update | delete\ndhq config-files  list | show | create | update | delete\ndhq build-commands list | create | update | delete\ndhq build-configs list | show | default | create | update | delete\ndhq ssh-commands  list | show | create | update | delete\ndhq deployment-checks list | show | create | update | delete\ndhq excluded-files list | show | create | update | delete\ndhq integrations list | show | create | update | delete\ndhq templates     list | show | public | public-show | create | update | delete\ndhq agents        list | create | update | delete | revoke\ndhq ssh-keys      list | create | delete\ndhq global-servers list | show | create | update | delete | copy-to-project\ndhq global-env-vars list | show | create | update | delete\ndhq global-config-files list | show | create | update | delete\ndhq build-cache-files list | create | update | delete\ndhq build-languages set <language-id> --version <ver> [-p project]\ndhq build-known-hosts list | create | delete\ndhq auto-deploys list | enable\ndhq scheduled-deploys list | show | create | update | delete\ndhq activity      list | stats\ndhq status        (quick dashboard across all projects)\ndhq assist        [question] (AI deployment assistant, requires Ollama)\ndhq completion    bash | zsh | fish | powershell\ndhq doctor        (health check)\ndhq update        (self-update to latest version)\ndhq skills        list | install (auto-detect AI agents and install the DeployHQ skill)\ndhq setup         claude | codex | cursor | windsurf (deprecated — use 'dhq skills')\ndhq mcp           (start MCP server in stdio mode)\n```\n\n## Deploy with Live Progress\n\n```bash\n# Deploy and watch steps in real-time (TUI in interactive terminals)\ndhq deploy -p my-app -s production --wait\n\n# Server names are fuzzy-matched\ndhq deploy -p my-app -s fedora --wait\n\n# Watch an existing deployment\ndhq deployments watch <id> -p my-app\n```\n\nOn failure, logs are shown automatically with suggested next commands.\n\n## AI Assistant\n\nGet AI-powered help for your deployments using a local LLM. All data stays on your machine.\n\nIf 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](https://ollama.com), without relying on an external coding agent.\n\n```bash\n# One-time setup (installs Ollama + downloads model)\ndhq assist --setup\n\n# Ask questions about your deployments\ndhq assist \"why did my deploy fail?\" -p my-app\ndhq assist \"what should I do?\" -p my-app\ndhq assist \"what does transfer_files do?\"\n\n# Check status\ndhq assist --status\n```\n\nRequires [Ollama](https://ollama.com) running locally. Default model: `qwen2.5:3b` (~2GB).\n\n## JSON Output\n\nAll commands support `--json` for machine-readable output:\n\n```bash\n# Full JSON\ndhq projects list --json\n\n# Selected fields\ndhq projects list --json name,permalink,zone\n\n# Pipe to jq\ndhq deployments show abc123 -p my-app --json | jq '.data.status'\n```\n\nJSON responses include breadcrumbs with suggested next commands:\n\n```json\n{\n  \"ok\": true,\n  \"data\": { ... },\n  \"summary\": \"Deployment abc123 completed\",\n  \"breadcrumbs\": [\n    {\"action\": \"logs\", \"cmd\": \"dhq deployments logs abc123 -p my-app\"},\n    {\"action\": \"rollback\", \"cmd\": \"dhq rollback abc123 -p my-app\"}\n  ]\n}\n```\n\n## Shell Completions\n\n```bash\n# Zsh (add to ~/.zshrc)\nsource <(dhq completion zsh)\n\n# Bash (add to ~/.bashrc)\nsource <(dhq completion bash)\n\n# Fish\ndhq completion fish | source\n```\n\nCompletions include dynamic project and server name suggestions for `--project`, `show`, `open`, and server commands.\n\n## Configuration\n\n4 layers (highest to lowest precedence):\n\n1. CLI flags (`--account`, `--project`)\n2. Environment variables (`DEPLOYHQ_ACCOUNT`, `DEPLOYHQ_PROJECT`)\n3. Project config (`.deployhq.toml` in current directory)\n4. Global config (`~/.deployhq/config.toml`)\n\n```bash\n# Interactive setup (recommended)\ndhq configure\n\n# Or manual\ndhq config init\ndhq config set project my-app\ndhq config show --resolved\n```\n\n## Agent Integration\n\nThe CLI is designed for AI agents that can run shell commands.\n\n### Install the DeployHQ skill into your agents\n\n`dhq skills install` detects the AI coding agents on your machine and installs\nthe DeployHQ skill into each one's native format, so the agent knows how to\ndrive `dhq`. It's also offered automatically during `dhq hello`.\n\n```bash\n# Detect installed agents and show their skill status\ndhq skills list\n\n# Install for every detected user-scope agent (Claude Code, Cursor, …)\ndhq skills install\n\n# Install for a specific agent (use the name from `dhq skills list`)\ndhq skills install --agent claude-code\n\n# Project-scope agents write into the current repo, so they're opt-in:\ndhq skills install --agent copilot\n```\n\nTwelve agents are supported — Aider, Antigravity, Claude Code, Cline, Codex CLI,\nContinue.dev, Cursor, Gemini CLI, GitHub Copilot, Kiro CLI, OpenCode, and Windsurf.\n**User-scope** agents install into your home directory and are picked up by the\nbare `dhq skills install`; **project-scope** agents write into the current\nrepository and require an explicit `--agent` flag so login never mutates a repo\nas a side effect.\n\n> **Deprecated:** `dhq setup <agent>` (Claude Code, Codex, Cursor, Windsurf) is\n> the older, narrower predecessor of `dhq skills install`. It still works but\n> warns on use and will be removed in a future release — prefer `dhq skills`.\n\n### Other agent helpers\n\n```bash\n# Full command catalog with agent safety metadata\ndhq commands --json\n\n# Agent-optimized workflow\nDEPLOYHQ_AGENT=my-bot dhq deploy -p my-app --json\n```\n\nThe canonical agent skill lives at [`skills/deployhq/SKILL.md`](skills/deployhq/SKILL.md)\nand is what `dhq skills install` and `npx skills add deployhq/deployhq-cli` install.\n\n### Non-Interactive Mode\n\nUse `--non-interactive` to guarantee the CLI never prompts. Auto-enabled when output is piped.\n\n```bash\n# Explicit strict mode — errors instead of prompting\ndhq deploy -p my-app --non-interactive --json\n\n# Piped output auto-enables non-interactive\ndhq deploy -p my-app --json | jq .\n```\n\n### Agent Metadata\n\n`dhq commands --json` includes per-command safety metadata:\n\n```json\n{\n  \"agent\": {\n    \"interactive\": false,\n    \"destructive\": true,\n    \"idempotent\": false,\n    \"requires_confirmation\": true,\n    \"supports_json\": true,\n    \"safe_for_automation\": true,\n    \"resource_types\": [\"project\"]\n  }\n}\n```\n\nSet `DEPLOYHQ_OUTPUT_FILE` to capture all operations as JSONL:\n\n```bash\nexport DEPLOYHQ_OUTPUT_FILE=/tmp/deployhq.jsonl\ndhq deploy -p my-app\ncat /tmp/deployhq.jsonl\n```\n\n### Skill System\n\nThe `skills/deployhq/` directory contains structured reference docs that AI agents consume to correctly use the CLI:\n\n- `SKILL.md` — Entry point: auth, output contract, decision trees, gotchas\n- `references/` — 8 per-domain docs (projects, servers, deployments, repos, configuration, global resources, operations, auth/setup)\n\n### Skill Evals\n\n`skill-evals/deployhq/` contains 57 evaluation cases that test whether an LLM correctly translates natural language into `dhq` commands:\n\n```bash\n# Dry-run (no API calls)\n./skill-evals/deployhq/run-evals.sh --dry-run\n\n# Run all evals\nANTHROPIC_API_KEY=sk-... ./skill-evals/deployhq/run-evals.sh\n\n# Run one category\n./skill-evals/deployhq/run-evals.sh --category deployments\n\n# Test a specific model\n./skill-evals/deployhq/run-evals.sh --model claude-haiku-4-5-20251001\n```\n\n## Escape Hatch\n\n`dhq api` covers all 144+ API endpoints:\n\n```bash\ndhq api GET /projects/my-app/environment_variables\ndhq api POST /projects/my-app/config_files --body '{\"config_file\":{\"path\":\".env\",\"body\":\"KEY=val\"}}'\ndhq api DELETE /projects/my-app/excluded_files/abc123\n```\n\n## Go SDK\n\nThe SDK at `pkg/sdk/` is a clean public interface:\n\n```go\nimport \"github.com/deployhq/deployhq-cli/pkg/sdk\"\n\nclient, _ := sdk.New(\"myco\", \"user@example.com\", \"api-key\")\nprojects, _ := client.ListProjects(ctx)\ndep, _ := client.CreateDeployment(ctx, \"my-app\", sdk.DeploymentCreateRequest{\n    Branch: \"main\",\n})\n```\n\n## Development\n\n```bash\ngo build ./cmd/dhq/\ngo test ./... -v\ngo vet ./...\n```\n\n## License\n\nMIT\n",
  "bytes": 13766,
  "sha": "733bd81acea7008eb66a14d2f2499261a102da5d1349796a0104bbcf6651e4ee",
  "repo_slug": "deployhq/deployhq-cli",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_deployhq_deployhq_cli_deployhq_cli_1506027c/readme"
}