Getting started Community Training Tutorials Documentation APIs, AI & Tools
java -version
The Blackbox Automated Testing (BAT) CLI wrapper is a command line wrapper that you install to execute API tests.
Before installing BAT CLI, ensure that Java 17 is installed:
java -version
Install Windows Subsystem for Linux (WSL)
The instructions are at https://learn.microsoft.com/en-us/windows/wsl/install.
Install Java 17, curl, and the application "unzip" into the Linux distribution that you installed in your WSL.
Ensure that the JAVA_HOME variable in your environment is set to the location of your Java installation.
Add the bat executable to your PATH environment variable:
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
Add the following line to the end of the file and then save the file:
export PATH=$PATH:~/.bat/bat/bin
You can install BAT CLI on Linux, macOS, and Windows.
Download the BAT CLI ZIP file and save it in your Downloads directory.
Open a terminal and run the following command to install BAT CLI:
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.
Add BAT CLI to your PATH.
Identify your default shell:
basename "$SHELL"
If the command displays zsh, run:
echo 'export PATH="$HOME/.bat/bat/bin:$PATH"' >> "$HOME/.zshrc"
. "$HOME/.zshrc"
If the command displays bash, run:
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.
Run the following command to verify that BAT CLI is installed:
bat --version
The installation is successful if the command displays the BAT CLI version.
Click here to automatically download the ZIP file of the BAT wrapper for Windows.
Unzip the ZIP file to install BAT CLI in your Windows environment.
Run the command bat -version to verify that BAT CLI is installed.