@twigpine/openclaude 0.0.0 → 0.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,29 @@
1
+ NOTICE
2
+
3
+ This repository contains code derived from Anthropic's Claude Code CLI.
4
+
5
+ The original Claude Code source is proprietary software:
6
+ Copyright (c) Anthropic PBC. All rights reserved.
7
+ Subject to Anthropic's Commercial Terms of Service.
8
+
9
+ Modifications and additions by OpenClaude contributors are offered under
10
+ the MIT License where legally permissible:
11
+
12
+ MIT License
13
+ Copyright (c) 2026 OpenClaude contributors (modifications only)
14
+
15
+ Permission is hereby granted, free of charge, to any person obtaining
16
+ a copy of the modifications made by OpenClaude contributors, to deal
17
+ in those modifications without restriction, including without limitation
18
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
19
+ and/or sell copies, subject to the following conditions:
20
+
21
+ The above copyright notice and this permission notice shall be included
22
+ in all copies or substantial portions of the modifications.
23
+
24
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
25
+
26
+ The underlying derived code remains subject to Anthropic's copyright.
27
+ This project does not have Anthropic's authorization to distribute
28
+ their proprietary source. Users and contributors should evaluate their
29
+ own legal position.
package/README.md CHANGED
@@ -1 +1,553 @@
1
- Placeholder. The first release of OpenClaude under this name is on its way: https://github.com/Twigpine/openclaude
1
+ <div align="center">
2
+ <img src="docs/assets/openclaude-wordmark.png" alt="OpenClaude — Open terminal for any LLM" width="830">
3
+
4
+ <p>
5
+ <a href="https://trendshift.io/repositories/25807?utm_source=trendshift-badge&amp;utm_medium=badge&amp;utm_campaign=badge-trendshift-25807" target="_blank" rel="noopener noreferrer"><img src="https://trendshift.io/api/badge/trendshift/repositories/25807/daily?language=TypeScript" alt="Twigpine%2Fopenclaude | Trendshift" width="250" height="55"/></a>
6
+ <a href="https://trendshift.io/repositories/25807?utm_source=trendshift-badge&amp;utm_medium=badge&amp;utm_campaign=badge-trendshift-25807" target="_blank" rel="noopener noreferrer"><img src="https://trendshift.io/api/badge/trendshift/repositories/25807/monthly?language=TypeScript" alt="Twigpine%2Fopenclaude | Trendshift" width="250" height="55"/></a>
7
+ <a href="https://trendshift.io/repositories/25807?utm_source=repository-badge&amp;utm_medium=badge&amp;utm_campaign=badge-repository-25807" target="_blank" rel="noopener noreferrer"><img src="https://trendshift.io/api/badge/repositories/25807" alt="Twigpine%2Fopenclaude | Trendshift" width="250" height="55"/></a>
8
+ </p>
9
+ </div>
10
+
11
+ OpenClaude is an open-source coding-agent CLI for cloud and local model providers.
12
+
13
+ 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.
14
+
15
+ [![PR Checks](https://github.com/Twigpine/openclaude/actions/workflows/pr-checks.yml/badge.svg?branch=main)](https://github.com/Twigpine/openclaude/actions/workflows/pr-checks.yml)
16
+ [![Release](https://img.shields.io/github/v/tag/Twigpine/openclaude?label=release&color=0ea5e9)](https://github.com/Twigpine/openclaude/tags)
17
+ [![npm downloads](https://img.shields.io/npm/dm/@twigpine/openclaude)](https://www.npmjs.com/package/@twigpine/openclaude)
18
+ [![Discussions](https://img.shields.io/badge/discussions-open-7c3aed)](https://github.com/Twigpine/openclaude/discussions)
19
+ [![Discord](https://img.shields.io/badge/Discord-join-5865F2?logo=discord&logoColor=white)](https://discord.gg/k68zFR6AcB)
20
+ [![X](https://img.shields.io/badge/X-@gitlawb-000000?logo=x&logoColor=white)](https://x.com/gitlawb)
21
+ [![Security Policy](https://img.shields.io/badge/security-policy-0f766e)](SECURITY.md)
22
+ [![License](https://img.shields.io/badge/license-MIT-2563eb)](LICENSE)
23
+
24
+ OpenClaude is also mirrored to Twigpine:
25
+ [gitlawb.com/node/repos/z6MkqDnb/openclaude](https://gitlawb.com/node/repos/z6MkqDnb/openclaude)
26
+
27
+ [Quick Start](#quick-start) | [Setup Guides](#setup-guides) | [Providers](#supported-providers) | [Development](#development) | [VS Code Extension](#vs-code-extension) | [Partners](#partners) | [Community](#community)
28
+
29
+ ## Partners
30
+
31
+ <table align="center">
32
+ <tr>
33
+ <td align="center" width="150" height="80">
34
+ <a href="https://twigpine.com">
35
+ <img src="https://twigpine.com/logo.png" alt="Twigpine logo" width="72">
36
+ </a>
37
+ </td>
38
+ <td align="center" width="150" height="80">
39
+ <a href="https://bankr.bot">
40
+ <img src="https://bankr.bot/favicon.svg" alt="Bankr.bot logo" width="72">
41
+ </a>
42
+ </td>
43
+ <td align="center" width="150" height="80">
44
+ <a href="https://atomic.chat/">
45
+ <img src="docs/assets/atomic-chat-logo.png" alt="Atomic Chat logo" width="72">
46
+ </a>
47
+ </td>
48
+ <td align="center" width="150" height="80">
49
+ <a href="https://mimo.mi.com">
50
+ <img src="https://mimo.xiaomi.com/mimo-v2-pro/assets/logo.svg" alt="Xiaomi MiMo logo" width="136">
51
+ </a>
52
+ </td>
53
+ <td align="center" width="150" height="80">
54
+ <a href="https://www.atlascloud.ai/">
55
+ <img src="docs/assets/atlas-cloud-banner.png" alt="Atlas Cloud logo" width="136">
56
+ </a>
57
+ </td>
58
+ </tr>
59
+ <tr>
60
+ <td align="center"><a href="https://twigpine.com"><strong>Twigpine</strong></a></td>
61
+ <td align="center"><a href="https://bankr.bot"><strong>Bankr.bot</strong></a></td>
62
+ <td align="center"><a href="https://atomic.chat/"><strong>Atomic Chat</strong></a></td>
63
+ <td align="center"><a href="https://mimo.mi.com"><strong>Xiaomi MiMo</strong></a></td>
64
+ <td align="center"><a href="https://www.atlascloud.ai/"><strong>Atlas Cloud</strong></a></td>
65
+ </tr>
66
+ <tr>
67
+ <td align="center" width="150" height="80">
68
+ <a href="https://aimlapi.com/">
69
+ <picture>
70
+ <source media="(prefers-color-scheme: dark)" srcset="docs/assets/aimlapi-logo-dark.svg">
71
+ <img src="docs/assets/aimlapi-logo.svg" alt="AI/ML API logo" width="136">
72
+ </picture>
73
+ </a>
74
+ </td>
75
+ <td align="center" width="150" height="80">
76
+ <a href="https://novita.ai/">
77
+ <picture>
78
+ <source media="(prefers-color-scheme: dark)" srcset="docs/assets/novita-logo-dark.svg">
79
+ <img src="docs/assets/novita-logo.svg" alt="Novita AI logo" width="136">
80
+ </picture>
81
+ </a>
82
+ </td>
83
+ <td align="center" width="150" height="80">
84
+ <a href="https://www.apismart.ai">
85
+ <picture>
86
+ <source media="(prefers-color-scheme: dark)" srcset="docs/assets/apismart-logo-dark.png">
87
+ <img src="docs/assets/apismart-logo.png" alt="ApiSmart logo" width="120">
88
+ </picture>
89
+ </a>
90
+ </td>
91
+ <td align="center" width="150" height="80">
92
+ <a href="https://concentrate.ai/">
93
+ <picture>
94
+ <source media="(prefers-color-scheme: dark)" srcset="docs/assets/concentrate-logo-dark.svg">
95
+ <img src="docs/assets/concentrate-logo.svg" alt="Concentrate logo" width="64">
96
+ </picture>
97
+ </a>
98
+ </td>
99
+ <td align="center" width="150" height="80">
100
+ <a href="https://exa.ai/">
101
+ <picture>
102
+ <source media="(prefers-color-scheme: dark)" srcset="docs/assets/exa-logo-dark.svg">
103
+ <img src="docs/assets/exa-logo.svg" alt="Exa logo" width="110">
104
+ </picture>
105
+ </a>
106
+ </td>
107
+ </tr>
108
+ <tr>
109
+ <td align="center"><a href="https://aimlapi.com/"><strong>AI/ML API</strong></a></td>
110
+ <td align="center"><a href="https://novita.ai/"><strong>Novita AI</strong></a></td>
111
+ <td align="center"><a href="https://www.apismart.ai"><strong>ApiSmart</strong></a></td>
112
+ <td align="center"><a href="https://concentrate.ai/"><strong>Concentrate</strong></a></td>
113
+ <td align="center"><a href="https://exa.ai/"><strong>Exa</strong></a></td>
114
+ </tr>
115
+ </table>
116
+
117
+ ## Why OpenClaude
118
+
119
+ - One CLI across cloud APIs and local model backends — no per-provider tooling
120
+ - Guided provider setup and saved profiles with `/provider`
121
+ - Coding-agent workflows in one place: bash, file tools, grep, glob, agents, tasks, MCP, and web tools
122
+ - A bundled VS Code extension for launch integration and theme support
123
+ - A pixel-art hero companion who fires an arrow every time you press Enter (really — see [Meet your buddy](#meet-your-buddy))
124
+
125
+ ## Quick Start
126
+
127
+ ### Install
128
+
129
+ OpenClaude requires Node.js `>=22.0.0` for npm installs and runtime. Bun is
130
+ only needed for source builds and local development.
131
+
132
+ ```bash
133
+ npm install -g @twigpine/openclaude@latest
134
+ ```
135
+
136
+ **Upgrading from `@gitlawb/openclaude`?** The package moved to the `@twigpine`
137
+ scope and the old one is no longer updated. Both packages provide the
138
+ `openclaude` command, so npm refuses to install one over the other — remove
139
+ the old one first:
140
+
141
+ ```bash
142
+ npm uninstall -g @gitlawb/openclaude
143
+ npm install -g @twigpine/openclaude@latest
144
+ ```
145
+
146
+ Your settings and sessions (`~/.openclaude` and `~/.openclaude.json`) are not
147
+ touched. Don't use `--force` to install over the old package instead: a later
148
+ uninstall of the old one would then remove the `openclaude` command. If that
149
+ happens, uninstall `@twigpine/openclaude` and install it again.
150
+
151
+ If you're on Arch Linux, you can install OpenClaude from the community-maintained [AUR package](https://aur.archlinux.org/packages/openclaude):
152
+ ```bash
153
+ paru -S openclaude
154
+ ```
155
+
156
+ If the install later reports `ripgrep not found`, install ripgrep system-wide and confirm `rg --version` works in the same terminal before starting OpenClaude.
157
+
158
+ **Verify / troubleshoot installed version:**
159
+
160
+ ```bash
161
+ openclaude --version
162
+ npm view @twigpine/openclaude dist-tags
163
+ npm install -g @twigpine/openclaude@latest
164
+ ```
165
+
166
+ ### Start
167
+
168
+ ```bash
169
+ openclaude
170
+ ```
171
+
172
+ Inside OpenClaude:
173
+
174
+ - run `/provider` for guided provider setup and saved profiles
175
+ - run `/onboard-github` for GitHub Models onboarding
176
+ - run `/search` to choose the web search backend (Exa by default) or add a search API key
177
+
178
+ > **Note:** OpenClaude does not automatically load project `.env` files. We recommend using the `/provider` command for setup, which saves provider profiles and credentials in `.openclaude-profile.json`. If you prefer environment variables, export them explicitly or run `openclaude --provider-env-file .env` for provider/setup variables. Export runtime/debug knobs from your shell or launcher.
179
+
180
+ ### Resume or fork a conversation
181
+
182
+ Resume an existing conversation by session ID, or continue the most recent
183
+ conversation in the current directory:
184
+
185
+ ```bash
186
+ openclaude --resume <session-id>
187
+ openclaude --continue
188
+ ```
189
+
190
+ Add `--fork-session` to branch the conversation history into a new session ID
191
+ instead of reusing the original transcript:
192
+
193
+ ```bash
194
+ openclaude --resume <session-id> --fork-session
195
+ openclaude --continue --fork-session
196
+ ```
197
+
198
+ Forking is conversation branching only. It does not create filesystem isolation,
199
+ copy your working tree, or create a git worktree branch.
200
+
201
+ ### Background sessions
202
+
203
+ Run long non-interactive prompts detached from the current terminal:
204
+
205
+ ```bash
206
+ openclaude --bg "fix failing tests"
207
+ openclaude --bg --name auth-refactor "refactor auth middleware"
208
+ openclaude ps
209
+ openclaude logs auth-refactor
210
+ openclaude logs auth-refactor -f
211
+ openclaude kill auth-refactor
212
+ ```
213
+
214
+ Background sessions are local child processes. OpenClaude does not start a daemon
215
+ or network service, and permission/provider/model/settings flags are passed to
216
+ the child process the same way they are for a foreground `--print` run. Session
217
+ metadata and logs are stored under the resolved OpenClaude config directory,
218
+ usually `~/.openclaude/bg-sessions/`; `OPENCLAUDE_CONFIG_DIR` can point
219
+ OpenClaude somewhere else. `CLAUDE_CONFIG_DIR` is ignored for OpenClaude
220
+ background-session storage. Session names can be reused after older sessions
221
+ reach a terminal state; use the session ID to inspect older logs with the same
222
+ name. A naturally finished session is recorded as `exited` when its process
223
+ returns zero and `failed` when it returns nonzero or handles a termination
224
+ signal. `stale` remains the conservative result when the process disappears
225
+ without an observed outcome; an explicit successful `openclaude kill` is
226
+ recorded as `killed`, and `killed` takes precedence over a natural `exited` or
227
+ `failed` outcome for the same process. Terminal outcomes are stored separately
228
+ under `bg-sessions/terminal/`; deleting that directory makes finished sessions
229
+ fall back to liveness-derived status. OpenClaude does not infer POSIX signal
230
+ names on Windows.
231
+ Unobservable force termination, host crashes, and power loss remain `stale` on
232
+ every platform.
233
+
234
+ `openclaude attach <id-or-name>` currently reports the matching session and
235
+ points to `openclaude logs <id> -f`; full terminal reattach is not implemented
236
+ for local background sessions yet.
237
+
238
+ ### OpenClaude config cutover
239
+
240
+ OpenClaude stores its own config under `~/.openclaude` and `~/.openclaude.json`
241
+ by default. It does not read `~/.claude`, project `.claude/` directories, or
242
+ `CLAUDE_CONFIG_DIR`; new users can start with an empty OpenClaude config and do
243
+ not need Claude Code installed.
244
+
245
+ If you previously used OpenClaude with `.claude` paths, migrate intentionally:
246
+ copy only the settings, commands, agents, skills, scheduled tasks, or other files
247
+ you personally created for OpenClaude into the matching `.openclaude` location.
248
+ Do not blanket-copy `.claude`, and do not copy Claude Code credentials or auth
249
+ files. For provider authentication, prefer running OpenClaude's provider setup
250
+ again or exporting provider-specific environment variables.
251
+
252
+ ### Fastest OpenAI setup
253
+
254
+ macOS / Linux:
255
+
256
+ ```bash
257
+ export CLAUDE_CODE_USE_OPENAI=1
258
+ export OPENAI_API_KEY=sk-your-key-here
259
+ export OPENAI_MODEL=gpt-4o
260
+
261
+ openclaude
262
+ ```
263
+
264
+ Windows PowerShell:
265
+
266
+ ```powershell
267
+ $env:CLAUDE_CODE_USE_OPENAI="1"
268
+ $env:OPENAI_API_KEY="sk-your-key-here"
269
+ $env:OPENAI_MODEL="gpt-4o"
270
+
271
+ openclaude
272
+ ```
273
+
274
+ ### Fastest local Ollama setup
275
+
276
+ macOS / Linux:
277
+
278
+ ```bash
279
+ export CLAUDE_CODE_USE_OPENAI=1
280
+ export OPENAI_BASE_URL=http://localhost:11434/v1
281
+ export OPENAI_MODEL=qwen2.5-coder:7b
282
+
283
+ openclaude
284
+ ```
285
+
286
+ Windows PowerShell:
287
+
288
+ ```powershell
289
+ $env:CLAUDE_CODE_USE_OPENAI="1"
290
+ $env:OPENAI_BASE_URL="http://localhost:11434/v1"
291
+ $env:OPENAI_MODEL="qwen2.5-coder:7b"
292
+
293
+ openclaude
294
+ ```
295
+
296
+ For Ollama, OpenClaude uses Ollama's native chat API and requests a 32768-token
297
+ context window on each chat request so same-session history is not silently
298
+ truncated by Ollama's OpenAI-compatible shim. Set `OPENCLAUDE_OLLAMA_NUM_CTX`
299
+ or `OLLAMA_CONTEXT_LENGTH` if you need a different request-level context size.
300
+ See [Advanced Setup](docs/advanced-setup.md#ollama-context-length) for
301
+ verification with `ollama ps`.
302
+
303
+ ## Setup Guides
304
+
305
+ Beginner-friendly guides:
306
+
307
+ - [Non-Technical Setup](docs/non-technical-setup.md)
308
+ - [Windows Quick Start](docs/quick-start-windows.md)
309
+ - [macOS / Linux Quick Start](docs/quick-start-mac-linux.md)
310
+
311
+ Advanced and source-build guides:
312
+
313
+ - [Advanced Setup](docs/advanced-setup.md)
314
+ - [Smart Auto-Routing](docs/smart-routing.md)
315
+ - [Agent Routing and Step Limits](docs/agent-routing.md)
316
+ - [Headless gRPC Server](docs/grpc-server.md)
317
+ - [Repo Map (codebase intelligence)](docs/repo-map.md)
318
+ - [Skills](docs/skills.md)
319
+ - [Android Install](ANDROID_INSTALL.md)
320
+
321
+ ## Supported Providers
322
+
323
+ | Provider | Setup Path | Notes |
324
+ | --- | --- | --- |
325
+ | OpenAI-compatible | `/provider` or env vars | Works with OpenAI, OpenRouter, DeepSeek, Groq, Mistral, LM Studio, and other compatible `/v1` servers |
326
+ | Z.AI GLM Coding Plan | `/provider` or OpenAI-compatible env vars | Uses `OPENAI_API_KEY` at `https://api.z.ai/api/coding/paas/v4`, defaults to `glm-5.2`, and offers the vision-capable `glm-5.3-flash` option |
327
+ | AI/ML API | `/provider` or `AIMLAPI_API_KEY` ([setup guide](docs/aimlapi-setup.md)) | Uses `https://api.aimlapi.com/v1`, auto-detects the OpenAI-compatible route from `AIMLAPI_API_KEY`, sends OpenClaude attribution headers, and discovers chat-capable models from the public `/models` catalog |
328
+ | Concentrate | `/provider` or `CONCENTRATE_API_KEY` | Unified OpenAI-compatible gateway at `https://api.concentrate.ai/v1`; defaults to `deepseek-v4-flash` and auto-discovers the chat model catalog |
329
+ | LLMTR | `/provider` or OpenAI-compatible env vars | Multi-model gateway at `https://llmtr.com/v1`; `/provider` and `--provider llmtr` default to `deepseek/deepseek-v4-flash`, while raw env setup must set `OPENAI_BASE_URL=https://llmtr.com/v1` and `OPENAI_MODEL`; accepts `LLMTR_API_KEY` or `OPENAI_API_KEY` after the route is selected and discovers tool-capable Chat Completions models from the public catalog |
330
+ | Command Code | `/provider` or OpenAI-compatible env vars | Hybrid OpenAI-compatible gateway at `https://api.commandcode.ai/provider/v1`; `/provider` and `--provider commandcode` default to `deepseek/deepseek-v4-flash`, while raw env setup must set `OPENAI_BASE_URL=https://api.commandcode.ai/provider/v1` and `OPENAI_MODEL`; requires `CMD_API_KEY`, `COMMANDCODE_API_KEY`, or the official `COMMAND_CODE_API_KEY` after the route is selected and discovers Chat Completions models from the public catalog. Claude models are unsupported by this Chat Completions integration |
331
+ | ApiSmart | `/provider` or `APISMART_API_KEY` | Uses `https://gw.apismart.ai/v1`, defaults to `DEEPSEEK_V4_FLASH`, and supports optional `APISMART_MODEL` plus authenticated model discovery |
332
+ | API Route | `/provider` or `API_ROUTE_API_KEY` | Uses `https://global.api-route.com/v1`, defaults to `claude-sonnet-4-6`, and supports optional `API_ROUTE_MODEL` plus authenticated model discovery |
333
+ | Hicap | `/provider` or OpenAI-compatible env vars | Uses `api-key` auth, discovers models from unauthenticated `/models`, and supports Responses mode for `gpt-` models |
334
+ | Fireworks AI | `/provider` or env vars | First-class provider with 276 curated models (DeepSeek, Qwen, Llama, Gemma, and more); uses `FIREWORKS_API_KEY` |
335
+ | LongCat | `/provider` or env vars | Meituan LongCat OpenAI-compatible API at `https://api.longcat.chat/openai/v1`; uses `LONGCAT_API_KEY` and defaults to `LongCat-2.0` |
336
+ | ClinePass | `/provider` or env vars | AI model gateway with usage limits (5hr, weekly, monthly); uses `CLINE_API_KEY` at `https://api.cline.bot/api/v1` |
337
+ | Gemini | `/provider` or env vars | Supports API key only |
338
+ | GitHub Models | `/onboard-github` | Interactive onboarding with saved credentials |
339
+ | Codex OAuth | `/provider` | Opens ChatGPT sign-in in your browser and stores Codex credentials securely |
340
+ | Codex | `/provider` | Uses existing Codex CLI auth, OpenClaude secure storage, or env credentials |
341
+ | Twigpine 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` |
342
+ | OpenCode Zen | `/provider` or env vars | Pay-as-you-go AI gateway (48 models); uses `OPENCODE_API_KEY` via `https://opencode.ai/zen/v1`; shared key with OpenCode Go |
343
+ | OpenCode Go | `/provider` or env vars | $10/mo subscription for open models (13 models); uses `OPENCODE_API_KEY` via `https://opencode.ai/zen/go/v1`; shared key with OpenCode Zen |
344
+ | 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` |
345
+ | NEAR AI | `/provider` or env vars | Unified gateway (Claude, GPT, Gemini + TEE open models); uses `NEARAI_API_KEY` at `https://cloud-api.near.ai/v1` |
346
+ | Cloudflare Workers AI | `/provider` or env vars | OpenAI-compatible API at `https://api.cloudflare.com/client/v4/accounts/<ACCOUNT_ID>/ai/v1`; uses `CLOUDFLARE_API_TOKEN`. Replace `<ACCOUNT_ID>` with your Cloudflare account id. |
347
+ | Ollama | `/provider` or env vars | Local inference with no API key |
348
+ | Atomic Chat | `/provider`, env vars, or `bun run dev:atomic-chat` | Local Model Provider; auto-detects loaded models |
349
+ | Bedrock / Vertex / Foundry | env vars | Anthropic-family cloud routes; Vertex is for Claude on Vertex AI, not arbitrary Model Garden models |
350
+
351
+ ## What Works
352
+
353
+ - **Tool-driven coding workflows**: Bash, file read/write/edit, grep, glob, agents, tasks, MCP, and slash commands
354
+ - **Streaming responses**: Real-time token output and tool progress
355
+ - **Tool calling**: Multi-step tool loops with model calls, tool execution, and follow-up responses
356
+ - **Images**: URL and base64 image inputs for providers that support vision. Paste from the clipboard with Ctrl+V (Alt+V on Windows). 1080p/4K screenshots still attach. If processing fails and the image is over the 5MB payload limit or the 8000px API edge, the prompt shows that error instead of "No image found". For Anthropic requests containing more than 20 images (including retained conversation history and tool results), local images must fit within 2000×2000 pixels. On Amazon Bedrock and Google Cloud Vertex AI, document blocks also count toward that 20-block threshold. OpenClaude attempts to resize them before sending; if processing cannot produce a compliant image, it reports an actionable error rather than silently dropping attachments. Resize the affected images or start a new conversation with fewer images (or documents on those partners).
357
+ - **Provider profiles**: Guided setup plus saved user-level provider profile support
358
+ - **Local and remote model backends**: Cloud APIs, local servers, and Apple Silicon local inference
359
+ - **Codebase intelligence (repo map)**: Structural map of the repository ranked by PageRank importance, auto-injected into context when the `REPO_MAP` flag is enabled or the `REPO_MAP` environment variable is set. Inspect with `/repomap` (2048-token default). See [docs/repo-map.md](docs/repo-map.md) for details.
360
+ - **A companion with signature moves**: A truecolor pixel-art hero who lives beside your prompt and reacts when you work. See below.
361
+
362
+ ## Meet Your Buddy
363
+
364
+ Run `/buddy` to hatch a companion — a truecolor pixel-art hero who stands
365
+ beside your prompt, idles, blinks, and fires their signature move every time
366
+ you submit a message:
367
+
368
+ ```
369
+ /buddy hatch (first run) or pet your companion
370
+ /buddy set robinhood the green archer — arrow shot on every Enter
371
+ /buddy set kaio gold-haired warrior — charges a full-width energy wave
372
+ /buddy set strawhat stretchy punch that snaps back
373
+ /buddy set merlin twinkling sparkle stream
374
+ /buddy set kage spinning shuriken
375
+ /buddy set ember dragon fire with a real heat gradient
376
+ /buddy set corsair cannonball with smoke trail
377
+ /buddy name Robin rename your companion
378
+ /buddy set random back to your rolled hero
379
+ ```
380
+
381
+ Companions respect `prefersReducedMotion`, degrade gracefully to line art in
382
+ low-color terminals, and can be silenced with `/buddy mute`. Requires a
383
+ terminal at least 100 columns wide for the full sprite.
384
+
385
+ ## Provider Notes
386
+
387
+ OpenClaude supports multiple providers, but behavior is not identical across all of them.
388
+
389
+ - Anthropic-specific features may not exist on other providers
390
+ - Tool quality depends heavily on the selected model
391
+ - Smaller local models can struggle with long multi-step tool flows
392
+ - Some providers impose lower output caps than the CLI defaults, and OpenClaude adapts where possible
393
+ - AI/ML API uses the OpenAI-compatible route, defaults to `gpt-4o`, and only surfaces chat-capable models from its public catalog
394
+ - Twigpine Opengateway is the fresh-install startup default and requires an API key from https://gitlawb.com/opengateway/keys. It uses one OpenAI-compatible base URL; switch between `mimo-*` and `google/gemini-3.1-flash-lite-preview` with `/model`, and do not pin the base URL to `/v1/xiaomi-mimo`.
395
+ - Z.AI GLM Coding Plan uses `https://api.z.ai/api/coding/paas/v4` with `glm-5.2` by default. On that direct route, GLM-5.3-Flash is selectable as `glm-5.3-flash` and accepts image input. Its OpenClaude effort choices are `low`, `high`, and `xhigh`, with `xhigh` requesting Z.AI `max`; GLM-5.3 and the existing GLM-5.2 query controls remain supported. These capabilities are not claimed for gateways that happen to carry the same model name.
396
+ - Xiaomi MiMo uses `api-key` header auth on the direct OpenAI-compatible route and currently does not support `/usage` reporting in OpenClaude
397
+ - GitHub Copilot serializes sub-agent execution by default to reduce Premium Request consumption — see [Agent Routing and Step Limits](docs/agent-routing.md#github-copilot-sub-agent-optimization) for tuning
398
+
399
+ For best results, use models with strong tool/function calling support.
400
+
401
+
402
+
403
+ ## Agents
404
+
405
+ Route different agents to different models (cost optimization, splitting work
406
+ by model strength), cap sub-agent tool steps with `maxSteps`, and tune GitHub
407
+ Copilot sub-agent behavior. Configured via settings, agent frontmatter, and
408
+ environment variables:
409
+
410
+ - per-agent provider/model overrides via `agentModels` + `agentRouting` in `~/.openclaude/settings.json`
411
+ - model-only routes that reuse your current provider's credentials
412
+ - built-in agents (`Explore` and `Plan` [feature-gated], `verification` [feature-gated: requires `VERIFICATION_AGENT` + `tengu_hive_evidence`], `code-reviewer` [requires diff inline]) routable by type name
413
+
414
+ See [Agent Routing and Step Limits](docs/agent-routing.md) for the full guide.
415
+
416
+ ## Web Search and Fetch
417
+
418
+ [Exa](https://exa.ai) is the default web search backend. With no setup, `WebSearch` on non-Anthropic models uses Exa's keyless free tier, which has per-second and daily limits. Run `/search` to pick a backend, add an API key, or test search:
419
+
420
+ ```text
421
+ /search # pick a backend
422
+ /search key exa # add an Exa API key (hidden input) for higher limits
423
+ /search remove-key # remove a saved Exa key
424
+ /search status # show which backend handles searches
425
+ /search test # run a test search
426
+ /search anysearch # select AnySearch (works without a key)
427
+ /search key anysearch # optionally add an AnySearch API key in the hidden input
428
+ ```
429
+
430
+ Other backends in the auto chain that you configure with a key (Tavily, Brave, Firecrawl, …) run before the Exa free tier, and DuckDuckGo is the last-resort fallback. When the active provider is Ollama, OpenClaude uses the signed-in local Ollama Web Search endpoint ahead of the free tier. Set `OLLAMA_API_KEY` to enable the hosted Ollama endpoint as a fallback. Set `EXA_FREE_TIER=0` if searches should never go to Exa without a key. See [Web Search Providers](src/tools/WebSearchTool/README_SEARCH_PROVIDERS.md) for every backend and option.
431
+
432
+ AnySearch is available as an explicit backend with `/search anysearch` or `WEB_SEARCH_PROVIDER=anysearch`. `ANYSEARCH_API_KEY` is optional; anonymous access has lower service limits. Set `ANYSEARCH_MAX_RESULTS` to an integer from 1 to 10 (default 10) to control the requested result count. AnySearch does not change the `auto` search order.
433
+
434
+ > **Note:** DuckDuckGo fallback works by scraping search results and may be rate-limited, blocked, or subject to DuckDuckGo's Terms of Service.
435
+
436
+ For Anthropic-native backends and Codex responses, OpenClaude keeps the native provider web search behavior unless you pick a specific backend with `/search` (for example `/search exa`).
437
+
438
+ To select Ollama search explicitly, use `WEB_SEARCH_PROVIDER=ollama`. A local Ollama route uses its configured `OPENAI_BASE_URL` or `OLLAMA_BASE_URL`; hosted search sends `OLLAMA_API_KEY` only to `https://ollama.com/api/web_search`.
439
+
440
+ `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.
441
+
442
+ Set a [Firecrawl](https://firecrawl.dev) API key if you want Firecrawl-powered search/fetch behavior:
443
+
444
+ ```bash
445
+ export FIRECRAWL_API_KEY=your-key-here
446
+ ```
447
+
448
+ With Firecrawl enabled:
449
+
450
+ - `WebSearch` can use Firecrawl's search API while the Exa free tier remains the default free path for non-Claude models
451
+ - `WebFetch` uses Firecrawl's scrape endpoint instead of raw HTTP, handling JS-rendered pages correctly
452
+
453
+ Free tier at [firecrawl.dev](https://firecrawl.dev) includes 500 credits. The key is optional.
454
+
455
+ ## Headless gRPC Server
456
+
457
+ OpenClaude can run as a headless gRPC service with bidirectional streaming —
458
+ integrate its agentic capabilities into other applications, CI/CD pipelines,
459
+ or custom UIs. Start it with `npm run dev:grpc`; a test CLI client ships with
460
+ the repo. See [Headless gRPC Server](docs/grpc-server.md) for configuration
461
+ and client generation from `src/proto/openclaude.proto`.
462
+
463
+ ## Development
464
+
465
+ Use Node.js `>=22.0.0` and Bun `1.3.13` or newer for source builds.
466
+
467
+ ```bash
468
+ bun install
469
+ bun run build
470
+ node dist/cli.mjs
471
+ ```
472
+
473
+ Day-to-day commands:
474
+
475
+ - `bun run dev` — build and launch from source
476
+ - `bun test` — full unit suite (Bun's built-in runner)
477
+ - `bun test path/to/file.test.ts` — focused runs for the areas you touch
478
+ - `bun run test:coverage` — coverage to `coverage/lcov.info` plus a visual report at `coverage/index.html` (`bun run test:coverage:ui` rebuilds just the UI)
479
+ - `bun run smoke` — smoke checks
480
+ - `bun run doctor:runtime`, `bun run verify:privacy`; for PR intent scanning, use the fresh-upstream, explicit-ref workflow in the [local pre-push validation contract](CONTRIBUTING.md#validation)
481
+
482
+ Focused suites: `bun run test:provider`, `bun run test:provider-recommendation`.
483
+
484
+ To benchmark the launcher module compile cache, build the CLI and run:
485
+
486
+ ```bash
487
+ bun run build
488
+ bun run benchmark:startup
489
+ ```
490
+
491
+ The benchmark requires Node `>=22.8.0`, where the compile-cache API was added;
492
+ the built OpenClaude launcher continues to support the declared Node `>=22.0.0`
493
+ runtime range.
494
+
495
+ The benchmark defaults to 30 separate-process warm runs and 10 isolated
496
+ empty-cache runs. It reports the median, IQR, MAD, first cache-populating run,
497
+ first warm-up, Node/OS/CPU details, bundle size, and commit. Direct bundle
498
+ timings are included only as a secondary diagnostic; the full launcher result
499
+ is the decision signal. Use
500
+ `bun run benchmark:startup -- --warm-runs 40 --cold-runs 10` to request a
501
+ larger sample set. The benchmark records results without enforcing a timing
502
+ threshold in CI.
503
+
504
+ OpenClaude leaves Node's standard compile-cache controls authoritative. Set
505
+ `NODE_DISABLE_COMPILE_CACHE=1` to disable the optimization, including for V8
506
+ coverage runs that require uncached compilation.
507
+
508
+ Before opening or updating a PR, run the authoritative [local pre-push validation contract](CONTRIBUTING.md#validation). The commands below are useful for narrow iteration, but they do not replace that required preflight:
509
+
510
+ - `bun run build`
511
+ - `bun run smoke`
512
+ - `bun run test:coverage` when your change affects shared runtime or provider logic
513
+ - focused `bun test ...` runs for the files and flows you changed
514
+
515
+ ## Repository Structure
516
+
517
+ - `src/` - core CLI/runtime
518
+ - `scripts/` - build, verification, and maintenance scripts
519
+ - `docs/` - setup, contributor, and project documentation
520
+ - `vscode-extension/openclaude-vscode/` - VS Code extension
521
+ - `.github/` - repo automation, templates, and CI configuration
522
+ - `bin/` - CLI launcher entrypoints
523
+
524
+ ## VS Code Extension
525
+
526
+ The repo includes a VS Code extension in [`vscode-extension/openclaude-vscode`](vscode-extension/openclaude-vscode) for OpenClaude launch integration, provider-aware Control Center, in-editor chat, theme support, and optional **Microsoft Foundry / Azure OpenAI** configuration (endpoint, API version, deployment, API key via Secret Storage) injected into launched terminals. See that folder's [README](vscode-extension/openclaude-vscode/README.md).
527
+
528
+ ## Security
529
+
530
+ If you believe you found a security issue, see [SECURITY.md](SECURITY.md).
531
+
532
+ ## Community
533
+
534
+ - Use [GitHub Discussions](https://github.com/Twigpine/openclaude/discussions) for Q&A, ideas, and community conversation
535
+ - Use [GitHub Issues](https://github.com/Twigpine/openclaude/issues) for confirmed bugs and actionable feature work
536
+ - Join the [Discord](https://discord.gg/k68zFR6AcB) to chat with the community in real time
537
+ - Follow [@gitlawb on X](https://x.com/gitlawb) for updates and announcements
538
+
539
+ ## Contributing
540
+
541
+ Contributions are welcome. For larger changes, open an issue first so the
542
+ scope is clear before implementation. See [Development](#development) for the
543
+ build, test, and pre-PR validation commands.
544
+
545
+ ## Disclaimer
546
+
547
+ OpenClaude is an independent community project and is not affiliated with, endorsed by, or sponsored by Anthropic.
548
+
549
+ 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](LICENSE) for details.
550
+
551
+ ## License
552
+
553
+ MIT for OpenClaude contributors' modifications; the derived Claude Code remains Anthropic's. [See more](LICENSE).