---
schema_version: "1"
id: 63657b683614862e572fe47a7c13afe448574848ecfde869a30470e3621aa8f3
title: Installing BAT
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/api-functional-monitoring/bat-install-task.md
canonical_url: https://docs.mulesoft.com/api-functional-monitoring/bat-install-task
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 720b3f3ee7e3c0a16bbfe756f27862fd342b830c1bd58797e4dd448c9c2e6657
description: MuleSoft Documentation Site
latest: true
---
---
product: API Functional Monitoring
---

# Installing BAT

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

The Blackbox Automated Testing (BAT) CLI wrapper is a command line wrapper that you install to
execute API tests.

## Prerequisite for Linux and macOS Systems

Before installing BAT CLI, ensure that Java 17 is installed:

```shell
java -version
```

## Prerequisites for Windows 10 Systems

1.  Install Windows Subsystem for Linux (WSL)

    The instructions are at
    [https://learn.microsoft.com/en-us/windows/wsl/install](https://learn.microsoft.com/en-us/windows/wsl/install).

2.  Install Java 17, curl, and the application "unzip" into the Linux distribution that you
    installed in your WSL.

3.  Ensure that the `JAVA_HOME` variable in your environment is set to the location of your Java
    installation.

4.  Add the `bat` executable to your `PATH` environment variable:

    1.  Open the `~/.bashrc` file (if you are using `bash`) or the `~/.zshrc` file (if you are using
        `zsh`) for editing. For example, to use the `vi` editor, enter either of these commands:

        `vi ~/.bashrc`

        `vi ~/.zshrc`

    2.  Add the following line to the end of the file and then save the file:

        `export PATH=$PATH:~/.bat/bat/bin`

## Install BAT

You can install BAT CLI on Linux, macOS, and Windows.

### Linux and macOS Systems

1.  [Download the BAT CLI ZIP file](https://repository-master.mulesoft.org/nexus/content/repositories/releases/com/mulesoft/bat/bat-wrapper/1.1.14/bat-wrapper-1.1.14.zip)
    and save it in your `Downloads` directory.

2.  Open a terminal and run the following command to install BAT CLI:

    ```shell
    BAT_ZIP="$(ls -t "$HOME"/Downloads/bat-wrapper*.zip 2>/dev/null | head -n 1)"
    if [ -z "$BAT_ZIP" ]; then
      echo "BAT CLI ZIP file was not found in the Downloads directory."
    else
      mkdir -p "$HOME/.bat"
      unzip -o "$BAT_ZIP" -d "$HOME/.bat"
      chmod +x "$HOME/.bat/bat/bin/bat"
    fi
    ```

    The command selects the most recently downloaded BAT CLI ZIP file and installs it under
    `$HOME/.bat`.

3.  Add BAT CLI to your `PATH`.

    Identify your default shell:

    ```shell
    basename "$SHELL"
    ```

    - If the command displays `zsh`, run:

      ```shell
      echo 'export PATH="$HOME/.bat/bat/bin:$PATH"' >> "$HOME/.zshrc"
      . "$HOME/.zshrc"
      ```

    - If the command displays `bash`, run:

      ```shell
      echo 'export PATH="$HOME/.bat/bat/bin:$PATH"' >> "$HOME/.bashrc"
      . "$HOME/.bashrc"
      ```

    - If a different shell is displayed, add `$HOME/.bat/bat/bin` to the startup file used by that
      shell.

4.  Run the following command to verify that BAT CLI is installed:

    ```shell
    bat --version
    ```

    The installation is successful if the command displays the BAT CLI version.

### Windows

1.  Click
    [here](https://repository-master.mulesoft.org/nexus/content/repositories/releases/com/mulesoft/bat/bat-wrapper/1.1.14/bat-wrapper-1.1.14.zip)
    to automatically download the ZIP file of the BAT wrapper for Windows.

2.  Unzip the ZIP file to install BAT CLI in your Windows environment.

3.  Run the command `bat -version` to verify that BAT CLI is installed.

## What to Do Next

You can now start creating a test suite.

## See Also

- [Starting a New Test Suite](https://docs.mulesoft.com/api-functional-monitoring/bat-start-new-project)

- [BAT Command Reference](https://docs.mulesoft.com/api-functional-monitoring/bat-command-reference)
