---
title: Honeybadger CLI
description: Use the Honeybadger CLI for command-line access to check-ins, deployments, metrics collection, and data queries.
url: https://docs.honeybadger.io/tools/cli/
---

The [Honeybadger CLI](https://github.com/honeybadger-io/cli) gives you command-line access to the Honeybadger API for check-ins, deployments, metrics collection, and data queries. If you’ve been using our [MCP server](https://docs.honeybadger.io/tools/mcp/) to integrate Honeybadger with AI agents, the CLI offers a similar feature set for direct terminal use.

## Installation

The quickest way to install is via Homebrew:

```shell
brew install honeybadger-io/tap/honeybadger
```

You can also download binaries directly from the [GitHub releases page](https://github.com/honeybadger-io/cli/releases) or install with Go:

```shell
go install github.com/honeybadger-io/cli/cmd/hb@latest
```

This installs the `hb` command.

## Authentication

The CLI uses two types of credentials depending on which commands you’re running:

* **Project API key** — For Reporting API commands (`deploy`, `agent`). Find your key in your [project settings](https://app.honeybadger.io/).
* **Personal auth token** — For Data API commands (everything else). Find your token under the “Authentication” tab in your [user settings](https://app.honeybadger.io/users/edit#authentication).

You can provide credentials via environment variables, a configuration file, or command-line flags:

### Environment Variables

```shell
export HONEYBADGER_API_KEY=your-project-api-key       # For Reporting API
export HONEYBADGER_AUTH_TOKEN=your-personal-token     # For Data API
export HONEYBADGER_PROJECT_ID=12345                   # Optional, default project ID for Data API
export HONEYBADGER_ENDPOINT=https://eu-api.honeybadger.io  # Optional, for EU region
```

### Configuration File

Create a file at `~/.honeybadger-cli.yaml`:

```yaml
api_key: your-project-api-key
auth_token: your-personal-auth-token
project_id: 12345
endpoint: https://api.honeybadger.io
```

### Command-line Flags

* `--api-key` — Project API key (for Reporting API)
* `--auth-token` — Personal auth token (for Data API)
* `--project-id` — Default project ID for Data API commands
* `--endpoint` — API endpoint (default: `https://api.honeybadger.io`)
* `--config` — Path to configuration file

***

## Reporting API Commands

These commands use your project API key (`--api-key` or `HONEYBADGER_API_KEY`).

### agent

Start a metrics reporting agent that collects system metrics and reports them to [Honeybadger Insights](https://docs.honeybadger.io/guides/insights/).

```shell
hb agent --api-key PROJECT_API_KEY
```

Or with an environment variable:

```shell
export HONEYBADGER_API_KEY=PROJECT_API_KEY
hb agent
```

**Metrics collected:**

* **CPU** — Usage percentages and load averages
* **Memory** — Total, used, free, and available memory
* **Disk** — Usage for all mounted filesystems

**Optional flags:**

* `-i, --interval` — Reporting interval in seconds (default: `60`)
* `-t, --tag` — Tag in `key=value` format (repeatable)

**Tagging metrics:**

Add custom tags to annotate metrics with environment, role, or other metadata:

```shell
hb agent --tag environment=production --tag role=web-1
```

Tags appear as top-level fields on every metric event, so you can filter and group by them in [Insights](https://docs.honeybadger.io/guides/insights/) queries. You can also use `--tag host=custom-name` to override the default hostname.

Tags can also be set in the configuration file:

```yaml
agent:
  tags:
    environment: production
    role: web-1
```

CLI flags take precedence over configuration file tags. Tag keys cannot collide with built-in metric field names (such as `event_type` or `used_percent`), with the exception of `host`.

See [Host metrics](https://docs.honeybadger.io/guides/insights/integrations/host-metrics/) for query examples and alternative collection methods.

### deploy

Report a deployment to Honeybadger.

```shell
hb deploy --environment production --repository github.com/org/repo --revision abc123 --user johndoe
```

**Required flags:**

* `-e, --environment` — Environment being deployed to (e.g., `production`)

**Optional flags:**

* `-r, --repository` — Repository being deployed
* `-v, --revision` — Revision or commit SHA being deployed
* `-u, --user` — Local username of the person deploying

### run

Run a command and report its status to Honeybadger’s [check-in API](https://docs.honeybadger.io/api/reporting-check-ins/). This wraps your command, captures its output and execution time, and reports the results.

```shell
hb run --id XyZZy -- /usr/local/bin/backup.sh
```

Or using a slug (requires API key):

```shell
hb run --slug daily-backup --api-key PROJECT_API_KEY -- pg_dump -U postgres mydb > backup.sql
```

The command will:

* Execute your command and stream its output in real-time
* Capture stdout, stderr, duration, and exit code
* Report success or error status to Honeybadger
* Exit with the same exit code as your command

**Required flags (one of):**

* `-i, --id` — Check-in ID to report
* `-s, --slug` — Check-in slug to report (requires API key)

Shell operators such as `>` are interpreted by your shell before `hb` runs, so redirection works as usual. If you need more complex shell features, wrap them in a shell script and invoke that script with `hb run`.

### check-in

Report a simple check-in to Honeybadger without running a command. Use this when you want to signal that a task completed successfully from your own scripts.

```shell
hb check-in --id XyZZy
```

Or using a slug (requires API key):

```shell
hb check-in --slug daily-backup --api-key PROJECT_API_KEY
```

**Required flags (one of):**

* `-i, --id` — Check-in ID to report
* `-s, --slug` — Check-in slug to report (requires API key)

See [Check-ins](https://docs.honeybadger.io/guides/check-ins/) for more information on setting up check-ins in Honeybadger.

***

## Data API Commands

These commands use your personal auth token (`--auth-token` or `HONEYBADGER_AUTH_TOKEN`). Most also require a project ID (`--project-id` or `HONEYBADGER_PROJECT_ID`).

| Command | Description |
| - | - |
| [accounts](https://docs.honeybadger.io/tools/cli/accounts/) | Manage accounts, users, and invitations |
| [alarms](https://docs.honeybadger.io/tools/cli/alarms/) | Manage Insights alarms |
| [check-ins](https://docs.honeybadger.io/tools/cli/check-ins/) | Manage check-ins for cron job monitoring |
| [comments](https://docs.honeybadger.io/tools/cli/comments/) | Manage comments on faults |
| [dashboards](https://docs.honeybadger.io/tools/cli/dashboards/) | Manage Insights dashboards |
| [deployments](https://docs.honeybadger.io/tools/cli/deployments/) | View and manage deployment history |
| [environments](https://docs.honeybadger.io/tools/cli/environments/) | Manage project environments |
| [faults](https://docs.honeybadger.io/tools/cli/faults/) | View and manage faults (errors) |
| [insights](https://docs.honeybadger.io/tools/cli/insights/) | Execute BadgerQL queries |
| [projects](https://docs.honeybadger.io/tools/cli/projects/) | Manage projects and view reports |
| [statuspages](https://docs.honeybadger.io/tools/cli/statuspages/) | Manage status pages |
| [streams](https://docs.honeybadger.io/tools/cli/streams/) | List Insights data streams |
| [teams](https://docs.honeybadger.io/tools/cli/teams/) | Manage teams and memberships |
| [uptime](https://docs.honeybadger.io/tools/cli/uptime/) | Manage uptime monitoring |

***

## Output Formats

Most commands support the `-o, --output` flag:

* `table` — Human-readable table format (default for list commands)
* `json` — JSON output for scripting and automation
* `text` — Plain text output (default for get commands)

## JSON Input

Commands that accept `--cli-input-json` can receive input as:

* Inline JSON: `--cli-input-json '{"key": "value"}'`
* File path: `--cli-input-json file:///path/to/file.json`

## Additional resources

* [Honeybadger CLI on GitHub](https://github.com/honeybadger-io/cli) — Source code and issue tracker
* [Honeybadger MCP server](https://docs.honeybadger.io/tools/mcp/) — Integrate Honeybadger with AI assistants
* [Honeybadger Terraform provider](https://docs.honeybadger.io/tools/terraform/) — Manage your Honeybadger configuration as code
* [Honeybadger API documentation](https://docs.honeybadger.io/api/) — REST API reference

---

## Try Honeybadger for FREE

Intelligent logging, error tracking, and Just Enough APM™ in one dev-friendly platform. Find and fix problems before users notice.

[Start free trial](https://app.honeybadger.io/users/sign_up)

[See plans and pricing](https://www.honeybadger.io/plans/)
