Git Product home page Git Product logo

airbrake-cli's Introduction

Airbrake CLI

The official command-line tool to interact with Airbrake.io.

Contents

Installation

Homebrew (MacOS)

brew install airbrake/airbrake-cli/airbrake
airbrake --version

Manual install on MacOS

To install the Airbrake CLI manually on MacOS, find and download the latest .tar.gz file for the appropriate Mac architecture from https://github.com/airbrake/airbrake-cli/releases. Extract the CLI binary from the archive and install it to /usr/local/bin with this command:

tar xvzf airbrake*.tar.gz -C /usr/local/bin
airbrake --version

If desired, change the directory in the command above to extract the file to another location, e.g. somewhere on your $PATH.

Linux

To install the Airbrake CLI on Linux, find and download the latest .tar.gz file for Linux from https://github.com/airbrake/airbrake-cli/releases. Extract the CLI binary from the archive and install it to /usr/local/bin with this command:

tar xvzf airbrake*.tar.gz -C /usr/local/bin
airbrake --version

If desired, change the directory in the command above to extract the file to another location, e.g. somewhere on your $PATH.

Authentication

Login command

Note: the login command requires username and password and does not support two-factor authentication. For alternative authentication methods (eg: in cases where GitHub logins, SSO, or two-factor authentication are used), please use the config command or global flags.

Log in with the Airbrake CLI by issuing the following command:

airbrake login

The login command will prompt you for your email, password, and an optional subdomain (account subdomains are used to differentiate if you have multiple Airbrake accounts using the same email address).

Enter your email: [email protected]
Enter your password:
Enter your subdomain (optional):
Done! The Airbrake CLI is configured for [email protected]

Completing the login command will generate a file in $HOME/.airbrake.yaml with contents like:

project-key: ""
user-key: ""
user-token: YOUR_USER_TOKEN

Config command

If your account requires GitHub or SSO logins, or you have you two-factor authentication enabled, you cannot authenticate with the login command. To authenticate in this situation, you can set credentials using the airbrake config set command. To set your user key (which can be retreived from your profile settings page) with the config set command, invoke:

airbrake config set user-key YOUR_USER_KEY_HERE

To check the values the Airbrake CLI is using, invoke:

airbrake config show

Global flags

Alternative to the login and config commands, you may specify the --user-key flag to the Airbrake CLI. The following are global flags for the airbrake command:

Flags:
      --config string        config file (default is $HOME/.airbrake.yaml)
      --project-key string   Project key used to access the API
      --user-key string      User key used to access the API

Commands

Install command

The Airbrake CLI offers an installation command which supports Ruby, Rails, Go, C#, Java, JavaScript, PHP, Python, Swift, and TypeScript via the install command:

# Use the --project-id flag if you already have an Airbrake project in
# your account you want to use
airbrake install --project-id 12345

# Or have the install command create a new Airbrake project:
airbrake install --create-project=DESIRED_PROJECT_NAME

Projects list command

This short example will show you how to send a test error notice to an Airbrake project with some basic commands.

Before we send the test error notice, we need to get the id of the project we want to send the notice to. To do this, invoke:

airbrake projects list

We'll be using the id field from the project list output in the next command.

Notices create command

Quickly create an error notice using the notices create command. Use the project ID you found when you listed your projects above.

airbrake notices create --project-id YOUR_PROJECT_ID \
    --type "Sample Error" \
    --message "My first error from the CLI"

This will send an error notice to the project you specified and provide you a direct link.

Going further

For information on all the available commands like deploys and more, invoke:

airbrake --help

airbrake-cli's People

Contributors

scottsbaldwin avatar sgray avatar thompiler avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.