Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
d800fc3
docs: add claude-code-cn brainstorming design spec
claude May 12, 2026
6ef1cd9
docs: add claude-code-cn implementation plan
claude May 12, 2026
c597661
chore: scaffold TS toolchain (tsup, vitest, biome, pnpm)
Qsnh May 12, 2026
6263c68
feat(utils): add path helpers for ~/.claude-code-cn and ~/.claude
Qsnh May 12, 2026
6712626
feat(utils): add InterruptedError and UnsupportedPlatformError
Qsnh May 12, 2026
f367875
feat(utils): add mergeJSONFile for safe JSON mutation
Qsnh May 12, 2026
446bcec
feat(utils): add CDN constant and resolver
Qsnh May 12, 2026
3040f8b
feat(core): add platform detection and asset name builder
Qsnh May 12, 2026
5de3d72
feat(core): add checksums-sha256.txt parser
Qsnh May 12, 2026
e126aa8
feat(core): add latest version fetcher (CDN latest.txt)
Qsnh May 12, 2026
7a0d00c
feat(core): streaming HTTP download with optional SHA-256 hash and pr…
Qsnh May 12, 2026
79cefcf
feat(core): install orchestrator (version → download → verify → rename)
Qsnh May 12, 2026
2fbcd61
feat(providers): list managed Claude env keys
Qsnh May 12, 2026
09e4f3b
feat(providers): add 10 env builders (KimiCode, Moonshot, DeepSeek, G…
Qsnh May 12, 2026
1574d47
feat(providers): add interactive spec table for 10 providers
Qsnh May 12, 2026
c3168a5
feat(providers): interactive provider configure with stale-key cleanup
Qsnh May 12, 2026
407f57b
feat(commands): wire download flow with PATH hint
Qsnh May 12, 2026
e7c76f7
feat(commands): wire env flow with Ctrl+C handling
Qsnh May 12, 2026
5658342
feat(cli): commander entry with download/env subcommands
Qsnh May 12, 2026
0c80458
docs: rewrite README with usage and platform support
Qsnh May 12, 2026
d1988f3
ci: add CI matrix (Node 18/20/22) for lint, test, build
Qsnh May 12, 2026
879d1e0
ci: add tag-triggered npm publish workflow with provenance
Qsnh May 12, 2026
426e024
style: apply biome formatter and lint fixes
claude May 12, 2026
9250394
chore: add MIT LICENSE
Qsnh May 12, 2026
c88be8b
fix(cli): read version from package.json
Qsnh May 12, 2026
b781c82
fix(commands): print ~/.claude.json confirmation when written
Qsnh May 12, 2026
4c9a022
test(core): add SHA mismatch and checksum-404 fallback tests
Qsnh May 12, 2026
07c4ff7
test: enforce coverage thresholds and add Aliyun model test
Qsnh May 12, 2026
d1be12e
chore: remove superpowers plan and design docs
Qsnh May 12, 2026
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
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# .github/workflows/ci.yml
name: CI

on:
push:
branches: [main]
pull_request:

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: ['18', '20', '22']
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm lint
- run: pnpm typecheck
- run: pnpm test
- run: pnpm build
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# .github/workflows/release.yml
name: Release

on:
push:
tags: ['v*']

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: pnpm
registry-url: 'https://registry.npmjs.org'
- run: pnpm install --frozen-lockfile
- run: pnpm test
- run: pnpm build
- run: pnpm publish --provenance --no-git-checks --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
dist
coverage
.DS_Store
*.log
.vitest-cache
.tsbuildinfo
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 theopenbee

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
42 changes: 40 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,40 @@
# claude-code-cn
提供 Claude Code 中国大陆下载服务
# @theopenbee/claude-code-cn

Claude Code 中国大陆下载与配置工具。

- 默认从大陆 CDN 下载二进制(`https://dl.theopenbee.cn`)
- 交互式配置 10 个国内 Provider(KimiCode / Moonshot / DeepSeek / GLM / MiniMax / 阿里云 / 火山引擎 / 腾讯云 / 小米 Mimo / 自定义)

## 安装

```bash
npm i -g @theopenbee/claude-code-cn
# 或者
pnpm add -g @theopenbee/claude-code-cn
```

## 使用

```bash
ccc download # 下载到 ~/.claude-code-cn/bin/claude
ccc download --force # 已存在也重新下载
ccc download --cdn-url <url> # 覆盖 CDN

ccc env # 交互式选择 Provider 并写入 ~/.claude/settings.json
```

下载完成后,请将 `~/.claude-code-cn/bin` 加入你的 `PATH`:

```bash
export PATH="$HOME/.claude-code-cn/bin:$PATH"
```

## 支持平台

darwin-arm64 / darwin-x64 / linux-arm64 / linux-x64 / linux-arm64-musl / linux-x64-musl

Windows 暂不支持。

## License

MIT
18 changes: 18 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.0/schema.json",
"files": { "include": ["src/**/*.ts"] },
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 100
},
"linter": {
"enabled": true,
"rules": { "recommended": true }
},
"javascript": {
"formatter": { "quoteStyle": "single", "semicolons": "always" }
},
"organizeImports": { "enabled": true }
}
45 changes: 45 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "@theopenbee/claude-code-cn",
"version": "0.0.0",
"description": "Claude Code 中国大陆下载与配置工具",
"type": "module",
"bin": { "ccc": "./dist/cli.js" },
"files": ["dist", "README.md", "LICENSE"],
"engines": { "node": ">=18" },
"scripts": {
"build": "tsup",
"dev": "tsup --watch",
"test": "vitest run --coverage",
"test:watch": "vitest",
"lint": "biome check .",
"format": "biome format --write .",
"typecheck": "tsc --noEmit",
"prepublishOnly": "pnpm build && pnpm test",
"release": "pnpm version patch && git push --follow-tags"
},
"dependencies": {
"@inquirer/prompts": "^7.0.0",
"cli-progress": "^3.12.0",
"commander": "^12.1.0",
"picocolors": "^1.0.1"
},
"devDependencies": {
"@biomejs/biome": "^1.9.0",
"@types/cli-progress": "^3.11.6",
"@types/node": "^22.0.0",
"tsup": "^8.3.0",
"typescript": "^5.6.0",
"vitest": "^2.1.0",
"@vitest/coverage-v8": "^2.1.0"
},
"publishConfig": {
"access": "public",
"provenance": true
},
"repository": {
"type": "git",
"url": "git+https://github.com/theopenbee/claude-code-cn.git"
},
"license": "MIT",
"keywords": ["claude", "claude-code", "anthropic", "china", "cdn"]
}
Loading
Loading