Junie CLI
Using AIRouter24 with JetBrains Junie CLI
AIRouter24 adaptation
reviewVerify that the target tool supports custom OpenAI-compatible base URLs before relying on every setting.
Using Junie CLI with AIRouter24
Junie CLI is an agentic coding tool by JetBrains that provides an interactive terminal interface for developers to review, write, and modify code. By connecting Junie to AIRouter24, you can access hundreds of AI models from a single API key instead of managing separate keys for each provider.
Why Use AIRouter24 with Junie?
- Access to hundreds of models -- Use models from Anthropic, OpenAI, Google, xAI, Meta, and many more through a single API key
- Provider failover -- If one provider is unavailable or rate-limited, AIRouter24 automatically routes to another
- Centralized billing -- Track and manage spending across all models from your AIRouter24 dashboard
- Team controls -- Set budgets and monitor usage across your organization
Prerequisites
- Junie CLI installed (see Step 1 below)
- An AIRouter24 API key
Step 1: Install Junie CLI
Linux / macOS
curl -fsSL https://junie.jetbrains.com/install.sh | bashWindows
powershell -NoProfile -ExecutionPolicy Bypass -Command "iex (irm 'https://junie.jetbrains.com/install.ps1')"
Homebrew
brew tap jetbrains-junie/junie
brew update
brew install junieVerify the installation:
junie --versionStep 2: Configure AIRouter24
Junie supports AIRouter24 as a built-in BYOK (Bring Your Own Key) provider. Set the AIROUTER24_API_KEY environment variable to connect Junie to AIRouter24:
Shell Profile (Recommended)
Add the environment variable to your shell profile for persistent configuration:
# Open your shell profile
nano ~/.zshrc # or ~/.bashrc for Bash users
# Add this line:
export AIROUTER24_API_KEY="<your-airouter24-api-key>"After saving, restart your terminal or run source ~/.zshrc for changes to take effect.
Inline
You can also pass the API key directly when running Junie:
junie --airouter24-api-key "<your-airouter24-api-key>"CI/CD
In CI/CD pipelines, set the environment variable in your runner configuration:
export AIROUTER24_API_KEY="<your-airouter24-api-key>"
junie "Review and fix any code quality issues in the latest commit"Note: Replace
<your-airouter24-api-key>with your actual AIRouter24 API key from the API Keys page. Keys start withsk-.
Step 3: Start Coding
Navigate to your project directory and start Junie:
cd /path/to/your/project
junieType your prompt in the interactive CLI:
> give me an overview of this codebaseUse @ to attach files or folders to the request context, and type / to see available slash commands.
Headless Mode (CI/CD)
Junie supports a headless mode for non-interactive use in CI/CD pipelines. Combined with AIRouter24, this gives you centralized billing and model access for automated coding tasks:
# Install Junie CLI
curl -fsSL https://junie.jetbrains.com/install.sh | bash
# Run Junie with AIRouter24 in headless mode
export AIROUTER24_API_KEY="$AIROUTER24_API_KEY"
junie "Review and fix any code quality issues in the latest commit"GitHub Actions Example
name: Code Review
on:
pull_request:
types: [opened, synchronize]
jobs:
review:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
issues: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: JetBrains/junie-github-action@v0
with:
airouter24_api_key: ${{ secrets.AIROUTER24_API_KEY }}
prompt: "code-review"GitLab CI/CD Example
Follow the
setup instructions
to configure the Junie Workspace project, then add
AIROUTER24_API_KEY as a CI/CD variable. Once
set up, trigger reviews by commenting on any MR:
#junie code-reviewVerify Your Connection
After starting a session, check the AIRouter24 Activity Dashboard to confirm your requests are being routed through AIRouter24.
Learn More
- Junie CLI Documentation: junie.jetbrains.com/docs
- Junie Environment Variables: Environment Variables Reference
- AIRouter24 Quick Start: Getting Started with AIRouter24
- Available Models: Browse AIRouter24 Models