Airbrake Command Line Interface

We’ve just extended the Airbrake Gem to run from the command line. This make it easier to debug, create projects, raise exceptions and set deployments from the CLI.

You can use Airbrake from the command line, get the Airbrake Gem from Ruby Gems or from the Airbrake Repo.

$ airbrake raise --api-key 

This will raise RuntimeError with the message I’ve made a huge mistake by default. You can, of course, specify which exception class you want to raise.

$ airbrake raise -e PerlScriptError -m "Something went wrong with my perl script"
    -k 

You can save your api key in the environment if you’re annoyed by passing it as an argument, just set the AIRBRAKE_API_KEY. You can also use ENV[‘AIRBRAKE_API_KEY’] in your airbrake config block: config/initializers/airbrake.rb

Additionally, you can use this command line tool to list all your projects and find out corresponding ids and api-keys. Your AUTH_TOKEN is located by clicking the settings button when logged into Airbrake.

To do this, execute the following command:

$ airbrake list --auth-token  --account 

If you need any additional help about this tool and how to use it, please refer to help:

$ airbrake -h
Usage: airbrake [COMMAND] [OPTION]...
Commands:
  raise                          # Raise an exception specified by ERROR and MESSAGE.
  list                           # List all the projects for given AUTH_TOKEN and ACCOUNT.
  create                         # Create a project with the given NAME.
  deploy                         # Send a new deployment notification to a project that matches the API_KEY.

Options:
  -e, [--error=ERROR]            # Error class to raise. Default:  RuntimeError
  -m, [--message=MESSAGE]        # Error message. Default: "I've made a huge mistake"
  -k, [--api-key=API_KEY]        # Api key of your Airbrake application.
  -h, [--host=HOST]              # URL of the Airbrake API server. Default: api.airbrake.io
  -p, [--port=PORT]              # Port of the Airbrake API server. Default: 80
  -t, [--auth-token=AUTH_TOKEN]  # The auth token used for API requests.
  -a, [--account=ACCOUNT]        # The account used for API requests.
  -n, [--name=NAME]              # The name of the project you're trying to create.
  -E, [--rails-env=NAME]         # The name of the environment you're deploying to. Default: production
  -h, [--help]                   # Show this usage

Please create a GitHub issue if you have any problems with the command. Send any feature requests to

Monitor Your App Free for 30 Days

Discover the power of Airbrake by starting a free 30-day trial of Airbrake. Quick sign-up, no credit card required. Get started.