OpenClaude is an open-source coding-agent CLI for cloud and local model providers. Use OpenAI-compatible APIs, Gemini, GitHub Models, Codex OAuth, Codex, Ollama, Atomic Chat, and other supported backends while keeping one terminal-first workflow: prompts, tools, agents, MCP, slash commands, and streaming output. OpenClaude is also mirrored to GitLawb: gitlawb.com/node/repos/z6MkqDnb/openclaude
OpenClaude is an open-source coding-agent CLI for cloud and local model providers.
Use OpenAI-compatible APIs, Gemini, GitHub Models, Codex OAuth, Codex, Ollama, Atomic Chat, and other supported backends while keeping one terminal-first workflow: prompts, tools, agents, MCP, slash commands, and streaming output.
OpenClaude is also mirrored to GitLawb: gitlawb.com/node/repos/z6MkqDnb/openclaude
Quick Start | Setup Guides | Providers | Source Build | VS Code Extension | Sponsors | Community
|
|
|
|
| GitLawb | Bankr.bot | Atomic Chat | Xiaomi MiMo |
/providernpm install -g @gitlawb/openclaude@latest
If you're on Arch Linux, you can install OpenClaude from the community-maintained AUR package:
paru -S openclaude
If the install later reports ripgrep not found, install ripgrep system-wide and confirm rg --version works in the same terminal before starting OpenClaude.
Verify / troubleshoot installed version:
openclaude --version
npm view @gitlawb/openclaude dist-tags
npm install -g @gitlawb/openclaude@latest
openclaude
Inside OpenClaude:
/provider for guided provider setup and saved profiles/onboard-github for GitHub Models onboardingmacOS / Linux:
export CLAUDE_CODE_USE_OPENAI=1
export OPENAI_API_KEY=sk-your-key-here
export OPENAI_MODEL=gpt-4o
openclaude
Windows PowerShell:
$env:CLAUDE_CODE_USE_OPENAI="1"
$env:OPENAI_API_KEY="sk-your-key-here"
$env:OPENAI_MODEL="gpt-4o"
openclaude
macOS / Linux:
export CLAUDE_CODE_USE_OPENAI=1
export OPENAI_BASE_URL=http://localhost:11434/v1
export OPENAI_MODEL=qwen2.5-coder:7b
openclaude
Windows PowerShell:
$env:CLAUDE_CODE_USE_OPENAI="1"
$env:OPENAI_BASE_URL="http://localhost:11434/v1"
$env:OPENAI_MODEL="qwen2.5-coder:7b"
openclaude
Beginner-friendly guides:
Advanced and source-build guides:
| Provider | Setup Path | Notes |
|---|---|---|
| OpenAI-compatible | /provider or env vars | Works with OpenAI, OpenRouter, DeepSeek, Groq, Mistral, LM Studio, and other compatible /v1 servers |
| Hicap | /provider or OpenAI-compatible env vars | Uses api-key auth, discovers models from unauthenticated /models, and supports Responses mode for gpt- models |
| Gemini | /provider or env vars | Supports API key only |
| GitHub Models | /onboard-github | Interactive onboarding with saved credentials |
| Codex OAuth | /provider | Opens ChatGPT sign-in in your browser and stores Codex credentials securely |
| Codex | /provider | Uses existing Codex CLI auth, OpenClaude secure storage, or env credentials |
| Gitlawb Opengateway | Startup default, /provider, or env vars | Smart gateway at https://opengateway.gitlawb.com/v1; requires an API key from https://gitlawb.com/opengateway/keys and routes Xiaomi MiMo and GMI Cloud partner models by OPENAI_MODEL |
| OpenCode Zen | /provider or env vars | Pay-as-you-go AI gateway (41 models); uses OPENCODE_API_KEY via https://opencode.ai/zen/v1; shared key with OpenCode Go |
| OpenCode Go | /provider or env vars | $10/mo subscription for open models (12 models); uses OPENCODE_API_KEY via https://opencode.ai/zen/go/v1; shared key with OpenCode Zen |
| Xiaomi MiMo | /provider or env vars | OpenAI-compatible API at https://mimo.mi.com; uses MIMO_API_KEY and defaults to mimo-v2.5-pro |
| Ollama | /provider or env vars | Local inference with no API key |
| Atomic Chat | /provider, env vars, or bun run dev:atomic-chat | Local Model Provider; auto-detects loaded models |
| Bedrock / Vertex / Foundry | env vars | Anthropic-family cloud routes; Vertex is for Claude on Vertex AI, not arbitrary Model Garden models |
OpenClaude supports multiple providers, but behavior is not identical across all of them.
mimo-* and google/gemini-3.1-flash-lite-preview with /model, and do not pin the base URL to /v1/xiaomi-mimo.api-key header auth on the direct OpenAI-compatible route and currently does not support /usage reporting in OpenClaudeFor best results, use models with strong tool/function calling support.
OpenClaude can route different agents to different models through settings-based routing. This is useful for cost optimization or splitting work by model strength.
Add to ~/.openclaude.json:
{
"agentModels": {
"deepseek-v4-flash": {
"base_url": "https://api.deepseek.com/v1",
"api_key": "sk-your-key"
},
"gpt-4o": {
"base_url": "https://api.openai.com/v1",
"api_key": "sk-your-key"
}
},
"agentRouting": {
"Explore": "deepseek-v4-flash",
"Plan": "gpt-4o",
"general-purpose": "gpt-4o",
"frontend-dev": "deepseek-v4-flash",
"default": "gpt-4o"
}
}
When no routing match is found, the global provider remains the fallback.
You can also explicitly pass a model argument to the Agent tool that exactly matches a configured key in agentModels to override the provider for a single subagent request.
Note:
/providerchanges the global/parent provider for your current session.agentModelsandagentRoutingare specifically for configuring per-agent provider overrides while keeping the parent session unchanged.
Note:
api_keyvalues insettings.jsonare stored in plaintext. Keep this file private and do not commit it to version control.
By default, WebSearch works on non-Anthropic models using DuckDuckGo. This gives GPT-4o, DeepSeek, Gemini, Ollama, and other OpenAI-compatible providers a free web search path out of the box.
Note: DuckDuckGo fallback works by scraping search results and may be rate-limited, blocked, or subject to DuckDuckGo's Terms of Service. If you want a more reliable supported option, configure Firecrawl.
For Anthropic-native backends and Codex responses, OpenClaude keeps the native provider web search behavior.
WebFetch works, but its basic HTTP plus HTML-to-markdown path can still fail on JavaScript-rendered sites or sites that block plain HTTP requests.
Set a Firecrawl API key if you want Firecrawl-powered search/fetch behavior:
export FIRECRAWL_API_KEY=your-key-here
With Firecrawl enabled:
WebSearch can use Firecrawl's search API while DuckDuckGo remains the default free path for non-Claude modelsWebFetch uses Firecrawl's scrape endpoint instead of raw HTTP, handling JS-rendered pages correctlyFree tier at firecrawl.dev includes 500 credits. The key is optional.
OpenClaude can be run as a headless gRPC service, allowing you to integrate its agentic capabilities (tools, bash, file editing) into other applications, CI/CD pipelines, or custom user interfaces. The server uses bidirectional streaming to send real-time text chunks, tool calls, and request permissions for sensitive commands.
Start the core engine as a gRPC service on localhost:50051:
npm run dev:grpc
| Variable | Default | Description |
|---|---|---|
GRPC_PORT | 50051 | Port the gRPC server listens on |
GRPC_HOST | localhost | Bind address. Use 0.0.0.0 to expose on all interfaces (not recommended without authentication) |
We provide a lightweight CLI client that communicates exclusively over gRPC. It acts just like the main interactive CLI, rendering colors, streaming tokens, and prompting you for tool permissions (y/n) via the gRPC action_required event.
In a separate terminal, run:
npm run dev:grpc:cli
Note: The gRPC definitions are located in src/proto/openclaude.proto. You can use this file to generate clients in Python, Go, Rust, or any other language.
bun install
bun run build
node dist/cli.mjs
Helpful commands:
bun run devbun testbun run test:coveragebun run security:pr-scan -- --base origin/mainbun run smokebun run doctor:runtimebun run verify:privacybun test ... runs for the areas you touchOpenClaude uses Bun's built-in test runner for unit tests.
Run the full unit suite:
bun test
Generate unit test coverage:
bun run test:coverage
Open the visual coverage report:
open coverage/index.html
If you already have coverage/lcov.info and only want to rebuild the UI:
bun run test:coverage:ui
Use focused test runs when you only touch one area:
bun run test:providerbun run test:provider-recommendationbun test path/to/file.test.tsRecommended contributor validation before opening a PR:
bun run buildbun run smokebun run test:coverage for broader unit coverage when your change affects shared runtime or provider logicbun test ... runs for the files and flows you changedCoverage output is written to coverage/lcov.info, and OpenClaude also generates a git-activity-style heatmap at coverage/index.html.
src/ - core CLI/runtimescripts/ - build, verification, and maintenance scriptsdocs/ - setup, contributor, and project documentationpython/ - standalone Python helpers and their testsvscode-extension/openclaude-vscode/ - VS Code extension.github/ - repo automation, templates, and CI configurationbin/ - CLI launcher entrypointsThe repo includes a VS Code extension in vscode-extension/openclaude-vscode for OpenClaude launch integration, provider-aware control-center UI, and theme support.
If you believe you found a security issue, see SECURITY.md.
Contributions are welcome.
For larger changes, open an issue first so the scope is clear before implementation. Helpful validation commands include:
bun run buildbun run test:coveragebun run smokebun test ... runs for files and flows you changedOpenClaude is an independent community project and is not affiliated with, endorsed by, or sponsored by Anthropic.
OpenClaude originated from the Claude Code codebase and has since been substantially modified to support multiple providers and open use. "Claude" and "Claude Code" are trademarks of Anthropic PBC. See LICENSE for details.
See LICENSE.
How to install OpenClaude with any AI Model (Claude Code Open Source) - Open Claude
Pro Coder · 50K views
How to Install OpenClaude in 10 Minutes (Open Source Claude Code with ANY AI Model)
Matt Holztrager · 44K views
“Start Here: Welcome to OpenClaude Discussions — Welcome to OpenClaude Discussions. Use Discussions for: - setup help - provider questions - feature ideas and early brainstorming - sharing workflows, screenshots, and demo…”
“Ollama local setup gets stuck after startup screen — ``` I've cloned the openclaude and installed environment. I am running local model - ollama 3.1:8b But can't go forward after above image... Please give me any idea ho…”
“Solutions for dealing with API issues with Mimo model — Gitlawb is switching from direct model usage to an API key-based system (ITS REMAIN FREE) To continue using the Mimo model with OpenClaude, you now need to provide…”
“free usage — Is there a usage limit on the free gitlawb opengateway model: mimo-2.5-pro? Am getting this error Running scheduled task (Jun 3 4:44am) └ API Error: 402 {"error":{"message":"Insufficient credits — top up …”
“Is Open Claude Free? — Upon using the command /cost, it says some amount like below. Total cost: $66.07 (costs may be inaccurate due to the usage of unknown models) Any idea on this, please”
“OpenClaude: How I’m Recreating My OpenClaw Setup with Claude Code and Telegram - MacStories — MacStories”
AI
Companies use AI to filter candidates. I just gave candidates AI to choose companies. Career-Ops (career-ops.org, also known as careerops) turns any AI coding CLI into a full job search command center. Instead of manually tracking applications in a spreadsheet, you get an AI-powered pipeline that: Career-ops is agentic: Claude Code navigates career pages with Playwright, evaluates fit by reasoning about your CV vs the job description (not keyword matching), and adapts your resume per listing.
AI
CLI-Anything: Bridging the Gap Between AI Agents and the World's Software 🌐 CLI-Hub: pip install cli-anything-hub then cli-hub install — browse, install, and manage all community-built CLIs. Want to add your own? Open a PR — the hub updates instantly. 🎬 See Demos: Watch AI agents use generated CLIs plus preview, live preview, and trajectory loops to produce real artifacts — CAD builds, 3D scenes, diagrams, gameplay, subtitles, and more.
AI
A self-hosted AI workspace -- meant to be the self-hosted version of the UI experience you get from ChatGPT and Claude. But with more jank and fun. Running on your own hardware, with your own data -- local-first, privacy-first, and no trojan. A full, hover-to-play tour lives on the landing page (docs/index.html). Defaults work out of the box: clone, run, then configure models/search/email inside Settings. Only edit .env for deployment-level overrides like APPBIND, APPPORT, AUTHENABLED, DATABASEURL, or a pre-seeded admin password.
AI
Most AI material teaches in scattered pieces. A paper here, a fine-tuning post there, a flashy agent demo somewhere else. The pieces rarely line up. You ship a chatbot but can't explain its loss curve. You hook a function to an agent but can't say what attention does inside the model that's calling it. This curriculum is the spine. 20 phases, 503 lessons, four languages: Python, TypeScript, Rust, Julia. Linear algebra at one end, autonomous swarms at the other. Every algorithm gets built from raw math first. Backprop. Tokenizer. Attention. Agent loop. By the time PyTorch shows up, you already know what it's doing under the hood. Each lesson runs the same loop: read the problem, derive the math, write the code, run the test, keep the artifact. No five-minute videos, no copy-paste deploys,