The DeployHQ CLI lets you manage all aspects of your projects, from creation to repository configuration.

## Listing Projects

```bash
# List all projects (starred projects appear first)
dhq projects list

# JSON output
dhq projects list --json

# Selected fields only
dhq projects list --json name,permalink,zone
```

## Viewing Project Details

```bash
dhq projects show my-app
```

This displays the project name, repository URL, branch, zone, and other configuration details.

## Creating a Project

```bash
dhq projects create --name "My New App"

# With options
dhq projects create --name "My New App" --zone eu --template rails-template
```

## Updating a Project

```bash
dhq projects update -p my-app --name "My Renamed App"
```

## Deleting a Project

```bash
dhq projects delete -p my-app
```

## Starring Projects

Toggle a project's starred status. Starred projects appear first in listings:

```bash
dhq projects star -p my-app
```

## Project Insights

View deployment statistics and analytics for a project:

```bash
dhq projects insights -p my-app
```

## Uploading Deploy Keys

Upload your project's SSH public key to GitHub or GitLab:

```bash
dhq projects upload-key -p my-app
```

This simplifies the process of granting DeployHQ access to your repository.

## Deployment Badge

Generate a deployment status badge for your README:

```bash
dhq projects badge -p my-app
```

## Opening in Browser

Open the project dashboard in your default browser:

```bash
dhq open my-app
```

## Repository Management

View and manage the repository connected to your project.

### Viewing Repository Details

```bash
dhq repos show -p my-app
```

### Setting Up a Repository

```bash
dhq repos create -p my-app --scm-type git --url git@github.com:user/repo.git --branch main
```

### Updating Repository Settings

```bash
dhq repos update -p my-app --branch main
```

### Listing Branches

```bash
dhq repos branches -p my-app
```

### Viewing Recent Commits

```bash
dhq repos commits -p my-app
```

### Getting the Latest Revision

```bash
dhq repos latest-revision -p my-app
```

## Using Templates

Create a project from an existing template:

```bash
# List available templates
dhq templates list

# List public templates (optionally filtered by framework)
dhq templates public --framework rails

# Create a project from a template
dhq projects create --name "My App" --template my-template
```

See [Utilities](https://www.deployhq.com/support/cli/cli-utilities) for more on template management.
