Skip to content

Installation

Interact with Mayhem from your command line by installing the Mayhem CLI and connecting your account credentials. Let's quickly walk you through how to install the Mayhem CLI on your machine.

The Mayhem CLI for code testing is available to download for common platforms, such as:

  • macOS
  • Linux (64-bit)
  • Windows (64-bit)

Info

Check the Mayhem CLI Commands page for a complete list of actions you can perform with the Mayhem CLI.

Downloading and Installing the Mayhem CLI

Navigate to the Mayhem CLI Installation page and follow the instructions to download the Mayhem CLI for your corresponding operating system:

code-testing-cli-installation

After completing the installation, check to make sure your Mayhem CLI is properly installed by running the following:

$ mayhem --version
2.10.0rc16+a374eca

If you see a Mayhem version output similar to the above, then congratulations on downloading and installing the Mayhem CLI onto your machine!

Authenticating with the Mayhem Server

Before using the Mayhem CLI to start and manage runs, you are required to first authenticate your credentials with the Mayhem server. To do so, you must use the mayhem login command, which authenticates with the Mayhem server via the Mayhem host URL and user API token.

Before using the Mayhem CLI to start and manage runs, you are required to first authenticate your credentials with the Mayhem server. To do so, you must use the mayhem login command.

The mayhem login command serves two purposes:

  1. Authenticates with the Mayhem server via the Mayhem host URL and user API token.
  2. Logs into the private Mayhem Docker Registry located at the Mayhem host URL (attempts only if the docker CLI is available on the client machine).

    Tip

    Check out Uploading Docker Targets to a Docker Registry for more information on managing docker images in the Mayhem Docker Registry.

Once the mayhem login command has been copied, paste it into your terminal and run the command. You should see output similar to the following:

$ mayhem login <MAYHEM_HOST_URL> <USER_API_KEY>
Logged in successfully at '<MAYHEM_HOST_URL>:443' as '<USER>'.
Syncing default settings: /Users/andrew/.config/mayhem/mayhem.
$ mayhem login <MAYHEM_HOST_URL> <USER_API_KEY>
Logged in successfully at '<MAYHEM_HOST_URL>:443' as '<USER>'.
Syncing default settings: /Users/andrew/.config/mayhem/mayhem.
Logging into the Docker registry at <MAYHEM_HOST_URL>:5000
Successfully logged in to the remote Docker registry.

Nice job! You're ready to start your first run using the Mayhem CLI!