Skip to content

Latest commit

 

History

History
120 lines (79 loc) · 3.5 KB

README.md

File metadata and controls

120 lines (79 loc) · 3.5 KB

Honeybadger CLI

Test

A command-line interface for interacting with Honeybadger's Reporting API.

Installation

go install github.com/honeybadger-io/cli@latest

Configuration

The CLI can be configured using either command-line flags, environment variables, or a configuration file.

Configuration File

By default, the CLI looks for a configuration file at config/honeybadger.yml in the current directory. You can specify a different configuration file using the --config flag.

Example configuration file:

api_key: your-api-key-here
endpoint: https://api.honeybadger.io  # Optional, use https://eu-api.honeybadger.io for EU region

Environment Variables

You can set configuration using environment variables prefixed with HONEYBADGER_:

export HONEYBADGER_API_KEY=your-api-key-here
export HONEYBADGER_ENDPOINT=https://eu-api.honeybadger.io  # Optional, for EU region

Command-line Flags

Global flags that apply to all commands:

  • --api-key: Your Honeybadger API key
  • --endpoint: Honeybadger endpoint (default: https://api.honeybadger.io)
  • --config: Path to configuration file

Usage

Deploy Command

Report a deployment to Honeybadger:

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 being deployed
  • -u, --user: Local username of the person deploying

Agent Command

Start a metrics reporting agent that collects and sends system metrics to Honeybadger Insights:

hb agent

The agent collects and reports the following metrics:

  • CPU usage and load averages
  • Memory usage (total, used, free, available)
  • Disk usage for all mounted filesystems

Optional flags:

  • --interval: Reporting interval in seconds (default: 60)

Development

Pull requests are welcome. If you're adding a new feature, please submit an issue as a preliminary step; that way you can be (moderately) sure that your pull request will be accepted.

When adding or changing functionality, please also add or update corresponding tests.

To run tests locally:

go test ./...

To contribute your code:

  1. Fork it.
  2. Create a topic branch git checkout -b my_branch
  3. Make your changes and add an entry to the CHANGELOG.
  4. Commit your changes git commit -am "Boom"
  5. Push to your branch git push origin my_branch
  6. Send a pull request

Releasing

To publish a new release:

  1. Create and push a new tag with the version number:

    git tag v1.0.0
    git push origin v1.0.0
  2. The release workflow will automatically:

    • Build binaries for multiple platforms (Linux, macOS, Windows)
    • Create a GitHub release with the binaries
    • Generate a changelog from commit messages

    The binaries will be available for download from the GitHub releases page.

Note: Commits with messages containing [skip ci] will skip the test workflow, but the release workflow will still run when a tag is pushed.

License

MIT License. See the LICENSE file in this repository for details.