jbai-cli
v1.5.4
Published
CLI wrappers to use AI coding tools (Claude Code, Codex, Gemini CLI, OpenCode) with JetBrains AI Platform
Maintainers
Readme
jbai-cli
Use AI coding tools with your JetBrains AI subscription — no separate API keys needed.
One token, all tools: Claude Code, Codex, Aider, Gemini CLI, OpenCode.
Install
npm install -g jbai-cliSetup (2 minutes)
Step 1: Get your token
- Go to platform.jetbrains.ai (or staging)
- Click your Profile icon (top right)
- Click "Copy Developer Token"
Step 2: Save your token
jbai token set
# Paste your token when promptedStep 3: Verify it works
jbai testExpected output:
Testing JetBrains AI Platform (staging)
1. OpenAI Proxy (Chat): ✅ Working
2. OpenAI Proxy (Codex /responses): ✅ Working
3. Anthropic Proxy (Claude): ✅ Working
4. Google Proxy (Gemini): ✅ WorkingUsage
Claude Code
jbai-claudeCodex CLI
# Interactive mode
jbai-codex
# One-shot task
jbai-codex exec "explain this codebase"Aider
jbai-aider
# Use Gemini models with Aider
jbai-aider --model gemini/gemini-2.5-proOpenCode
jbai-opencodeHandoff to Orca Lab (local)
# Continue a task in Orca Lab via local facade
jbai handoff --task "continue this work in orca-lab"In-session handoff (interactive tools)
While running jbai-codex, jbai-claude, jbai-gemini, or jbai-opencode:
- Press
Ctrl+]to trigger a handoff to Orca Lab. - The last prompt you typed is used as the task.
Optional environment variables:
ORCA_LAB_URL(default:http://localhost:3000)FACADE_JWT_TOKEN(local facade auth)GITHUB_TOKEN/GH_TOKEN(private repos)JBAI_HANDOFF_TASK(fallback task if no prompt captured)JBAI_HANDOFF_REPO(override repo URL)JBAI_HANDOFF_REF(override git ref)JBAI_HANDOFF_BRANCH(override working branch)JBAI_HANDOFF_ENV(STAGING | PREPROD | PRODUCTION)JBAI_HANDOFF_MODEL(Claude model for Orca Lab agent)JBAI_HANDOFF_OPEN(set tofalseto avoid opening a browser)
Super Mode (Skip Confirmations)
Add --super (or --yolo or -s) to any command to enable maximum permissions:
# Claude Code - skips all permission prompts
jbai-claude --super
# Codex - full auto mode
jbai-codex --super exec "refactor this code"
# Aider - auto-confirm all changes
jbai-aider --super| Tool | Super Mode Flag |
|------|-----------------|
| Claude Code | --dangerously-skip-permissions |
| Codex | --full-auto |
| Aider | --yes |
| Gemini CLI | --yolo |
| OpenCode | N/A (run mode is already non-interactive) |
⚠️ Use with caution - super mode allows the AI to make changes without confirmation.
Using Different Models
Each tool has a sensible default, but you can specify any available model:
# Claude with Opus
jbai-claude --model claude-opus-4-1-20250805
# Codex with GPT-5
jbai-codex --model gpt-5.2-codex
# Aider with Gemini Pro
jbai-aider --model gemini/gemini-2.5-proAvailable Models
Claude (Anthropic)
| Model | Notes |
|-------|-------|
| claude-sonnet-4-5-20250929 | Default, recommended |
| claude-opus-4-1-20250805 | Most capable |
| claude-sonnet-4-20250514 | |
| claude-3-7-sonnet-20250219 | |
| claude-3-5-haiku-20241022 | Fast |
GPT (OpenAI)
| Model | Notes |
|-------|-------|
| gpt-4o-2024-11-20 | Default |
| gpt-5-2025-08-07 | Latest |
| gpt-5.1-2025-11-13 | |
| gpt-5.2-2025-12-11 | |
| gpt-5-mini-2025-08-07 | Fast |
| o3-2025-04-16 | Reasoning |
| o3-mini-2025-01-31 | |
Codex (OpenAI Responses) - Use with Codex CLI: jbai-codex --model <model>
| Model | Notes |
|-------|-------|
| gpt-5.2-codex | Default, coding-optimized |
| gpt-5.1-codex | |
| gpt-5.1-codex-mini | Faster |
| gpt-5.1-codex-max | |
Gemini (Google) - Use with Aider: jbai-aider --model gemini/<model>
| Model | Notes |
|-------|-------|
| gemini-2.5-flash | Fast |
| gemini-2.5-pro | More capable |
| gemini-3-pro-preview | Preview |
| gemini-3-flash-preview | Preview |
Commands Reference
| Command | Description |
|---------|-------------|
| jbai help | Show help |
| jbai token | Show token status |
| jbai token set | Set/update token |
| jbai test | Test API connections |
| jbai models | List all models |
| jbai handoff | Continue a task in Orca Lab |
| jbai install | Install all AI tools |
| jbai install claude | Install specific tool |
| jbai doctor | Check tool installation status |
| jbai env staging | Use staging environment |
| jbai env production | Use production environment |
Installing AI Tools
jbai-cli can install the underlying tools for you:
# Install all tools at once
jbai install
# Install specific tool
jbai install claude
jbai install codex
jbai install aider
# Check what's installed
jbai doctorManual Installation
| Tool | Install Command |
|------|-----------------|
| Claude Code | npm i -g @anthropic-ai/claude-code |
| Codex | npm i -g @openai/codex |
| Aider | pipx install aider-chat |
| OpenCode | go install github.com/opencode-ai/opencode@latest |
Token Management
# Check token status (shows expiry date)
jbai token
# Update expired token
jbai token setTokens are stored securely at ~/.jbai/token
Switching Environments
# Staging (default) - for testing
jbai env staging
# Production - for real work
jbai env productionNote: Staging and production use different tokens. Get the right one from the corresponding platform URL.
How It Works
jbai-cli uses JetBrains AI Platform's Guarded Proxy, which provides API-compatible endpoints:
- OpenAI API →
api.jetbrains.ai/user/v5/llm/openai/v1 - Anthropic API →
api.jetbrains.ai/user/v5/llm/anthropic/v1 - Google Vertex →
api.jetbrains.ai/user/v5/llm/google/v1/vertex
Your JetBrains AI token authenticates all requests via the Grazie-Authenticate-JWT header.
Troubleshooting
"Token expired"
jbai token set
# Get fresh token from platform.jetbrains.ai"Claude Code not found"
npm install -g @anthropic-ai/claude-code"Connection failed"
# Test which endpoints work
jbai test
# Check your environment
jbai tokenWrong environment
# Staging token won't work with production
jbai env staging # if using staging token
jbai env production # if using production tokenLicense
MIT
