npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@khalilgao/openclaude-cn

v1.0.5

Published

用国产大模型驱动 Claude Code — 通义千问、DeepSeek、智谱 GLM、小米 MiMo,开箱即用

Readme

OpenClaude CN

用国产大模型驱动 Claude Code 的全部能力 —— 通义千问、DeepSeek、智谱 GLM、小米 MiMo,开箱即用。

基于 OpenClaude,增加了国产模型预设、中文配置向导,以及对 Ollama 本地模型的支持。Claude Code 的所有工具(Bash、文件读写、搜索、Agent、MCP)照常工作,只是底层换成了你选择的模型。


安装

方式一:npm 安装(推荐)

npm i -g @khalilgao/openclaude-cn

安装后直接运行:

openclaude-cn
# 或
openclaude

更新到最新版:

npm update -g @khalilgao/openclaude-cn

方式二:从源码构建

需要 Bun 运行时(v1.0+)。

git clone https://github.com/Autumn1337/openclaude-cn.git
cd openclaude-cn
bun install
bun run build

快速开始

方式一:直接启动(推荐)

node dist/cli.mjs

首次启动时,如果没有检测到任何 API 配置,会自动弹出配置向导

选择一个 provider。首次裸启动只会出现一次,之后会直接读取保存的 profile。

❯ DeepSeek                    https://api.deepseek.com
  Qwen (DashScope)            https://dashscope.aliyuncs.com/compatible-mode/v1
  Zhipu GLM                   https://open.bigmodel.cn/api/paas/v4/
  Xiaomi MiMo                 https://api.xiaomimimo.com/v1
  Custom OpenAI-Compatible    手动填写 Base URL、API Key 和 model
  Ollama                      本地 OpenAI 兼容服务

选择服务商 → 输入 API Key → 选择模型 → 配置自动保存,下次启动直接进入。

方式二:环境变量

如果你更喜欢手动配置:

export CLAUDE_CODE_USE_OPENAI=1
export OPENAI_API_KEY=你的key
export OPENAI_BASE_URL=https://api.deepseek.com
export OPENAI_MODEL=deepseek-chat

node dist/cli.mjs

方式三:配置脚本

# 先配置
bun run setup:cn

# 再启动
bun run dev:profile

对话中切换模型和服务商

配置不是一次性的。在对话过程中随时可以切换:

/provider — 切换服务商

输入 /provider 会弹出交互式选择器:

❯ DeepSeek                  ✓ 当前活跃 · deepseek-chat
  通义千问 (Qwen)            ✗ 未配置 key
  智谱 GLM                   ✓ key 已配置
  小米 MiMo                  ✗ 未配置 key
  Ollama (本地)              无需 key
  • 选中有 key 的服务商 → 直接切换
  • 选中没有 key 的服务商 → 弹出输入框填 key → 保存 → 切换
  • Esc 取消

快捷命令(不弹 UI):

/provider key zhipu your-api-key    # 保存某个服务商的 key
/provider set zhipu                 # 直接切换到该服务商

/model — 切换模型

输入 /model 会列出当前服务商的所有可用模型:

  • 预设模型标 [推荐]
  • 首次打开后会后台请求 /v1/models 获取完整模型列表
  • 支持跨服务商切换(选了其他服务商的模型会自动切 base URL 和 key)

多 Key 管理

所有 API Key 保存在 ~/.claude/provider-keys.json,按服务商 ID 索引。切换服务商时自动加载对应的 key,不需要重复输入。


支持的国产模型

通义千问 (Qwen3.5)

| 模型 | 说明 | 上下文 | |------|------|--------| | qwen3.5-plus | 旗舰模型,支持推理 | 128K | | qwen3.5-flash | 快速模型 | 128K |

API 地址:https://dashscope.aliyuncs.com/compatible-mode/v1 获取 Key:阿里云百炼平台

DeepSeek

| 模型 | 说明 | 上下文 | |------|------|--------| | deepseek-chat | DeepSeek-V3.2 对话模型 | 128K | | deepseek-reasoner | DeepSeek-V3.2 推理模型 | 128K |

API 地址:https://api.deepseek.com 获取 Key:DeepSeek 开放平台

智谱 GLM

| 模型 | 说明 | 上下文 | |------|------|--------| | glm-5 | 旗舰模型,支持推理 | 128K | | glm-5-turbo | 快速模型 | 128K | | glm-4.7-flash | 免费模型 | 32K |

API 地址:https://open.bigmodel.cn/api/paas/v4/ 获取 Key:智谱 AI 开放平台

小米 MiMo

