Skip to content

Airbrake executable

shime edited this page Oct 27, 2012 · 1 revision

Airbrake comes packed in with the executable. You can use it to send notifications to Airbrake app from command line!

$ 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

Here are some usage examples:

  • sending new error to Airbrake app
$ airbrake raise -k YOUR_API_KEY
  • listing all of your projects
$ airbrake list -a YOUR_ACCOUNT -t YOUR_AUTH_TOKEN
  • creating projects
$ airbrake create -a YOUR_ACCOUNT -t YOUR_AUTH_TOKEN -n PROJECT_NAME
  • sending new deploy notification
$ airbrake deploy -k YOUR_API_KEY

Airbrake executable will also try to read necessary values from the ENV if they are not passed in. These are the values that the executable will try to read:

  • ENV["AIRBRAKE_API_KEY"]
  • ENV["AIRBRAKE_AUTH_TOKEN"]
  • ENV["AIRBRAKE_ACCOUNT"]
  • ENV["RAILS_ENV"]

It will also fallback to the config file placed relatively from the current directory in config/initializers/airbrake.rb.