Skip to content

Install PromptArena

Learn how to install and set up PromptArena for testing LLM applications.

Section titled “Option 1: npm/npx (Recommended for JavaScript/TypeScript Projects)”

The easiest way to use PromptArena, especially if you’re working in a JavaScript/TypeScript environment:

Terminal window
# Use without installation (recommended for trying it out)
npx @altairalabs/promptarena run -c config.arena.yaml
# Install globally
npm install -g @altairalabs/promptarena
# Or add to your project as a dev dependency
npm install --save-dev @altairalabs/promptarena

Benefits:

  • No Go toolchain required
  • Works with npm, yarn, and pnpm
  • Easy integration with package.json scripts
  • Automatic platform detection

Add to your package.json:

{
"scripts": {
"test:prompts": "promptarena run -c ./tests/config.arena.yaml",
"test:watch": "promptarena run -c ./tests/config.arena.yaml --watch"
},
"devDependencies": {
"@altairalabs/promptarena": "^0.0.1"
}
}
Terminal window
# Install PromptKit (includes PromptArena)
brew install promptkit
# Verify installation
promptarena --version
Terminal window
# Install directly with Go
go install github.com/altairalabs/promptkit/tools/arena@latest
# The binary will be in your $GOPATH/bin
promptarena --version

Visit the PromptKit Releases page and download the appropriate binary for your platform.

Terminal window
# Example for macOS (adjust version and platform as needed)
curl -LO https://github.com/AltairaLabs/PromptKit/releases/latest/download/promptarena-darwin-amd64
chmod +x promptarena-darwin-amd64
sudo mv promptarena-darwin-amd64 /usr/local/bin/promptarena
Terminal window
# Clone the repository
git clone https://github.com/AltairaLabs/PromptKit.git
cd PromptKit
# Build and install
make install-arena
Terminal window
# Check that Arena is installed
promptarena --help
# Should display command usage and available commands

Enable tab completion for commands, flags, and dynamic values:

Terminal window
# Bash
promptarena completion bash > ~/.local/share/bash-completion/completions/promptarena
# Zsh
promptarena completion zsh > ~/.zsh/completions/_promptarena
# Fish
promptarena completion fish > ~/.config/fish/completions/promptarena.fish

See Configure Shell Completions for detailed setup instructions.

After installation, use the project generator to get started instantly:

Terminal window
# Create a new test project with guided setup
promptarena init my-llm-tests
# Or use quick mode with defaults
promptarena init my-llm-tests --quick --provider mock
# Navigate to your project
cd my-llm-tests
# Run your first test
promptarena run

The init command creates everything you need:

  • Arena configuration (config.arena.yaml)
  • Provider setup (providers/)
  • Sample test scenario (scenarios/)
  • Prompt configuration (prompts/)
  • Environment variables (.env)
  • README with next steps

If you prefer to create files manually:

Terminal window
# Create a test directory
mkdir my-llm-tests
cd my-llm-tests
# Create a minimal config file
cat > config.arena.yaml << 'EOF'
apiVersion: promptkit.altairalabs.ai/v1alpha1
kind: Arena
metadata:
name: my-llm-tests
spec:
prompts:
- path: ./prompts
providers:
- path: ./providers
scenarios:
- path: ./scenarios
EOF

If promptarena is not found after go install:

Terminal window
# Ensure Go bin is in your PATH
export PATH=$PATH:$(go env GOPATH)/bin
# Add to your shell profile (~/.zshrc or ~/.bashrc)
echo 'export PATH=$PATH:$(go env GOPATH)/bin' >> ~/.zshrc
source ~/.zshrc
Terminal window
# Make the binary executable
chmod +x promptarena-*

Install Homebrew first:

Terminal window
# macOS/Linux
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"