@makerbi/openclaude 0.23.0 → 0.24.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/README.md +72 -176
- package/dist/cli.mjs +372 -367
- package/dist/sdk.mjs +64902 -62097
- package/package.json +1 -1
- package/src/entrypoints/sdk/coreTypes.generated.ts +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="docs/assets/openclaude-wordmark.svg" alt="OpenClaude — Open terminal for any LLM" width="830">
|
|
3
|
+
|
|
4
|
+
<p>
|
|
5
|
+
<a href="https://trendshift.io/repositories/25807?utm_source=trendshift-badge&utm_medium=badge&utm_campaign=badge-trendshift-25807" target="_blank" rel="noopener noreferrer"><img src="https://trendshift.io/api/badge/trendshift/repositories/25807/daily?language=TypeScript" alt="Gitlawb%2Fopenclaude | Trendshift" width="250" height="55"/></a>
|
|
6
|
+
<a href="https://trendshift.io/repositories/25807?utm_source=trendshift-badge&utm_medium=badge&utm_campaign=badge-trendshift-25807" target="_blank" rel="noopener noreferrer"><img src="https://trendshift.io/api/badge/trendshift/repositories/25807/monthly?language=TypeScript" alt="Gitlawb%2Fopenclaude | Trendshift" width="250" height="55"/></a>
|
|
7
|
+
<a href="https://trendshift.io/repositories/25807?utm_source=repository-badge&utm_medium=badge&utm_campaign=badge-repository-25807" target="_blank" rel="noopener noreferrer"><img src="https://trendshift.io/api/badge/repositories/25807" alt="Gitlawb%2Fopenclaude | Trendshift" width="250" height="55"/></a>
|
|
8
|
+
</p>
|
|
9
|
+
</div>
|
|
2
10
|
|
|
3
11
|
OpenClaude is an open-source coding-agent CLI for cloud and local model providers.
|
|
4
12
|
|
|
@@ -13,7 +21,7 @@ Use OpenAI-compatible APIs, Gemini, GitHub Models, Codex OAuth, Codex, Ollama, A
|
|
|
13
21
|
OpenClaude is also mirrored to GitLawb:
|
|
14
22
|
[gitlawb.com/node/repos/z6MkqDnb/openclaude](https://gitlawb.com/node/repos/z6MkqDnb/openclaude)
|
|
15
23
|
|
|
16
|
-
[Quick Start](#quick-start) | [Setup Guides](#setup-guides) | [Providers](#supported-providers) | [
|
|
24
|
+
[Quick Start](#quick-start) | [Setup Guides](#setup-guides) | [Providers](#supported-providers) | [Development](#development) | [VS Code Extension](#vs-code-extension) | [Sponsors](#sponsors) | [Community](#community)
|
|
17
25
|
|
|
18
26
|
## Sponsors
|
|
19
27
|
|
|
@@ -60,11 +68,11 @@ OpenClaude is also mirrored to GitLawb:
|
|
|
60
68
|
|
|
61
69
|
## Why OpenClaude
|
|
62
70
|
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
-
|
|
71
|
+
- One CLI across cloud APIs and local model backends — no per-provider tooling
|
|
72
|
+
- Guided provider setup and saved profiles with `/provider`
|
|
73
|
+
- Coding-agent workflows in one place: bash, file tools, grep, glob, agents, tasks, MCP, and web tools
|
|
74
|
+
- A bundled VS Code extension for launch integration and theme support
|
|
75
|
+
- A pixel-art hero companion who fires an arrow every time you press Enter (really — see [Meet your buddy](#meet-your-buddy))
|
|
68
76
|
|
|
69
77
|
## Quick Start
|
|
70
78
|
|
|
@@ -225,6 +233,9 @@ Advanced and source-build guides:
|
|
|
225
233
|
|
|
226
234
|
- [Advanced Setup](docs/advanced-setup.md)
|
|
227
235
|
- [Smart Auto-Routing](docs/smart-routing.md)
|
|
236
|
+
- [Agent Routing and Step Limits](docs/agent-routing.md)
|
|
237
|
+
- [Headless gRPC Server](docs/grpc-server.md)
|
|
238
|
+
- [Repo Map (codebase intelligence)](docs/repo-map.md)
|
|
228
239
|
- [Android Install](ANDROID_INSTALL.md)
|
|
229
240
|
|
|
230
241
|
## Supported Providers
|
|
@@ -246,6 +257,7 @@ Advanced and source-build guides:
|
|
|
246
257
|
| 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 |
|
|
247
258
|
| 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` |
|
|
248
259
|
| 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` |
|
|
260
|
+
| 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. |
|
|
249
261
|
| Ollama | `/provider` or env vars | Local inference with no API key |
|
|
250
262
|
| Atomic Chat | `/provider`, env vars, or `bun run dev:atomic-chat` | Local Model Provider; auto-detects loaded models |
|
|
251
263
|
| Bedrock / Vertex / Foundry | env vars | Anthropic-family cloud routes; Vertex is for Claude on Vertex AI, not arbitrary Model Garden models |
|
|
@@ -259,6 +271,30 @@ Advanced and source-build guides:
|
|
|
259
271
|
- **Provider profiles**: Guided setup plus saved user-level provider profile support
|
|
260
272
|
- **Local and remote model backends**: Cloud APIs, local servers, and Apple Silicon local inference
|
|
261
273
|
- **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.
|
|
274
|
+
- **A companion with signature moves**: A truecolor pixel-art hero who lives beside your prompt and reacts when you work. See below.
|
|
275
|
+
|
|
276
|
+
## Meet Your Buddy
|
|
277
|
+
|
|
278
|
+
Run `/buddy` to hatch a companion — a truecolor pixel-art hero who stands
|
|
279
|
+
beside your prompt, idles, blinks, and fires their signature move every time
|
|
280
|
+
you submit a message:
|
|
281
|
+
|
|
282
|
+
```
|
|
283
|
+
/buddy hatch (first run) or pet your companion
|
|
284
|
+
/buddy set robinhood the green archer — arrow shot on every Enter
|
|
285
|
+
/buddy set kaio gold-haired warrior — charges a full-width energy wave
|
|
286
|
+
/buddy set strawhat stretchy punch that snaps back
|
|
287
|
+
/buddy set merlin twinkling sparkle stream
|
|
288
|
+
/buddy set kage spinning shuriken
|
|
289
|
+
/buddy set ember dragon fire with a real heat gradient
|
|
290
|
+
/buddy set corsair cannonball with smoke trail
|
|
291
|
+
/buddy name Robin rename your companion
|
|
292
|
+
/buddy set random back to your rolled hero
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
Companions respect `prefersReducedMotion`, degrade gracefully to line art in
|
|
296
|
+
low-color terminals, and can be silenced with `/buddy mute`. Requires a
|
|
297
|
+
terminal at least 100 columns wide for the full sprite.
|
|
262
298
|
|
|
263
299
|
## Provider Notes
|
|
264
300
|
|
|
@@ -272,93 +308,21 @@ OpenClaude supports multiple providers, but behavior is not identical across all
|
|
|
272
308
|
- Gitlawb 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`.
|
|
273
309
|
- Z.AI GLM Coding Plan uses `https://api.z.ai/api/coding/paas/v4` with `glm-5.2` by default. Use `glm-5.2?reasoning=high` for enhanced reasoning, `glm-5.2?reasoning=xhigh` to request Z.AI `reasoning_effort=max`, or `glm-5.2?thinking=disabled` for faster direct answers.
|
|
274
310
|
- Xiaomi MiMo uses `api-key` header auth on the direct OpenAI-compatible route and currently does not support `/usage` reporting in OpenClaude
|
|
275
|
-
|
|
276
|
-
### GitHub Copilot sub-agent optimization
|
|
277
|
-
|
|
278
|
-
When CLAUDE_CODE_USE_GITHUB=1, OpenClaude serializes sub-agent execution to reduce GitHub Copilot Premium Request consumption. Default behavior is GITHUB_COPILOT_MAX_SUBAGENTS=1 (synchronous, one sub-agent at a time). Tuning vars (all optional):
|
|
279
|
-
|
|
280
|
-
| Var | Effect |
|
|
281
|
-
|---|---|
|
|
282
|
-
| GITHUB_COPILOT_MAX_SUBAGENTS=0 | Suppress sub-agents entirely (sub-agents throw an error). |
|
|
283
|
-
| GITHUB_COPILOT_MAX_SUBAGENTS=1 | Force synchronous execution. **Default.** |
|
|
284
|
-
| GITHUB_COPILOT_MAX_SUBAGENTS=2..10 | Parsed/clamped but not enforced differently from =1 (any positive cap = synchronous). |
|
|
285
|
-
| GITHUB_COPILOT_ALLOW_SUBAGENTS=1 | Re-enable parallel/background sub-agents, overriding the cap. |
|
|
286
|
-
| GITHUB_COPILOT_FORCE_SYNC_SUBAGENTS=1 | Force synchronous execution regardless of cap. |
|
|
287
|
-
| GITHUB_COPILOT_OPTIMIZATION_DISABLED=1 | Disable all of the above; sub-agents run as before this feature. |
|
|
288
|
-
|
|
289
|
-
The `is_async` field reported in the `tengu_agent_tool_selected` event and the agent metadata now reflects the final execution mode (i.e., `false` when synchronous is forced). See `.env.example` for the full descriptions.
|
|
311
|
+
- 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
|
|
290
312
|
|
|
291
313
|
For best results, use models with strong tool/function calling support.
|
|
292
314
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
Custom agents can define `maxSteps` as a positive integer to cap how many tool-use steps a sub-agent may execute. When the limit is reached, OpenClaude stops additional tool calls and asks the sub-agent for a concise final summary covering completed work, findings, remaining tasks, and whether another run is needed. Omitting `maxSteps`, or setting it to an invalid value such as `0` or malformed input, preserves the default unlimited behavior.
|
|
296
|
-
|
|
297
|
-
```markdown
|
|
298
|
-
---
|
|
299
|
-
name: bounded-researcher
|
|
300
|
-
description: Use for focused research with bounded tool use
|
|
301
|
-
maxSteps: 8
|
|
302
|
-
---
|
|
303
|
-
|
|
304
|
-
You are a focused research agent.
|
|
305
|
-
```
|
|
306
|
-
|
|
307
|
-
## Agent Routing
|
|
308
|
-
|
|
309
|
-
OpenClaude can route different agents to different models through settings-based routing. This is useful for cost optimization or splitting work by model strength.
|
|
310
|
-
|
|
311
|
-
Add to `~/.openclaude.json`:
|
|
312
|
-
|
|
313
|
-
```json
|
|
314
|
-
{
|
|
315
|
-
"agentModels": {
|
|
316
|
-
"deepseek-v4-flash": {
|
|
317
|
-
"base_url": "https://api.deepseek.com/v1",
|
|
318
|
-
"api_key": "sk-your-key"
|
|
319
|
-
},
|
|
320
|
-
"zai-default": {
|
|
321
|
-
"model": "glm-5.2",
|
|
322
|
-
"base_url": "https://api.z.ai/api/coding/paas/v4",
|
|
323
|
-
"api_key": "sk-your-key"
|
|
324
|
-
},
|
|
325
|
-
"gpt-4o": {
|
|
326
|
-
"base_url": "https://api.openai.com/v1",
|
|
327
|
-
"api_key": "sk-your-key"
|
|
328
|
-
}
|
|
329
|
-
},
|
|
330
|
-
"agentRouting": {
|
|
331
|
-
"Explore": "deepseek-v4-flash",
|
|
332
|
-
"Plan": "gpt-4o",
|
|
333
|
-
"general-purpose": "gpt-4o",
|
|
334
|
-
"frontend-dev": "zai-default",
|
|
335
|
-
"default": "gpt-4o"
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
```
|
|
339
|
-
|
|
340
|
-
When no routing match is found, the global provider remains the fallback.
|
|
341
|
-
|
|
342
|
-
`agentRouting` values and explicit Agent tool `model` overrides match keys in `agentModels`. By default, that key is also the model string sent to the provider. Set `agentModels.<key>.model` when you want a local route key such as `zai-default` to call a different provider model name such as `glm-5.2`.
|
|
343
|
-
|
|
344
|
-
> **Note:** `/provider` changes the global/parent provider for your current session. `agentModels` and `agentRouting` are specifically for configuring per-agent provider overrides while keeping the parent session unchanged.
|
|
315
|
+
## Agents
|
|
345
316
|
|
|
346
|
-
|
|
317
|
+
Route different agents to different models (cost optimization, splitting work
|
|
318
|
+
by model strength), cap sub-agent tool steps with `maxSteps`, and tune GitHub
|
|
319
|
+
Copilot sub-agent behavior. All settings-driven:
|
|
347
320
|
|
|
348
|
-
|
|
321
|
+
- per-agent provider/model overrides via `agentModels` + `agentRouting` in `~/.openclaude.json`
|
|
322
|
+
- model-only routes that reuse your current provider's credentials
|
|
323
|
+
- built-in agents (`Explore`, `Plan`, `verification`) routable by type name
|
|
349
324
|
|
|
350
|
-
|
|
351
|
-
{
|
|
352
|
-
"agentModels": {
|
|
353
|
-
"mini": { "model": "gpt-5-mini" }
|
|
354
|
-
},
|
|
355
|
-
"agentRouting": {
|
|
356
|
-
"verification": "mini"
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
```
|
|
360
|
-
|
|
361
|
-
**Built-in agents are routable by their type name.** Useful keys: `verification` (the read-only auditor that runs before completion), `Explore`, and `Plan`. For example, `"agentRouting": { "verification": "mini" }` runs the verifier on `gpt-5-mini` while your main session stays on its model. Absent any entry, the verifier inherits the main-loop model.
|
|
325
|
+
See [Agent Routing and Step Limits](docs/agent-routing.md) for the full guide.
|
|
362
326
|
|
|
363
327
|
## Web Search and Fetch
|
|
364
328
|
|
|
@@ -383,42 +347,15 @@ With Firecrawl enabled:
|
|
|
383
347
|
|
|
384
348
|
Free tier at [firecrawl.dev](https://firecrawl.dev) includes 500 credits. The key is optional.
|
|
385
349
|
|
|
386
|
-
---
|
|
387
|
-
|
|
388
350
|
## Headless gRPC Server
|
|
389
351
|
|
|
390
|
-
OpenClaude can
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
```bash
|
|
397
|
-
npm run dev:grpc
|
|
398
|
-
```
|
|
399
|
-
|
|
400
|
-
#### Configuration
|
|
401
|
-
|
|
402
|
-
| Variable | Default | Description |
|
|
403
|
-
|-----------|-------------|------------------------------------------------|
|
|
404
|
-
| `GRPC_PORT` | `50051` | Port the gRPC server listens on |
|
|
405
|
-
| `GRPC_HOST` | `localhost` | Bind address. Use `0.0.0.0` to expose on all interfaces (not recommended without authentication) |
|
|
406
|
-
|
|
407
|
-
### 2. Run the Test CLI Client
|
|
408
|
-
|
|
409
|
-
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.
|
|
352
|
+
OpenClaude can run as a headless gRPC service with bidirectional streaming —
|
|
353
|
+
integrate its agentic capabilities into other applications, CI/CD pipelines,
|
|
354
|
+
or custom UIs. Start it with `npm run dev:grpc`; a test CLI client ships with
|
|
355
|
+
the repo. See [Headless gRPC Server](docs/grpc-server.md) for configuration
|
|
356
|
+
and client generation from `src/proto/openclaude.proto`.
|
|
410
357
|
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
```bash
|
|
414
|
-
npm run dev:grpc:cli
|
|
415
|
-
```
|
|
416
|
-
|
|
417
|
-
*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.*
|
|
418
|
-
|
|
419
|
-
---
|
|
420
|
-
|
|
421
|
-
## Source Build And Local Development
|
|
358
|
+
## Development
|
|
422
359
|
|
|
423
360
|
Use Node.js `>=22.0.0` and Bun `1.3.13` or newer for source builds.
|
|
424
361
|
|
|
@@ -428,59 +365,24 @@ bun run build
|
|
|
428
365
|
node dist/cli.mjs
|
|
429
366
|
```
|
|
430
367
|
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
- `bun run dev`
|
|
434
|
-
- `bun test`
|
|
435
|
-
- `bun run test:coverage`
|
|
436
|
-
- `bun run security:pr-scan -- --base origin/main`
|
|
437
|
-
- `bun run smoke`
|
|
438
|
-
- `bun run doctor:runtime`
|
|
439
|
-
- `bun run verify:privacy`
|
|
440
|
-
- focused `bun test ...` runs for the areas you touch
|
|
441
|
-
|
|
442
|
-
## Testing And Coverage
|
|
443
|
-
|
|
444
|
-
OpenClaude uses Bun's built-in test runner for unit tests.
|
|
445
|
-
|
|
446
|
-
Run the full unit suite:
|
|
447
|
-
|
|
448
|
-
```bash
|
|
449
|
-
bun test
|
|
450
|
-
```
|
|
368
|
+
Day-to-day commands:
|
|
451
369
|
|
|
452
|
-
|
|
370
|
+
- `bun run dev` — build and launch from source
|
|
371
|
+
- `bun test` — full unit suite (Bun's built-in runner)
|
|
372
|
+
- `bun test path/to/file.test.ts` — focused runs for the areas you touch
|
|
373
|
+
- `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)
|
|
374
|
+
- `bun run smoke` — smoke checks
|
|
375
|
+
- `bun run doctor:runtime`, `bun run verify:privacy`, `bun run security:pr-scan -- --base origin/main`
|
|
453
376
|
|
|
454
|
-
|
|
455
|
-
bun run test:coverage
|
|
456
|
-
```
|
|
377
|
+
Focused suites: `bun run test:provider`, `bun run test:provider-recommendation`.
|
|
457
378
|
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
```bash
|
|
461
|
-
open coverage/index.html
|
|
462
|
-
```
|
|
463
|
-
|
|
464
|
-
If you already have `coverage/lcov.info` and only want to rebuild the UI:
|
|
465
|
-
|
|
466
|
-
```bash
|
|
467
|
-
bun run test:coverage:ui
|
|
468
|
-
```
|
|
469
|
-
|
|
470
|
-
Use focused test runs when you only touch one area:
|
|
471
|
-
|
|
472
|
-
- `bun run test:provider`
|
|
473
|
-
- `bun run test:provider-recommendation`
|
|
474
|
-
- `bun test path/to/file.test.ts`
|
|
475
|
-
|
|
476
|
-
Recommended contributor validation before opening a PR:
|
|
379
|
+
Recommended validation before opening a PR:
|
|
477
380
|
|
|
478
381
|
- `bun run build`
|
|
479
382
|
- `bun run smoke`
|
|
480
|
-
- `bun run test:coverage`
|
|
383
|
+
- `bun run test:coverage` when your change affects shared runtime or provider logic
|
|
481
384
|
- focused `bun test ...` runs for the files and flows you changed
|
|
482
385
|
|
|
483
|
-
Coverage output is written to `coverage/lcov.info`, and OpenClaude also generates a git-activity-style heatmap at `coverage/index.html`.
|
|
484
386
|
## Repository Structure
|
|
485
387
|
|
|
486
388
|
- `src/` - core CLI/runtime
|
|
@@ -492,7 +394,7 @@ Coverage output is written to `coverage/lcov.info`, and OpenClaude also generate
|
|
|
492
394
|
|
|
493
395
|
## VS Code Extension
|
|
494
396
|
|
|
495
|
-
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
|
|
397
|
+
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).
|
|
496
398
|
|
|
497
399
|
## Security
|
|
498
400
|
|
|
@@ -505,15 +407,9 @@ If you believe you found a security issue, see [SECURITY.md](SECURITY.md).
|
|
|
505
407
|
|
|
506
408
|
## Contributing
|
|
507
409
|
|
|
508
|
-
Contributions are welcome.
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
- `bun run build`
|
|
513
|
-
- `bun run test:coverage`
|
|
514
|
-
- `bun run smoke`
|
|
515
|
-
- focused `bun test ...` runs for files and flows you changed
|
|
516
|
-
|
|
410
|
+
Contributions are welcome. For larger changes, open an issue first so the
|
|
411
|
+
scope is clear before implementation. See [Development](#development) for the
|
|
412
|
+
build, test, and pre-PR validation commands.
|
|
517
413
|
|
|
518
414
|
## Disclaimer
|
|
519
415
|
|