@xkei/openclaude 0.30.0-antigravity

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.
Files changed (37) hide show
  1. package/LICENSE +29 -0
  2. package/README.md +518 -0
  3. package/bin/import-specifier.mjs +13 -0
  4. package/bin/import-specifier.test.mjs +13 -0
  5. package/bin/node-compile-cache.mjs +17 -0
  6. package/bin/openclaude +126 -0
  7. package/dist/cli.mjs +11292 -0
  8. package/dist/sdk.mjs +284293 -0
  9. package/docs/antigravity-plugin-install.md +223 -0
  10. package/docs/windows-aliases-and-launchers.md +162 -0
  11. package/package.json +226 -0
  12. package/scripts/windows/openclaude-aliases.ps1 +206 -0
  13. package/src/entrypoints/sdk/coreTypes.generated.ts +2385 -0
  14. package/src/entrypoints/sdk.d.ts +601 -0
  15. package/vendor/node-domexception-shim/index.js +3 -0
  16. package/vendor/node-domexception-shim/package.json +8 -0
  17. package/vendor/openclaude-antigravity-provider/.claude-plugin/marketplace.json +17 -0
  18. package/vendor/openclaude-antigravity-provider/.claude-plugin/plugin.json +38 -0
  19. package/vendor/openclaude-antigravity-provider/bin/antigravity-proxy.exe +0 -0
  20. package/vendor/openclaude-antigravity-provider/hooks/SessionEnd.ps1 +22 -0
  21. package/vendor/openclaude-antigravity-provider/hooks/SessionStart.ps1 +111 -0
  22. package/vendor/openclaude-antigravity-provider/hooks/Watchdog-Stop.ps1 +82 -0
  23. package/vendor/openclaude-antigravity-provider/hooks/hooks.json +37 -0
  24. package/vendor/openclaude-antigravity-provider/hooks/inject-provider.js +110 -0
  25. package/vendor/openclaude-antigravity-provider/hooks/session-end.bat +22 -0
  26. package/vendor/openclaude-antigravity-provider/hooks/start.bat +7 -0
  27. package/vendor/openclaude-antigravity-provider/package.json +24 -0
  28. package/vendor/openclaude-antigravity-provider/src/accounts.ts +115 -0
  29. package/vendor/openclaude-antigravity-provider/src/auth-cli.ts +125 -0
  30. package/vendor/openclaude-antigravity-provider/src/auth.ts +221 -0
  31. package/vendor/openclaude-antigravity-provider/src/config.ts +68 -0
  32. package/vendor/openclaude-antigravity-provider/src/constants.ts +139 -0
  33. package/vendor/openclaude-antigravity-provider/src/gemini-fallback.ts +157 -0
  34. package/vendor/openclaude-antigravity-provider/src/server.ts +367 -0
  35. package/vendor/openclaude-antigravity-provider/src/storage.ts +56 -0
  36. package/vendor/openclaude-antigravity-provider/src/transform.ts +241 -0
  37. package/vendor/openclaude-antigravity-provider/tsconfig.json +15 -0
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 ADDED
@@ -0,0 +1,518 @@
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="Gitlawb%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="Gitlawb%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="Gitlawb%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/stepanusjanu19/openclaude_antigravity_support/actions/workflows/pr-checks.yml/badge.svg?branch=master)](https://github.com/stepanusjanu19/openclaude_antigravity_support/actions/workflows/pr-checks.yml)
16
+ [![Release](https://img.shields.io/github/v/tag/stepanusjanu19/openclaude_antigravity_support?label=release&color=0ea5e9)](https://github.com/stepanusjanu19/openclaude_antigravity_support/tags)
17
+ [![npm downloads](https://img.shields.io/npm/dm/@xkei/openclaude)](https://www.npmjs.com/package/@xkei/openclaude)
18
+ [![Discussions](https://img.shields.io/badge/discussions-open-7c3aed)](https://github.com/stepanusjanu19/openclaude_antigravity_support/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 GitLawb:
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://gitlawb.com">
35
+ <img src="https://gitlawb.com/logo.png" alt="GitLawb 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://gitlawb.com"><strong>GitLawb</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 @xkei/openclaude@latest
134
+ ```
135
+
136
+ If you're on Arch Linux, you can install OpenClaude from the community-maintained [AUR package](https://aur.archlinux.org/packages/openclaude):
137
+ ```bash
138
+ paru -S openclaude
139
+ ```
140
+
141
+ If the install later reports `ripgrep not found`, install ripgrep system-wide and confirm `rg --version` works in the same terminal before starting OpenClaude.
142
+
143
+ **Verify / troubleshoot installed version:**
144
+
145
+ ```bash
146
+ openclaude --version
147
+ npm view @xkei/openclaude dist-tags
148
+ npm install -g @xkei/openclaude@latest
149
+ ```
150
+
151
+ ### Start
152
+
153
+ ```bash
154
+ openclaude
155
+ ```
156
+
157
+ Inside OpenClaude:
158
+
159
+ - run `/provider` for guided provider setup and saved profiles
160
+ - run `/onboard-github` for GitHub Models onboarding
161
+
162
+ > **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.
163
+
164
+ ### Resume or fork a conversation
165
+
166
+ Resume an existing conversation by session ID, or continue the most recent
167
+ conversation in the current directory:
168
+
169
+ ```bash
170
+ openclaude --resume <session-id>
171
+ openclaude --continue
172
+ ```
173
+
174
+ Add `--fork-session` to branch the conversation history into a new session ID
175
+ instead of reusing the original transcript:
176
+
177
+ ```bash
178
+ openclaude --resume <session-id> --fork-session
179
+ openclaude --continue --fork-session
180
+ ```
181
+
182
+ Forking is conversation branching only. It does not create filesystem isolation,
183
+ copy your working tree, or create a git worktree branch.
184
+
185
+ ### Background sessions
186
+
187
+ Run long non-interactive prompts detached from the current terminal:
188
+
189
+ ```bash
190
+ openclaude --bg "fix failing tests"
191
+ openclaude --bg --name auth-refactor "refactor auth middleware"
192
+ openclaude ps
193
+ openclaude logs auth-refactor
194
+ openclaude logs auth-refactor -f
195
+ openclaude kill auth-refactor
196
+ ```
197
+
198
+ Background sessions are local child processes. OpenClaude does not start a daemon
199
+ or network service, and permission/provider/model/settings flags are passed to
200
+ the child process the same way they are for a foreground `--print` run. Session
201
+ metadata and logs are stored under the resolved OpenClaude config directory,
202
+ usually `~/.openclaude/bg-sessions/`; `OPENCLAUDE_CONFIG_DIR` can point
203
+ OpenClaude somewhere else. `CLAUDE_CONFIG_DIR` is ignored for OpenClaude
204
+ background-session storage. Session names can be reused after older sessions
205
+ reach a terminal state; use the session ID to inspect older logs with the same
206
+ name. A naturally finished session is recorded as `exited` when its process
207
+ returns zero and `failed` when it returns nonzero or handles a termination
208
+ signal. `stale` remains the conservative result when the process disappears
209
+ without an observed outcome; an explicit successful `openclaude kill` is
210
+ recorded as `killed`, and `killed` takes precedence over a natural `exited` or
211
+ `failed` outcome for the same process. Terminal outcomes are stored separately
212
+ under `bg-sessions/terminal/`; deleting that directory makes finished sessions
213
+ fall back to liveness-derived status. OpenClaude does not infer POSIX signal
214
+ names on Windows.
215
+ Unobservable force termination, host crashes, and power loss remain `stale` on
216
+ every platform.
217
+
218
+ `openclaude attach <id-or-name>` currently reports the matching session and
219
+ points to `openclaude logs <id> -f`; full terminal reattach is not implemented
220
+ for local background sessions yet.
221
+
222
+ ### OpenClaude config cutover
223
+
224
+ OpenClaude stores its own config under `~/.openclaude` and `~/.openclaude.json`
225
+ by default. It does not read `~/.claude`, project `.claude/` directories, or
226
+ `CLAUDE_CONFIG_DIR`; new users can start with an empty OpenClaude config and do
227
+ not need Claude Code installed.
228
+
229
+ If you previously used OpenClaude with `.claude` paths, migrate intentionally:
230
+ copy only the settings, commands, agents, skills, scheduled tasks, or other files
231
+ you personally created for OpenClaude into the matching `.openclaude` location.
232
+ Do not blanket-copy `.claude`, and do not copy Claude Code credentials or auth
233
+ files. For provider authentication, prefer running OpenClaude's provider setup
234
+ again or exporting provider-specific environment variables.
235
+
236
+ ### Fastest OpenAI setup
237
+
238
+ macOS / Linux:
239
+
240
+ ```bash
241
+ export CLAUDE_CODE_USE_OPENAI=1
242
+ export OPENAI_API_KEY=sk-your-key-here
243
+ export OPENAI_MODEL=gpt-4o
244
+
245
+ openclaude
246
+ ```
247
+
248
+ Windows PowerShell:
249
+
250
+ ```powershell
251
+ $env:CLAUDE_CODE_USE_OPENAI="1"
252
+ $env:OPENAI_API_KEY="sk-your-key-here"
253
+ $env:OPENAI_MODEL="gpt-4o"
254
+
255
+ openclaude
256
+ ```
257
+
258
+ ### Fastest local Ollama setup
259
+
260
+ macOS / Linux:
261
+
262
+ ```bash
263
+ export CLAUDE_CODE_USE_OPENAI=1
264
+ export OPENAI_BASE_URL=http://localhost:11434/v1
265
+ export OPENAI_MODEL=qwen2.5-coder:7b
266
+
267
+ openclaude
268
+ ```
269
+
270
+ Windows PowerShell:
271
+
272
+ ```powershell
273
+ $env:CLAUDE_CODE_USE_OPENAI="1"
274
+ $env:OPENAI_BASE_URL="http://localhost:11434/v1"
275
+ $env:OPENAI_MODEL="qwen2.5-coder:7b"
276
+
277
+ openclaude
278
+ ```
279
+
280
+ For Ollama, OpenClaude uses Ollama's native chat API and requests a 32768-token
281
+ context window on each chat request so same-session history is not silently
282
+ truncated by Ollama's OpenAI-compatible shim. Set `OPENCLAUDE_OLLAMA_NUM_CTX`
283
+ or `OLLAMA_CONTEXT_LENGTH` if you need a different request-level context size.
284
+ See [Advanced Setup](docs/advanced-setup.md#ollama-context-length) for
285
+ verification with `ollama ps`.
286
+
287
+ ## Setup Guides
288
+
289
+ Beginner-friendly guides:
290
+
291
+ - [Non-Technical Setup](docs/non-technical-setup.md)
292
+ - [Windows Quick Start](docs/quick-start-windows.md)
293
+ - [macOS / Linux Quick Start](docs/quick-start-mac-linux.md)
294
+
295
+ Advanced and source-build guides:
296
+
297
+ - [Advanced Setup](docs/advanced-setup.md)
298
+ - [Smart Auto-Routing](docs/smart-routing.md)
299
+ - [Agent Routing and Step Limits](docs/agent-routing.md)
300
+ - [Headless gRPC Server](docs/grpc-server.md)
301
+ - [Repo Map (codebase intelligence)](docs/repo-map.md)
302
+ - [Android Install](ANDROID_INSTALL.md)
303
+
304
+ ## Supported Providers
305
+
306
+ | Provider | Setup Path | Notes |
307
+ | --- | --- | --- |
308
+ | OpenAI-compatible | `/provider` or env vars | Works with OpenAI, OpenRouter, DeepSeek, Groq, Mistral, LM Studio, and other compatible `/v1` servers |
309
+ | Z.AI GLM Coding Plan | `/provider` or OpenAI-compatible env vars | Uses `OPENAI_API_KEY` at `https://api.z.ai/api/coding/paas/v4` and defaults to `glm-5.2` |
310
+ | 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 |
311
+ | 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 |
312
+ | 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 |
313
+ | 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 |
314
+ | Hicap | `/provider` or OpenAI-compatible env vars | Uses `api-key` auth, discovers models from unauthenticated `/models`, and supports Responses mode for `gpt-` models |
315
+ | Fireworks AI | `/provider` or env vars | First-class provider with 276 curated models (DeepSeek, Qwen, Llama, Gemma, and more); uses `FIREWORKS_API_KEY` |
316
+ | 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` |
317
+ | 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` |
318
+ | Gemini | `/provider` or env vars | Supports API key only |
319
+ | GitHub Models | `/onboard-github` | Interactive onboarding with saved credentials |
320
+ | Codex OAuth | `/provider` | Opens ChatGPT sign-in in your browser and stores Codex credentials securely |
321
+ | Codex | `/provider` | Uses existing Codex CLI auth, OpenClaude secure storage, or env credentials |
322
+ | 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` |
323
+ | 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 |
324
+ | 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 |
325
+ | 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` |
326
+ | 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` |
327
+ | 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. |
328
+ | Ollama | `/provider` or env vars | Local inference with no API key |
329
+ | Atomic Chat | `/provider`, env vars, or `bun run dev:atomic-chat` | Local Model Provider; auto-detects loaded models |
330
+ | Bedrock / Vertex / Foundry | env vars | Anthropic-family cloud routes; Vertex is for Claude on Vertex AI, not arbitrary Model Garden models |
331
+
332
+ ## What Works
333
+
334
+ - **Tool-driven coding workflows**: Bash, file read/write/edit, grep, glob, agents, tasks, MCP, and slash commands
335
+ - **Streaming responses**: Real-time token output and tool progress
336
+ - **Tool calling**: Multi-step tool loops with model calls, tool execution, and follow-up responses
337
+ - **Images**: URL and base64 image inputs for providers that support vision
338
+ - **Provider profiles**: Guided setup plus saved user-level provider profile support
339
+ - **Local and remote model backends**: Cloud APIs, local servers, and Apple Silicon local inference
340
+ - **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.
341
+ - **A companion with signature moves**: A truecolor pixel-art hero who lives beside your prompt and reacts when you work. See below.
342
+
343
+ ## Meet Your Buddy
344
+
345
+ Run `/buddy` to hatch a companion — a truecolor pixel-art hero who stands
346
+ beside your prompt, idles, blinks, and fires their signature move every time
347
+ you submit a message:
348
+
349
+ ```
350
+ /buddy hatch (first run) or pet your companion
351
+ /buddy set robinhood the green archer — arrow shot on every Enter
352
+ /buddy set kaio gold-haired warrior — charges a full-width energy wave
353
+ /buddy set strawhat stretchy punch that snaps back
354
+ /buddy set merlin twinkling sparkle stream
355
+ /buddy set kage spinning shuriken
356
+ /buddy set ember dragon fire with a real heat gradient
357
+ /buddy set corsair cannonball with smoke trail
358
+ /buddy name Robin rename your companion
359
+ /buddy set random back to your rolled hero
360
+ ```
361
+
362
+ Companions respect `prefersReducedMotion`, degrade gracefully to line art in
363
+ low-color terminals, and can be silenced with `/buddy mute`. Requires a
364
+ terminal at least 100 columns wide for the full sprite.
365
+
366
+ ## Provider Notes
367
+
368
+ OpenClaude supports multiple providers, but behavior is not identical across all of them.
369
+
370
+ - Anthropic-specific features may not exist on other providers
371
+ - Tool quality depends heavily on the selected model
372
+ - Smaller local models can struggle with long multi-step tool flows
373
+ - Some providers impose lower output caps than the CLI defaults, and OpenClaude adapts where possible
374
+ - AI/ML API uses the OpenAI-compatible route, defaults to `gpt-4o`, and only surfaces chat-capable models from its public catalog
375
+ - 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`.
376
+ - Z.AI GLM Coding Plan uses `https://api.z.ai/api/coding/paas/v4` with `glm-5.2` by default. GLM-5.3 is selectable as `glm-5.3`; use `glm-5.3?reasoning=low`, `glm-5.3?reasoning=high`, or `glm-5.3?reasoning=xhigh` to request its documented low, high, or maximum effort. The existing GLM-5.2 query controls remain supported.
377
+ - Xiaomi MiMo uses `api-key` header auth on the direct OpenAI-compatible route and currently does not support `/usage` reporting in OpenClaude
378
+ - 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
379
+
380
+ For best results, use models with strong tool/function calling support.
381
+
382
+
383
+
384
+ ## Agents
385
+
386
+ Route different agents to different models (cost optimization, splitting work
387
+ by model strength), cap sub-agent tool steps with `maxSteps`, and tune GitHub
388
+ Copilot sub-agent behavior. Configured via settings, agent frontmatter, and
389
+ environment variables:
390
+
391
+ - per-agent provider/model overrides via `agentModels` + `agentRouting` in `~/.openclaude/settings.json`
392
+ - model-only routes that reuse your current provider's credentials
393
+ - 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
394
+
395
+ See [Agent Routing and Step Limits](docs/agent-routing.md) for the full guide.
396
+
397
+ ## Web Search and Fetch
398
+
399
+ 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.
400
+
401
+ > **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.
402
+
403
+ For Anthropic-native backends and Codex responses, OpenClaude keeps the native provider web search behavior.
404
+
405
+ `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.
406
+
407
+ Set a [Firecrawl](https://firecrawl.dev) API key if you want Firecrawl-powered search/fetch behavior:
408
+
409
+ ```bash
410
+ export FIRECRAWL_API_KEY=your-key-here
411
+ ```
412
+
413
+ With Firecrawl enabled:
414
+
415
+ - `WebSearch` can use Firecrawl's search API while DuckDuckGo remains the default free path for non-Claude models
416
+ - `WebFetch` uses Firecrawl's scrape endpoint instead of raw HTTP, handling JS-rendered pages correctly
417
+
418
+ Free tier at [firecrawl.dev](https://firecrawl.dev) includes 500 credits. The key is optional.
419
+
420
+ ## Headless gRPC Server
421
+
422
+ OpenClaude can run as a headless gRPC service with bidirectional streaming —
423
+ integrate its agentic capabilities into other applications, CI/CD pipelines,
424
+ or custom UIs. Start it with `npm run dev:grpc`; a test CLI client ships with
425
+ the repo. See [Headless gRPC Server](docs/grpc-server.md) for configuration
426
+ and client generation from `src/proto/openclaude.proto`.
427
+
428
+ ## Development
429
+
430
+ Use Node.js `>=22.0.0` and Bun `1.3.13` or newer for source builds.
431
+
432
+ ```bash
433
+ bun install
434
+ bun run build
435
+ node dist/cli.mjs
436
+ ```
437
+
438
+ Day-to-day commands:
439
+
440
+ - `bun run dev` — build and launch from source
441
+ - `bun test` — full unit suite (Bun's built-in runner)
442
+ - `bun test path/to/file.test.ts` — focused runs for the areas you touch
443
+ - `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)
444
+ - `bun run smoke` — smoke checks
445
+ - `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)
446
+
447
+ Focused suites: `bun run test:provider`, `bun run test:provider-recommendation`.
448
+
449
+ To benchmark the launcher module compile cache, build the CLI and run:
450
+
451
+ ```bash
452
+ bun run build
453
+ bun run benchmark:startup
454
+ ```
455
+
456
+ The benchmark requires Node `>=22.8.0`, where the compile-cache API was added;
457
+ the built OpenClaude launcher continues to support the declared Node `>=22.0.0`
458
+ runtime range.
459
+
460
+ The benchmark defaults to 30 separate-process warm runs and 10 isolated
461
+ empty-cache runs. It reports the median, IQR, MAD, first cache-populating run,
462
+ first warm-up, Node/OS/CPU details, bundle size, and commit. Direct bundle
463
+ timings are included only as a secondary diagnostic; the full launcher result
464
+ is the decision signal. Use
465
+ `bun run benchmark:startup -- --warm-runs 40 --cold-runs 10` to request a
466
+ larger sample set. The benchmark records results without enforcing a timing
467
+ threshold in CI.
468
+
469
+ OpenClaude leaves Node's standard compile-cache controls authoritative. Set
470
+ `NODE_DISABLE_COMPILE_CACHE=1` to disable the optimization, including for V8
471
+ coverage runs that require uncached compilation.
472
+
473
+ 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:
474
+
475
+ - `bun run build`
476
+ - `bun run smoke`
477
+ - `bun run test:coverage` when your change affects shared runtime or provider logic
478
+ - focused `bun test ...` runs for the files and flows you changed
479
+
480
+ ## Repository Structure
481
+
482
+ - `src/` - core CLI/runtime
483
+ - `scripts/` - build, verification, and maintenance scripts
484
+ - `docs/` - setup, contributor, and project documentation
485
+ - `vscode-extension/openclaude-vscode/` - VS Code extension
486
+ - `.github/` - repo automation, templates, and CI configuration
487
+ - `bin/` - CLI launcher entrypoints
488
+
489
+ ## VS Code Extension
490
+
491
+ 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).
492
+
493
+ ## Security
494
+
495
+ If you believe you found a security issue, see [SECURITY.md](SECURITY.md).
496
+
497
+ ## Community
498
+
499
+ - Use [GitHub Discussions](https://github.com/stepanusjanu19/openclaude_antigravity_support/discussions) for Q&A, ideas, and community conversation
500
+ - Use [GitHub Issues](https://github.com/stepanusjanu19/openclaude_antigravity_support/issues) for confirmed bugs and actionable feature work
501
+ - Join the [Discord](https://discord.gg/k68zFR6AcB) to chat with the community in real time
502
+ - Follow [@gitlawb on X](https://x.com/gitlawb) for updates and announcements
503
+
504
+ ## Contributing
505
+
506
+ Contributions are welcome. For larger changes, open an issue first so the
507
+ scope is clear before implementation. See [Development](#development) for the
508
+ build, test, and pre-PR validation commands.
509
+
510
+ ## Disclaimer
511
+
512
+ OpenClaude is an independent community project and is not affiliated with, endorsed by, or sponsored by Anthropic.
513
+
514
+ 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.
515
+
516
+ ## License
517
+
518
+ MIT for OpenClaude contributors' modifications; the derived Claude Code remains Anthropic's. [See more](LICENSE).
@@ -0,0 +1,13 @@
1
+ import { join, win32 } from 'path'
2
+ import { pathToFileURL } from 'url'
3
+
4
+ export function getDistImportSpecifier(baseDir) {
5
+ if (/^[A-Za-z]:\\/.test(baseDir)) {
6
+ const distPath = win32.join(baseDir, '..', 'dist', 'cli.mjs')
7
+ return `file:///${distPath.replace(/\\/g, '/')}`
8
+ }
9
+
10
+ const joinImpl = join
11
+ const distPath = joinImpl(baseDir, '..', 'dist', 'cli.mjs')
12
+ return pathToFileURL(distPath).href
13
+ }
@@ -0,0 +1,13 @@
1
+ import assert from 'node:assert/strict'
2
+ import test from 'node:test'
3
+
4
+ import { getDistImportSpecifier } from './import-specifier.mjs'
5
+
6
+ test('builds a file URL import specifier for dist/cli.mjs', () => {
7
+ const specifier = getDistImportSpecifier('C:\\repo\\bin')
8
+
9
+ assert.equal(
10
+ specifier,
11
+ 'file:///C:/repo/dist/cli.mjs',
12
+ )
13
+ })
@@ -0,0 +1,17 @@
1
+ import * as nodeModule from 'node:module'
2
+
3
+ /** @typedef {{ enableCompileCache?: () => unknown }} CompileCacheModule */
4
+
5
+ /**
6
+ * @param {CompileCacheModule} [module=nodeModule]
7
+ */
8
+ export function enableNodeCompileCacheIfAvailable(module = nodeModule) {
9
+ const enable = module.enableCompileCache
10
+ if (typeof enable !== 'function') return
11
+
12
+ try {
13
+ enable()
14
+ } catch {
15
+ // Compile caching is optional and must never block startup.
16
+ }
17
+ }