Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .changeset/olive-pugs-attack.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"openwiki": minor
---

feat: add a `claude-code` provider that routes inference through the local Claude Code CLI

Adds a keyless inference provider for users who cannot provision an Anthropic API key — notably Claude Team and Enterprise members whose plan does not grant API key creation. Selecting `Claude Code (local CLI)` during `openwiki --init` reuses the existing `claude auth login` session; OpenWiki never reads or persists a token.

Claude Code ships its own agent loop, so the bridge constrains it to a single model turn: OpenWiki's DeepAgents tools are exposed through an in-process MCP server, Claude Code's built-in tools are disabled, and `canUseTool` captures the resulting tool call and hands it back to the OpenWiki agent loop for execution. This keeps the virtual filesystem backend, OKF middleware, and translation middleware in control of the run.
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,29 @@ notes.

## Customizing

OpenWiki supports OpenAI (with an API key or a ChatGPT login), OpenRouter, Gemini (AI Studio), Gemini Enterprise (Vertex AI), Nebius Token Factory, Fireworks, Baseten, NVIDIA NIM, an OpenAI-compatible provider, AWS Bedrock, Anthropic, and GitHub Copilot out of the box. The onboarding default is OpenAI with `gpt-5.6-terra`, and each inference provider also includes pre-defined model options plus support for custom model IDs.
OpenWiki supports OpenAI (with an API key or a ChatGPT login), OpenRouter, Gemini (AI Studio), Gemini Enterprise (Vertex AI), Nebius Token Factory, Fireworks, Baseten, NVIDIA NIM, an OpenAI-compatible provider, AWS Bedrock, Anthropic (with an API key or a Claude Code login), and GitHub Copilot out of the box. The onboarding default is OpenAI with `gpt-5.6-terra`, and each inference provider also includes pre-defined model options plus support for custom model IDs.

### Claude Code (local CLI)

The `claude-code` provider routes inference through the [Claude Code](https://claude.com/claude-code) CLI installed on your machine, reusing its existing session instead of an Anthropic API key. This is aimed at Claude Team and Enterprise members whose plan does not let them create API keys, and at anyone who would rather spend an existing Claude Code seat than provision separate API credit.

1. Install Claude Code and run `claude auth login`.
2. Select `Claude Code (local CLI)` as the provider during `openwiki --init`. OpenWiki detects the existing session automatically; press <kbd>Tab</kbd> at the credential prompt to run `claude auth login` if you are not signed in yet.
3. Choose a model (for example `claude-opus-5`).

The resulting configuration is entirely keyless:

```env
OPENWIKI_PROVIDER="claude-code"
OPENWIKI_MODEL_ID="claude-opus-5"
```

Two things are worth knowing before you pick this provider:

- **The session stays in the CLI.** OpenWiki never reads, copies, or persists a Claude Code token — it spawns the CLI through the Claude Agent SDK and lets the SDK use whatever session is already there. Nothing is written to `~/.openwiki/.env`.
- **It is interactive-only, and slower.** The Agent SDK accepts user messages but cannot replay prior assistant turns, so each agent step re-sends the transcript rather than resuming a session. Claude Code's prompt cache absorbs most of the repeated cost, but expect a wiki build to be slower than the `anthropic` provider and to draw on your subscription's rate limits. For CI, use `anthropic` with an API key.

Claude Code's own tools are disabled for these runs and its project settings (`CLAUDE.md`, settings files) are not loaded, so the wiki is generated from OpenWiki's prompts and DeepAgents' virtual filesystem backend alone.

### GitHub Copilot

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"typecheck": "tsc --noEmit -p tsconfig.json"
},
"dependencies": {
"@anthropic-ai/claude-agent-sdk": "0.3.218",
"@anthropic-ai/vertex-sdk": "^0.19.0",
"@aws-sdk/client-bedrock-runtime": "^3.1080.0",
"@langchain/anthropic": "^1.5.1",
Expand Down
Loading
Loading