Junie CLI

Using AutoDo with JetBrains Junie CLI

AutoDo adaptation

review

Verify that the target tool supports custom OpenAI-compatible base URLs before relying on every setting.

Using Junie CLI with AutoDo

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 AutoDo, you can access hundreds of AI models from a single API key instead of managing separate keys for each provider.

Why Use AutoDo 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, AutoDo automatically routes to another
  • Centralized billing -- Track and manage spending across all models from your AutoDo dashboard
  • Team controls -- Set budgets and monitor usage across your organization

Prerequisites

Step 1: Install Junie CLI

Linux / macOS

```bash
curl -fsSL https://junie.jetbrains.com/install.sh | bash
```

Windows

```powershell
powershell -NoProfile -ExecutionPolicy Bypass -Command "iex (irm 'https://junie.jetbrains.com/install.ps1')"
```

Homebrew

```bash
brew tap jetbrains-junie/junie
brew update
brew install junie
```

Verify the installation:

junie --version

Step 2: Configure AutoDo

Junie supports AutoDo as a built-in BYOK (Bring Your Own Key) provider. Set the AUTODO_API_KEY environment variable to connect Junie to AutoDo:

Shell Profile (Recommended)

Add the environment variable to your shell profile for persistent configuration:

```bash
# Open your shell profile
nano ~/.zshrc  # or ~/.bashrc for Bash users

# Add this line:
export AUTODO_API_KEY="<your-autodo-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:

```bash
junie --autodo-api-key "<your-autodo-api-key>"
```

CI/CD

In CI/CD pipelines, set the environment variable in your runner configuration:

```bash
export AUTODO_API_KEY="<your-autodo-api-key>"
junie "Review and fix any code quality issues in the latest commit"
```

Note: Replace <your-autodo-api-key> with your actual AutoDo API key from the API Keys page. Keys start with sk-.

Step 3: Start Coding

Navigate to your project directory and start Junie:

cd /path/to/your/project
junie

Type your prompt in the interactive CLI:

> give me an overview of this codebase

Use @ 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 AutoDo, 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 AutoDo in headless mode
export AUTODO_API_KEY="$AUTODO_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:
          autodo_api_key: ${{ secrets.AUTODO_API_KEY }}
          prompt: "code-review"

GitLab CI/CD Example

Follow the setup instructions to configure the Junie Workspace project, then add AUTODO_API_KEY as a CI/CD variable. Once set up, trigger reviews by commenting on any MR:

#junie code-review

Verify Your Connection

After starting a session, check the AutoDo Activity Dashboard to confirm your requests are being routed through AutoDo.

Learn More