This is a complete reference of all `dhq` commands, flags, and environment variables. For workflow-oriented guides, see the other articles in this section.

## Global Flags

These flags are available on all commands:

| Flag | Description |
|------|-------------|
| `--account` | DeployHQ account subdomain |
| `--email` | Authentication email |
| `--api-key` | API key |
| `--project`, `-p` | Project permalink |
| `--json` | Output as JSON (optionally specify fields: `--json name,status`) |
| `--non-interactive` | Never prompt; error on ambiguity (auto-enabled when piped) |
| `--cwd`, `-C` | Change working directory before running |
| `--help`, `-h` | Show help for any command |

## Environment Variables

| Variable | Description |
|----------|-------------|
| `DEPLOYHQ_ACCOUNT` | Account subdomain |
| `DEPLOYHQ_EMAIL` | Login email |
| `DEPLOYHQ_API_KEY` | API key |
| `DEPLOYHQ_PROJECT` | Default project permalink |
| `DEPLOYHQ_AGENT` | Agent identifier (for automation) |
| `DEPLOYHQ_OUTPUT_FILE` | Path for JSONL operation log |

## Shortcut Commands

| Command | Subcommands | Description | Guide |
|---------|-------------|-------------|-------|
| `dhq hello` | -- | Guided onboarding wizard | [Installation](https://www.deployhq.com/support/cli/cli-installation) |
| `dhq deploy` | -- | Deploy with live progress | [Deploying](https://www.deployhq.com/support/cli/cli-deploying) |
| `dhq rollback` | -- | Rollback a deployment | [Deploying](https://www.deployhq.com/support/cli/cli-deploying) |
| `dhq retry` | -- | Retry a failed deployment | [Deploying](https://www.deployhq.com/support/cli/cli-deploying) |
| `dhq test-access` | -- | Test repo and server connectivity | [Deploying](https://www.deployhq.com/support/cli/cli-deploying) |
| `dhq init` | -- | Interactive project setup wizard | [Configuration](https://www.deployhq.com/support/cli/cli-configuration) |
| `dhq insights` | -- | Deployment insights and stats | [Utilities](https://www.deployhq.com/support/cli/cli-utilities) |
| `dhq open` | -- | Open DeployHQ in browser | [Utilities](https://www.deployhq.com/support/cli/cli-utilities) |
| `dhq status` | -- | Quick deployment dashboard | [Utilities](https://www.deployhq.com/support/cli/cli-utilities) |

## Resource Commands

| Command | Subcommands | Description | Guide |
|---------|-------------|-------------|-------|
| `dhq projects` | `list`, `show`, `create`, `update`, `delete`, `star`, `insights`, `upload-key`, `badge` | Manage projects | [Projects](https://www.deployhq.com/support/cli/cli-projects) |
| `dhq servers` | `list`, `show`, `create`, `update`, `delete`, `reset-host-key` | Manage servers | [Servers](https://www.deployhq.com/support/cli/cli-servers) |
| `dhq server-groups` | `list`, `show`, `create`, `update`, `delete` | Manage server groups | [Servers](https://www.deployhq.com/support/cli/cli-servers) |
| `dhq deployments` | `list`, `show`, `create`, `abort`, `rollback`, `retry`, `logs`, `watch` | Manage deployments | [Deploying](https://www.deployhq.com/support/cli/cli-deploying) |
| `dhq repos` | `show`, `create`, `update`, `branches`, `commits`, `commit-info`, `latest-revision` | Manage repositories | [Projects](https://www.deployhq.com/support/cli/cli-projects) |
| `dhq env-vars` | `list`, `show`, `create`, `update`, `delete` | Project environment variables | [Build Pipeline](https://www.deployhq.com/support/cli/cli-build-pipeline) |
| `dhq global-env-vars` | `list`, `show`, `create`, `update`, `delete` | Account environment variables | [Build Pipeline](https://www.deployhq.com/support/cli/cli-build-pipeline) |
| `dhq config-files` | `list`, `show`, `create`, `update`, `delete` | Manage config files | [Build Pipeline](https://www.deployhq.com/support/cli/cli-build-pipeline) |
| `dhq build-commands` | `list`, `create`, `update`, `delete` | Manage build commands | [Build Pipeline](https://www.deployhq.com/support/cli/cli-build-pipeline) |
| `dhq build-configs` | `list`, `show`, `default`, `create`, `update`, `delete` | Build configurations | [Build Pipeline](https://www.deployhq.com/support/cli/cli-build-pipeline) |
| `dhq language-versions` | `list` | Available build language versions | [Build Pipeline](https://www.deployhq.com/support/cli/cli-build-pipeline) |
| `dhq ssh-commands` | `list`, `show`, `create`, `update`, `delete` | Server SSH commands | [Build Pipeline](https://www.deployhq.com/support/cli/cli-build-pipeline) |
| `dhq excluded-files` | `list`, `show`, `create`, `update`, `delete` | Excluded file patterns | [Build Pipeline](https://www.deployhq.com/support/cli/cli-build-pipeline) |
| `dhq integrations` | `list`, `show`, `create`, `update`, `delete` | Notification integrations | [Automation](https://www.deployhq.com/support/cli/cli-automation) |
| `dhq agents` | `list`, `create`, `update`, `delete`, `revoke` | Network agents | [Automation](https://www.deployhq.com/support/cli/cli-automation) |
| `dhq auto-deploys` | `list`, `enable` | Automatic deployments | [Automation](https://www.deployhq.com/support/cli/cli-automation) |
| `dhq scheduled-deploys` | `list`, `show`, `create`, `update`, `delete` | Scheduled deployments | [Automation](https://www.deployhq.com/support/cli/cli-automation) |
| `dhq ssh-keys` | `list`, `create`, `delete` | Account SSH keys | [Utilities](https://www.deployhq.com/support/cli/cli-utilities) |
| `dhq global-servers` | `list`, `show`, `create`, `update`, `delete`, `copy-to-project` | Account server templates | [Servers](https://www.deployhq.com/support/cli/cli-servers) |
| `dhq global-config-files` | `list`, `show`, `create`, `update`, `delete` | Account config file templates | [Build Pipeline](https://www.deployhq.com/support/cli/cli-build-pipeline) |
| `dhq build-cache-files` | `list`, `create`, `update`, `delete` | Build cache files | [Build Pipeline](https://www.deployhq.com/support/cli/cli-build-pipeline) |
| `dhq build-languages` | `set` | Set build language version | [Build Pipeline](https://www.deployhq.com/support/cli/cli-build-pipeline) |
| `dhq build-known-hosts` | `list`, `create`, `delete` | Build SSH known hosts | [Build Pipeline](https://www.deployhq.com/support/cli/cli-build-pipeline) |
| `dhq templates` | `list`, `show`, `public`, `public-show`, `create`, `update`, `delete` | Project templates | [Utilities](https://www.deployhq.com/support/cli/cli-utilities) |
| `dhq zones` | `list` | Deployment zones | [Utilities](https://www.deployhq.com/support/cli/cli-utilities) |

## Authentication and Configuration

| Command | Subcommands | Description | Guide |
|---------|-------------|-------------|-------|
| `dhq auth` | `login`, `logout`, `status`, `token` | Manage credentials | [Authentication](https://www.deployhq.com/support/cli/cli-authentication) |
| `dhq config` | `show`, `init`, `set`, `unset` | Manage CLI configuration | [Configuration](https://www.deployhq.com/support/cli/cli-configuration) |
| `dhq configure` | -- | Interactive setup wizard | [Configuration](https://www.deployhq.com/support/cli/cli-configuration) |
| `dhq signup` | -- | Create a new account | [Utilities](https://www.deployhq.com/support/cli/cli-utilities) |

## AI and Agent Commands

| Command | Subcommands | Description | Guide |
|---------|-------------|-------------|-------|
| `dhq assist` | -- | AI deployment assistant | [AI & Agents](https://www.deployhq.com/support/cli/cli-ai-agents) |
| `dhq setup` | `claude`, `codex`, `cursor`, `windsurf` | Install agent plugins | [AI & Agents](https://www.deployhq.com/support/cli/cli-ai-agents) |
| `dhq mcp` | -- | Start MCP server | [AI & Agents](https://www.deployhq.com/support/cli/cli-ai-agents) |
| `dhq commands` | -- | Command catalog (JSON) | [AI & Agents](https://www.deployhq.com/support/cli/cli-ai-agents) |
| `dhq show` | -- | Show resource by URL | [AI & Agents](https://www.deployhq.com/support/cli/cli-ai-agents) |

## Utility Commands

| Command | Subcommands | Description | Guide |
|---------|-------------|-------------|-------|
| `dhq api` | -- | Raw API requests | [Scripting](https://www.deployhq.com/support/cli/cli-scripting) |
| `dhq activity` | `list`, `stats` | Account activity | [Utilities](https://www.deployhq.com/support/cli/cli-utilities) |
| `dhq completion` | `bash`, `zsh`, `fish`, `powershell` | Shell completions | [Utilities](https://www.deployhq.com/support/cli/cli-utilities) |
| `dhq doctor` | -- | Health check | [Utilities](https://www.deployhq.com/support/cli/cli-utilities) |
| `dhq update` | -- | Self-update | [Utilities](https://www.deployhq.com/support/cli/cli-utilities) |
| `dhq feedback` | -- | Send feedback | [Utilities](https://www.deployhq.com/support/cli/cli-utilities) |

## Command Aliases

Several commands have shorter aliases:

| Alias | Full command |
|-------|-------------|
| `project`, `proj` | `projects` |
| `server`, `srv` | `servers` |
| `sg` | `server-groups` |
| `deployment`, `dep` | `deployments` |
| `repo`, `repository` | `repos` |
| `env` | `env-vars` |
| `lv` | `language-versions` |
| `template`, `tmpl` | `templates` |

## Getting Help

```bash
# General help
dhq --help

# Command-specific help
dhq deploy --help
dhq projects --help
dhq deployments create --help
```
