🇺🇸 English version is provided after the Chinese section. Scroll to English Contributing Guide for the translation.
Claude Code Hub 是一个面向团队的 AI API 代理平台,支持统一管理多家供应商、智能分流和现代化运维工具。本文档说明如何按照项目既定流程参与贡献,帮助你提交高质量的 Pull Request(PR)。
克隆仓库并安装依赖:
git clone https://github.com/ding113/claude-code-hub.git
cd claude-code-hub
bun install
复制并配置环境变量:
cp .env.example .env
本地启动:
bun run dev
需要容器化体验可参考 README.md 与 .github/CI_CD_SETUP.md 中的 Docker 流程。
⚠️ 重要:所有 PR 必须以
dev分支为目标。
📌 注意:main仅用于发布,禁止直接合并或推送。
在开始前同步最新 dev:
git checkout dev
git pull origin dev
根据需求创建功能或修复分支:
git checkout -b feature/provider-weight-ui
开发过程中保持变更粒度小,提交前运行必要的检查(见 测试)。
提交并推送:
git add .
git commit -m "feat: add provider weight ui"
git push origin feature/provider-weight-ui
在 GitHub 上创建指向 dev 的 PR,详细填写描述、截图与验证步骤。更多工作流细节请阅读 .github/CI_CD_SETUP.md。
feature/<short-description>:新功能或较大改动(例:feature/audit-log-export)fix/<issue-id-or-scope>:缺陷修复(例:fix/redis-timeout)hotfix/<scope>:紧急线上修复,仍需先合入 devchore/<scope>:依赖更新、文档、脚本等遵循 Conventional Commits,使用英文动词简述改动。常用类型:
| 类型 | 用途 |
|---|---|
feat |
新功能或重大增强 |
fix |
缺陷修复 |
chore |
构建、配置或文档 |
refactor |
重构,不引入新功能 |
test |
新增或更新测试 |
示例:feat: add provider priority routing
src/ 下相同模块的实现,保持命名一致。在每次提交前务必运行:
bun run lint
bun run typecheck
# 如果更改影响运行逻辑,执行端到端验证或 bun run test
如果 PR 涉及 i18n 文案(尤其是 settings / dashboard / myUsage),请遵循:
docs/i18n-translation-quality.mddocs/i18n-pr-checklist.mdCI 会在 PR 上运行 Docker Build Test(见 .github/CI_CD_SETUP.md)。如需验证容器构建,可本地执行:
docker compose build
⚠️ 重要:PR 的 base 分支必须是
dev,CI 通过后方可合并。
📌 注意:若 PR 过期,请先git fetch && git rebase origin/dev,保持与受保护分支同步。
devmain 无直接冲突Claude Code Hub centralizes multiple AI providers with smart routing, tenant controls, and observability. This document explains how to deliver high-quality Pull Requests (PRs) that align with the project roadmap.
README.md. Expect responses within two business days.Clone and install dependencies:
git clone https://github.com/ding113/claude-code-hub.git
cd claude-code-hub
bun install
Copy environment variables and configure secrets:
cp .env.example .env
Launch the dev server:
bun run dev
For Docker-based flows, review README.md and .github/CI_CD_SETUP.md.
⚠️ Important: Every PR must target the
devbranch.
📌 Notice:mainis release-only; never push or merge into it directly.
Sync the latest dev branch before coding:
git checkout dev
git pull origin dev
git checkout -b feature/provider-weight-ui
Keep changes scoped and document reasoning inside commits or PR descriptions.
Run the checks listed in Testing before pushing.
Push the branch and open a PR against dev. Reference .github/CI_CD_SETUP.md for branch protection and CI expectations.
feature/<short-description> — new capabilities or UI workfix/<issue-id-or-scope> — bug fixeshotfix/<scope> — urgent production fixes (merge into dev via PR)chore/<scope> — docs, tooling, dependency bumpsFollow Conventional Commits with concise English summaries:
| Type | Purpose |
|---|---|
feat |
Introduce a feature or enhancement |
fix |
Resolve a bug |
chore |
Tooling, docs, or maintenance |
refactor |
Internal refactors without behavior changes |
test |
Add or adjust tests |
Example: fix: handle redis timeout retry
src/app.src/lib or src/actions when possible.README.md.Always verify locally before requesting a review:
bun run lint
bun run typecheck
# Run bun run test or relevant scripts when logic changes
docker compose build # optional, mirrors CI Docker Build Test
GitHub Actions runs Docker Build Test on every PR to dev and main; see .github/CI_CD_SETUP.md for the full matrix.
⚠️ Important: Set the PR base to
dev, ensure CI is green before merging.
📌 Notice: Rebase ontoorigin/devif the branch falls behind protected rules.
dev感谢你为 Claude Code Hub 做出的贡献!Thanks for helping improve Claude Code Hub!