| 模型 | 说明 | 上下文 | |------|------|--------| | mimo-v2-pro | 旗舰推理模型 | 1M | | mimo-v2-flash | 快速模型 | 128K | | mimo-v2-omni | 多模态模型 | 128K |

API 地址:https://api.xiaomimimo.com/v1 获取 Key:小米 MiMo 开放平台

Ollama (本地模型)

无需 API Key,需要本地运行 Ollama。

ollama pull qwen2.5:72b

API 地址:http://localhost:11434/v1


模型能力对比

| 模型 | 工具调用 | 代码质量 | 速度 | 推荐场景 | |------|---------|---------|------|---------| | DeepSeek-V3.2 | 优秀 | 优秀 | 快 | 日常开发首选 | | Qwen3.5 Plus | 优秀 | 优秀 | 快 | 推理任务 | | GLM-5 | 优秀 | 良好 | 快 | 中文理解 | | MiMo-V2 Pro | 优秀 | 良好 | 快 | 超长上下文(1M) | | GPT-4o | 优秀 | 优秀 | 快 | 综合最强 | | Qwen3.5 Flash | 良好 | 良好 | 很快 | 快速迭代 | | GLM-4.7 Flash | 良好 | 良好 | 很快 | 免费使用 | | 7B 以下模型 | 有限 | 有限 | 很快 | 简单任务/测试 |

建议使用支持 function calling 的模型。工具调用是核心能力,不支持的模型体验会大幅下降。


所有功能

Claude Code 的完整功能集均可使用:

  • Shell 执行:Bash、PowerShell 命令执行
  • 文件操作:读取、写入、编辑、搜索(Glob/Grep)
  • 工具链:模型调用工具 → 获取结果 → 继续推理,多步自动完成
  • Agent:子 Agent 派生,使用相同 provider
  • MCP:Model Context Protocol 服务器集成
  • 斜杠命令/commit/review/compact/diff/doctor/model/provider
  • 流式输出:实时 token 流式显示
  • 持久记忆:跨会话记忆系统

与原版 Claude Code 的差异

  • 无 Anthropic 专属的 extended thinking(国产模型使用各自的推理模式)
  • 无 prompt caching(Anthropic 专属功能)
  • 输出默认上限 32K tokens
  • 系统提示词已替换为通用 AI 助手身份

其他 Provider

除了国产模型,也支持所有 OpenAI 兼容服务:

OpenAI

export CLAUDE_CODE_USE_OPENAI=1
export OPENAI_API_KEY=sk-...
export OPENAI_MODEL=gpt-4o

Codex (ChatGPT)

export CLAUDE_CODE_USE_OPENAI=1
export OPENAI_MODEL=codexplan
# 自动读取 ~/.codex/auth.json 或设置 CODEX_API_KEY

Google Gemini (via OpenRouter)

export CLAUDE_CODE_USE_OPENAI=1
export OPENAI_API_KEY=sk-or-...
export OPENAI_BASE_URL=https://openrouter.ai/api/v1
export OPENAI_MODEL=google/gemini-2.0-flash

LM Studio / Together AI / Groq / Mistral / Azure OpenAI

设置对应的 OPENAI_BASE_URLOPENAI_API_KEY 即可。


环境变量参考

| 变量 | 必需 | 说明 | |------|------|------| | CLAUDE_CODE_USE_OPENAI | 自动配置* | 设为 1 启用 OpenAI 兼容模式 | | OPENAI_API_KEY | 自动配置* | API Key(本地模型不需要) | | OPENAI_MODEL | 自动配置* | 模型名称 | | OPENAI_BASE_URL | 自动配置* | API 地址 |

* 使用配置向导或 /provider 命令时自动设置,无需手动配。

配置持久化路径:

  • 会话配置:.openclaude-profile.json(项目目录)
  • API Key 存储:~/.claude/provider-keys.json(用户目录,不会被 git 提交)

工作原理

Claude Code 工具系统
        |
        v
  Anthropic SDK 接口 (duck-typed)
        |
        v
  openaiShim.ts  ← 格式转换层
        |
        v
  OpenAI Chat Completions API
        |
        v
  任意兼容模型 (DeepSeek / Qwen / GLM / MiMo / Ollama / ...)

核心是一个 724 行的 shim 层(src/services/api/openaiShim.ts),在 Anthropic SDK 调用处拦截请求,翻译为 OpenAI 格式,再把响应翻译回来。上层代码完全无感知。


来源与声明

Fork 自 OpenClaude,基于 2026-03-31 通过 npm source map 公开的 Claude Code 源码。

原始 Claude Code 源码版权属于 Anthropic。本仓库与 Anthropic 无关,仅供教育和研究用途。

License

原始源码受 Anthropic 条款约束。OpenAI shim 和国产模型预设部分为公共领域。