The DeployHQ CLI lets you configure automated deployment triggers, scheduled deployments, notification integrations, and network agents.

## Automatic Deployments

Automatic deployments trigger a deployment whenever changes are pushed to your repository.

### Listing Auto-Deploy Configuration

```bash
dhq auto-deploys list -p my-app
```

### Enabling Auto-Deploy for a Server

```bash
dhq auto-deploys enable -p my-app --server production
```

### Disabling Auto-Deploy

```bash
dhq auto-deploys enable -p my-app --server production --disable
```

## Scheduled Deployments

Scheduled deployments run on a recurring schedule (e.g., deploy to staging every night).

### Listing Scheduled Deployments

```bash
dhq scheduled-deploys list -p my-app
```

### Viewing a Scheduled Deployment

```bash
dhq scheduled-deploys show <id> -p my-app
```

### Creating a Scheduled Deployment

```bash
dhq scheduled-deploys create -p my-app \
  --server staging \
  --frequency daily
```

### Deleting a Scheduled Deployment

```bash
dhq scheduled-deploys delete <id> -p my-app
```

## Integrations

Integrations send notifications about deployments to external services (e.g., Slack, email, webhooks).

### Listing Integrations

```bash
dhq integrations list -p my-app
```

### Viewing an Integration

```bash
dhq integrations show <id> -p my-app
```

### Creating an Integration

```bash
dhq integrations create -p my-app \
  --type slack \
  --settings '{"webhook_url":"https://hooks.slack.com/services/..."}'
```

### Updating an Integration

```bash
dhq integrations update <id> -p my-app \
  --settings '{"webhook_url":"https://hooks.slack.com/services/new-url"}'
```

### Deleting an Integration

```bash
dhq integrations delete <id> -p my-app
```

## Network Agents

Network agents allow DeployHQ to deploy to servers behind firewalls. The agent runs on a server inside your network and creates an outbound connection to DeployHQ.

### Listing Agents

```bash
dhq agents list
```

### Creating an Agent

```bash
dhq agents create --name "Office Network" --zone eu
```

### Updating an Agent

```bash
dhq agents update <id> --name "New Office Network"
```

### Revoking Agent Credentials

If an agent's credentials are compromised, revoke them:

```bash
dhq agents revoke <id>
```

After revoking, you will need to reconfigure the agent with new credentials.

### Deleting an Agent

```bash
dhq agents delete <id>
```
