Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 831d2c962c | |||
| 68da178811 | |||
| 3b3d1cd0ba | |||
| 3fa3558bd4 | |||
| 788c221d39 | |||
| a86f22422b | |||
| 6427ab2128 | |||
| 87b08ce242 |
@@ -1,2 +0,0 @@
|
||||
custom:
|
||||
- https://github.com/farion1231/cc-switch/blob/main/README_ZH.md#%E2%9D%A4%EF%B8%8F%E8%B5%9E%E5%8A%A9%E5%95%86
|
||||
@@ -1,97 +0,0 @@
|
||||
name: "🐛 Bug Report / Bug 报告"
|
||||
description: |
|
||||
Report errors or unexpected behavior.
|
||||
报告错误或异常行为。
|
||||
labels:
|
||||
- bug
|
||||
body:
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Self Checks / 自检
|
||||
options:
|
||||
- label: |
|
||||
I have read the [FAQ](https://github.com/farion1231/cc-switch#faq) section in README.
|
||||
我已阅读 README 中的[常见问题](https://github.com/farion1231/cc-switch#常见问题)。
|
||||
required: true
|
||||
- label: |
|
||||
I have searched for [existing issues](https://github.com/farion1231/cc-switch/issues), including closed ones.
|
||||
我已搜索过[已有的 Issue](https://github.com/farion1231/cc-switch/issues),包括已关闭的。
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
attributes:
|
||||
label: CC Switch Version / 版本号
|
||||
description: |
|
||||
See the Settings page in the app.
|
||||
查看应用设置页面中的版本号。
|
||||
placeholder: "e.g. 3.11.1"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Operating System / 操作系统
|
||||
multiple: false
|
||||
options:
|
||||
- Windows
|
||||
- macOS
|
||||
- Linux
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Related App / 涉及应用
|
||||
description: |
|
||||
Which app is affected?
|
||||
涉及哪个应用?
|
||||
multiple: true
|
||||
options:
|
||||
- Claude Code
|
||||
- Codex
|
||||
- Gemini CLI
|
||||
- OpenCode
|
||||
- OpenClaw
|
||||
- Other / 其他
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Steps to Reproduce / 重现步骤
|
||||
description: |
|
||||
Please describe the steps to reproduce the bug. Screenshots and logs are helpful.
|
||||
请描述重现步骤。截图和日志会很有帮助。
|
||||
placeholder: |
|
||||
1. Go to ...
|
||||
2. Click on ...
|
||||
3. See error ...
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Expected Behavior / 期望行为
|
||||
description: |
|
||||
What did you expect to happen?
|
||||
你期望发生什么?
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Actual Behavior / 实际行为
|
||||
description: |
|
||||
What actually happened?
|
||||
实际发生了什么?
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Additional Context / 补充信息
|
||||
description: |
|
||||
Any other information, screenshots, or logs.
|
||||
其他信息、截图或日志。
|
||||
validations:
|
||||
required: false
|
||||
@@ -1,12 +0,0 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: "Security Vulnerabilities / 安全漏洞"
|
||||
url: "https://github.com/farion1231/cc-switch/security/advisories/new"
|
||||
about: |
|
||||
Report security vulnerabilities through GitHub Security Advisories.
|
||||
请通过 GitHub 安全公告报告安全漏洞。
|
||||
- name: "Discussions / 讨论区"
|
||||
url: "https://github.com/farion1231/cc-switch/discussions"
|
||||
about: |
|
||||
General discussions and community help.
|
||||
一般讨论和社区帮助。
|
||||
@@ -1,60 +0,0 @@
|
||||
name: "📖 Documentation Issue / 文档问题"
|
||||
description: |
|
||||
Report documentation errors, outdated content, or missing information.
|
||||
报告文档错误、过时内容或缺失信息。
|
||||
labels:
|
||||
- documentation
|
||||
body:
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Self Checks / 自检
|
||||
options:
|
||||
- label: |
|
||||
I have searched for [existing issues](https://github.com/farion1231/cc-switch/issues), including closed ones.
|
||||
我已搜索过[已有的 Issue](https://github.com/farion1231/cc-switch/issues),包括已关闭的。
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Language / 语言
|
||||
description: |
|
||||
Which language version of the docs?
|
||||
涉及哪个语言版本的文档?
|
||||
multiple: true
|
||||
options:
|
||||
- English
|
||||
- 中文
|
||||
- 日本語
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
attributes:
|
||||
label: Document Location / 文档位置
|
||||
description: |
|
||||
Which file or section is affected? Provide a link or file path.
|
||||
涉及哪个文件或章节?请提供链接或文件路径。
|
||||
placeholder: "e.g. README.md#faq or docs/user-manual/zh/..."
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Issue Type / 问题类型
|
||||
options:
|
||||
- "Typo or grammar / 拼写或语法错误"
|
||||
- "Outdated content / 内容过时"
|
||||
- "Missing information / 信息缺失"
|
||||
- "Translation issue / 翻译问题"
|
||||
- "Other / 其他"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Description / 描述
|
||||
description: |
|
||||
Describe the documentation issue.
|
||||
描述文档问题。
|
||||
validations:
|
||||
required: true
|
||||
@@ -1,75 +0,0 @@
|
||||
name: "✨ Feature Request / 功能请求"
|
||||
description: |
|
||||
Propose a new feature or improvement.
|
||||
提出新功能或改进建议。
|
||||
labels:
|
||||
- enhancement
|
||||
body:
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Self Checks / 自检
|
||||
options:
|
||||
- label: |
|
||||
I have read the [FAQ](https://github.com/farion1231/cc-switch#faq) section in README.
|
||||
我已阅读 README 中的[常见问题](https://github.com/farion1231/cc-switch#常见问题)。
|
||||
required: true
|
||||
- label: |
|
||||
I have searched for [existing issues](https://github.com/farion1231/cc-switch/issues), including closed ones.
|
||||
我已搜索过[已有的 Issue](https://github.com/farion1231/cc-switch/issues),包括已关闭的。
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Related App / 涉及应用
|
||||
description: |
|
||||
Which app is this feature for?
|
||||
该功能涉及哪个应用?
|
||||
multiple: true
|
||||
options:
|
||||
- Claude Code
|
||||
- Codex
|
||||
- Gemini CLI
|
||||
- OpenCode
|
||||
- OpenClaw
|
||||
- General / 通用
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Problem or Motivation / 问题或动机
|
||||
description: |
|
||||
Is this request related to a problem? Describe the scenario.
|
||||
这个请求是否与某个问题相关?请描述使用场景。
|
||||
placeholder: |
|
||||
I was trying to ... and found that ...
|
||||
我在尝试……的时候,发现……
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Proposed Solution / 建议方案
|
||||
description: |
|
||||
Describe the solution you'd like.
|
||||
描述你希望的解决方案。
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Additional Context / 补充信息
|
||||
description: |
|
||||
Any other context, mockups, or screenshots.
|
||||
其他背景信息、设计稿或截图。
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Contribution / 参与贡献
|
||||
options:
|
||||
- label: |
|
||||
I am interested in contributing to this feature.
|
||||
我有兴趣参与开发此功能。
|
||||
required: false
|
||||
@@ -1,64 +0,0 @@
|
||||
name: "❓ Question / 提问"
|
||||
description: |
|
||||
Ask a question about usage or configuration.
|
||||
询问使用或配置相关问题。
|
||||
labels:
|
||||
- question
|
||||
body:
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Self Checks / 自检
|
||||
options:
|
||||
- label: |
|
||||
I have read the [FAQ](https://github.com/farion1231/cc-switch#faq) section in README.
|
||||
我已阅读 README 中的[常见问题](https://github.com/farion1231/cc-switch#常见问题)。
|
||||
required: true
|
||||
- label: |
|
||||
I have searched for [existing issues](https://github.com/farion1231/cc-switch/issues), including closed ones.
|
||||
我已搜索过[已有的 Issue](https://github.com/farion1231/cc-switch/issues),包括已关闭的。
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Related App / 涉及应用
|
||||
description: |
|
||||
Which app is your question about?
|
||||
你的问题涉及哪个应用?
|
||||
multiple: true
|
||||
options:
|
||||
- Claude Code
|
||||
- Codex
|
||||
- Gemini CLI
|
||||
- OpenCode
|
||||
- OpenClaw
|
||||
- General / 通用
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Your Question / 你的问题
|
||||
description: |
|
||||
Describe your question clearly.
|
||||
请清晰地描述你的问题。
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: What Have You Tried / 你已经尝试过什么
|
||||
description: |
|
||||
Describe what you've already tried or researched.
|
||||
描述你已经尝试过或查阅过的内容。
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Environment / 环境信息
|
||||
description: |
|
||||
OS, CC Switch version, and any relevant details.
|
||||
操作系统、CC Switch 版本及其他相关信息。
|
||||
placeholder: "e.g. macOS 15.4, CC Switch 3.11.1"
|
||||
validations:
|
||||
required: false
|
||||
@@ -1,39 +0,0 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "npm"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
labels:
|
||||
- "dependencies"
|
||||
- "frontend"
|
||||
commit-message:
|
||||
prefix: "chore(deps)"
|
||||
groups:
|
||||
frontend-deps:
|
||||
patterns:
|
||||
- "*"
|
||||
|
||||
- package-ecosystem: "cargo"
|
||||
directory: "/src-tauri"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
labels:
|
||||
- "dependencies"
|
||||
- "backend"
|
||||
commit-message:
|
||||
prefix: "chore(deps)"
|
||||
groups:
|
||||
cargo-deps:
|
||||
patterns:
|
||||
- "*"
|
||||
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "monthly"
|
||||
labels:
|
||||
- "dependencies"
|
||||
- "actions"
|
||||
commit-message:
|
||||
prefix: "chore(deps)"
|
||||
@@ -1,25 +0,0 @@
|
||||
## Summary / 概述
|
||||
|
||||
<!-- Briefly describe what this PR does and why. / 简要描述这个 PR 做了什么以及为什么。 -->
|
||||
|
||||
## Related Issue / 关联 Issue
|
||||
|
||||
<!-- Link the related issue. Use "Fixes #123" to auto-close it when merged. -->
|
||||
<!-- 关联相关 Issue。使用 "Fixes #123" 可在合并时自动关闭。 -->
|
||||
|
||||
Fixes #
|
||||
|
||||
## Screenshots / 截图
|
||||
|
||||
<!-- If applicable, add before/after screenshots. / 如有需要,请添加修改前后的截图。 -->
|
||||
|
||||
| Before / 修改前 | After / 修改后 |
|
||||
|-----------------|---------------|
|
||||
| | |
|
||||
|
||||
## Checklist / 检查清单
|
||||
|
||||
- [ ] `pnpm typecheck` passes / 通过 TypeScript 类型检查
|
||||
- [ ] `pnpm format:check` passes / 通过代码格式检查
|
||||
- [ ] `cargo clippy` passes (if Rust code changed) / 通过 Clippy 检查(如修改了 Rust 代码)
|
||||
- [ ] Updated i18n files if user-facing text changed / 如修改了用户可见文本,已更新国际化文件
|
||||
@@ -1,99 +0,0 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
concurrency:
|
||||
group: ci-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
frontend:
|
||||
name: Frontend Checks
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: "20"
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v5
|
||||
with:
|
||||
version: 10.12.3
|
||||
run_install: false
|
||||
|
||||
- name: Get pnpm store directory
|
||||
id: pnpm-store
|
||||
shell: bash
|
||||
run: echo "path=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache pnpm store
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ${{ steps.pnpm-store.outputs.path }}
|
||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
restore-keys: ${{ runner.os }}-pnpm-store-
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: TypeScript type check
|
||||
run: pnpm typecheck
|
||||
|
||||
- name: Check formatting
|
||||
run: pnpm format:check
|
||||
|
||||
- name: Unit tests
|
||||
run: pnpm test:unit
|
||||
|
||||
backend:
|
||||
name: Backend Checks
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
components: rustfmt, clippy
|
||||
|
||||
- name: Install Linux system deps
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y --no-install-recommends \
|
||||
build-essential pkg-config libssl-dev \
|
||||
libgtk-3-dev librsvg2-dev libayatana-appindicator3-dev
|
||||
sudo apt-get install -y --no-install-recommends libwebkit2gtk-4.1-dev \
|
||||
|| sudo apt-get install -y --no-install-recommends libwebkit2gtk-4.0-dev
|
||||
sudo apt-get install -y --no-install-recommends libsoup-3.0-dev \
|
||||
|| sudo apt-get install -y --no-install-recommends libsoup2.4-dev
|
||||
|
||||
- name: Cache Cargo registry and build
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
src-tauri/target
|
||||
key: ${{ runner.os }}-cargo-${{ hashFiles('src-tauri/Cargo.lock') }}
|
||||
restore-keys: ${{ runner.os }}-cargo-
|
||||
|
||||
- name: Create frontend dist placeholder
|
||||
run: mkdir -p dist
|
||||
|
||||
- name: Check Rust formatting
|
||||
run: cargo fmt --check --manifest-path src-tauri/Cargo.toml
|
||||
|
||||
- name: Clippy
|
||||
run: cargo clippy --manifest-path src-tauri/Cargo.toml -- -D warnings
|
||||
|
||||
- name: Run tests
|
||||
run: cargo test --manifest-path src-tauri/Cargo.toml
|
||||
@@ -29,7 +29,7 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v6
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
|
||||
@@ -74,7 +74,7 @@ jobs:
|
||||
|| sudo apt-get install -y --no-install-recommends libsoup2.4-dev
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v5
|
||||
uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 10.12.3
|
||||
run_install: false
|
||||
@@ -85,7 +85,7 @@ jobs:
|
||||
run: echo "path=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Setup pnpm cache
|
||||
uses: actions/cache@v5
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ steps.pnpm-store.outputs.path }}
|
||||
key: ${{ runner.os }}-${{ runner.arch }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
@@ -150,76 +150,9 @@ jobs:
|
||||
fi
|
||||
echo "✅ Tauri signing key prepared"
|
||||
|
||||
- name: Import Apple signing certificate
|
||||
if: runner.os == 'macOS'
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
# Decode .p12 certificate from base64
|
||||
CERT_PATH="$RUNNER_TEMP/certificate.p12"
|
||||
printf '%s' "${{ secrets.APPLE_CERTIFICATE }}" | (base64 --decode 2>/dev/null || base64 -D) > "$CERT_PATH"
|
||||
|
||||
# Save original default keychain for cleanup
|
||||
ORIGINAL_DEFAULT_KEYCHAIN=$(security default-keychain -d user | tr -d '"' | xargs)
|
||||
echo "ORIGINAL_DEFAULT_KEYCHAIN=$ORIGINAL_DEFAULT_KEYCHAIN" >> "$GITHUB_ENV"
|
||||
|
||||
# Create temporary keychain
|
||||
KEYCHAIN_PATH="$RUNNER_TEMP/build.keychain-db"
|
||||
security create-keychain -p "${{ secrets.KEYCHAIN_PASSWORD }}" "$KEYCHAIN_PATH"
|
||||
security set-keychain-settings -lut 21600 "$KEYCHAIN_PATH"
|
||||
security default-keychain -s "$KEYCHAIN_PATH"
|
||||
security unlock-keychain -p "${{ secrets.KEYCHAIN_PASSWORD }}" "$KEYCHAIN_PATH"
|
||||
|
||||
# Import certificate
|
||||
security import "$CERT_PATH" \
|
||||
-k "$KEYCHAIN_PATH" \
|
||||
-P "${{ secrets.APPLE_CERTIFICATE_PASSWORD }}" \
|
||||
-T /usr/bin/codesign \
|
||||
-T /usr/bin/security
|
||||
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "${{ secrets.KEYCHAIN_PASSWORD }}" "$KEYCHAIN_PATH"
|
||||
|
||||
# Dynamically resolve signing identity (must be "Developer ID Application")
|
||||
IDENTITY=$(security find-identity -v -p codesigning "$KEYCHAIN_PATH" \
|
||||
| grep "Developer ID Application" | grep -oE '"[^"]+"' | head -1 | tr -d '"')
|
||||
if [ -z "$IDENTITY" ]; then
|
||||
echo "❌ No 'Developer ID Application' identity found — listing all identities:" >&2
|
||||
security find-identity -v -p codesigning "$KEYCHAIN_PATH"
|
||||
exit 1
|
||||
fi
|
||||
echo "✅ Signing identity: $IDENTITY"
|
||||
echo "APPLE_SIGNING_IDENTITY=$IDENTITY" >> "$GITHUB_ENV"
|
||||
|
||||
# Cleanup certificate file
|
||||
rm -f "$CERT_PATH"
|
||||
|
||||
- name: Build Tauri App (macOS)
|
||||
if: runner.os == 'macOS'
|
||||
shell: bash
|
||||
timeout-minutes: 60
|
||||
env:
|
||||
APPLE_SIGNING_IDENTITY: ${{ env.APPLE_SIGNING_IDENTITY }}
|
||||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
|
||||
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
max_attempts=3
|
||||
for attempt in $(seq 1 "$max_attempts"); do
|
||||
echo "=== macOS build/notarization attempt ${attempt}/${max_attempts} ==="
|
||||
if pnpm tauri build --target universal-apple-darwin; then
|
||||
echo "✅ macOS build/notarization succeeded"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$attempt" -eq "$max_attempts" ]; then
|
||||
echo "❌ macOS build/notarization failed after ${max_attempts} attempts" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sleep_seconds=$((attempt * 60))
|
||||
echo "⚠️ macOS build/notarization failed, retrying in ${sleep_seconds}s..."
|
||||
sleep "$sleep_seconds"
|
||||
done
|
||||
run: pnpm tauri build --target universal-apple-darwin
|
||||
|
||||
- name: Build Tauri App (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
@@ -236,8 +169,7 @@ jobs:
|
||||
set -euxo pipefail
|
||||
mkdir -p release-assets
|
||||
VERSION="${GITHUB_REF_NAME}" # e.g., v3.5.0
|
||||
|
||||
# Locate bundle artifacts
|
||||
echo "Looking for updater artifact (.tar.gz) and .app for zip..."
|
||||
TAR_GZ=""; APP_PATH=""
|
||||
for path in \
|
||||
"src-tauri/target/universal-apple-darwin/release/bundle/macos" \
|
||||
@@ -245,150 +177,28 @@ jobs:
|
||||
"src-tauri/target/x86_64-apple-darwin/release/bundle/macos" \
|
||||
"src-tauri/target/release/bundle/macos"; do
|
||||
if [ -d "$path" ]; then
|
||||
[ -z "$TAR_GZ" ] && TAR_GZ=$(find "$path" -maxdepth 1 -name "*.tar.gz" -type f | head -1 || true)
|
||||
[ -z "$TAR_GZ" ] && TAR_GZ=$(find "$path" -maxdepth 1 -name "*.tar.gz" -type f | head -1 || true)
|
||||
[ -z "$APP_PATH" ] && APP_PATH=$(find "$path" -maxdepth 1 -name "*.app" -type d | head -1 || true)
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -z "$TAR_GZ" ]; then
|
||||
echo "❌ No macOS .tar.gz updater artifact found" >&2
|
||||
echo "No macOS .tar.gz updater artifact found" >&2
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "$APP_PATH" ]; then
|
||||
echo "❌ No .app found" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Staple notarization ticket to .app (Tauri already notarized it)
|
||||
xcrun stapler staple "$APP_PATH"
|
||||
echo "✅ .app stapled"
|
||||
|
||||
# 1) Collect .tar.gz (updater artifact)
|
||||
# 重命名 tar.gz 为统一格式
|
||||
NEW_TAR_GZ="CC-Switch-${VERSION}-macOS.tar.gz"
|
||||
cp "$TAR_GZ" "release-assets/$NEW_TAR_GZ"
|
||||
[ -f "$TAR_GZ.sig" ] && cp "$TAR_GZ.sig" "release-assets/$NEW_TAR_GZ.sig" || echo ".sig for macOS not found yet"
|
||||
echo "macOS updater artifact copied: $NEW_TAR_GZ"
|
||||
|
||||
# 2) Collect .app as zip
|
||||
NEW_ZIP="CC-Switch-${VERSION}-macOS.zip"
|
||||
ditto -c -k --sequesterRsrc --keepParent "$APP_PATH" "release-assets/$NEW_ZIP"
|
||||
echo "macOS zip ready: $NEW_ZIP"
|
||||
|
||||
# 3) Create styled DMG with create-dmg (Tauri's built-in DMG styling doesn't work on CI)
|
||||
if [ -z "${APPLE_SIGNING_IDENTITY:-}" ]; then
|
||||
echo "❌ APPLE_SIGNING_IDENTITY is missing before DMG creation" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
HOMEBREW_NO_AUTO_UPDATE=1 brew install create-dmg
|
||||
NEW_DMG="CC-Switch-${VERSION}-macOS.dmg"
|
||||
DMG_STAGE_DIR="$RUNNER_TEMP/dmg-stage"
|
||||
rm -rf "$DMG_STAGE_DIR"
|
||||
mkdir -p "$DMG_STAGE_DIR"
|
||||
ditto "$APP_PATH" "$DMG_STAGE_DIR/CC Switch.app"
|
||||
|
||||
create-dmg \
|
||||
--volname "CC Switch" \
|
||||
--background "src-tauri/icons/dmg-background.png" \
|
||||
--window-size 660 400 \
|
||||
--window-pos 200 120 \
|
||||
--icon-size 80 \
|
||||
--icon "CC Switch.app" 180 220 \
|
||||
--hide-extension "CC Switch.app" \
|
||||
--app-drop-link 480 220 \
|
||||
--codesign "$APPLE_SIGNING_IDENTITY" \
|
||||
--no-internet-enable \
|
||||
"release-assets/$NEW_DMG" \
|
||||
"$DMG_STAGE_DIR"
|
||||
|
||||
rm -rf "$DMG_STAGE_DIR"
|
||||
echo "✅ Styled DMG created: $NEW_DMG"
|
||||
|
||||
- name: Notarize macOS DMG
|
||||
if: runner.os == 'macOS'
|
||||
shell: bash
|
||||
timeout-minutes: 30
|
||||
env:
|
||||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
|
||||
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
DMG_PATH=$(find release-assets -maxdepth 1 -name "*.dmg" -type f | head -1 || true)
|
||||
if [ -z "$DMG_PATH" ]; then
|
||||
echo "❌ No .dmg found in release-assets/ to notarize" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "=== Notarizing DMG: $DMG_PATH ==="
|
||||
max_attempts=3
|
||||
for attempt in $(seq 1 "$max_attempts"); do
|
||||
echo "=== DMG notarization attempt ${attempt}/${max_attempts} ==="
|
||||
if xcrun notarytool submit "$DMG_PATH" \
|
||||
--apple-id "$APPLE_ID" \
|
||||
--password "$APPLE_PASSWORD" \
|
||||
--team-id "$APPLE_TEAM_ID" \
|
||||
--wait; then
|
||||
echo "✅ DMG notarization succeeded"
|
||||
xcrun stapler staple "$DMG_PATH"
|
||||
echo "✅ DMG stapled"
|
||||
break
|
||||
fi
|
||||
|
||||
if [ "$attempt" -eq "$max_attempts" ]; then
|
||||
echo "❌ DMG notarization failed after ${max_attempts} attempts" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sleep_seconds=$((attempt * 60))
|
||||
echo "⚠️ DMG notarization failed, retrying in ${sleep_seconds}s..."
|
||||
sleep "$sleep_seconds"
|
||||
done
|
||||
|
||||
- name: Verify macOS code signing and notarization
|
||||
if: runner.os == 'macOS'
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
# Verify .app (from Tauri bundle)
|
||||
APP_PATH=""
|
||||
for path in \
|
||||
"src-tauri/target/universal-apple-darwin/release/bundle/macos" \
|
||||
"src-tauri/target/aarch64-apple-darwin/release/bundle/macos" \
|
||||
"src-tauri/target/x86_64-apple-darwin/release/bundle/macos" \
|
||||
"src-tauri/target/release/bundle/macos"; do
|
||||
if [ -d "$path" ]; then
|
||||
[ -z "$APP_PATH" ] && APP_PATH=$(find "$path" -maxdepth 1 -name "*.app" -type d | head -1 || true)
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -z "$APP_PATH" ]; then
|
||||
echo "❌ No .app found for verification" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "=== Verifying .app: $APP_PATH ==="
|
||||
codesign --verify --deep --strict --verbose=2 "$APP_PATH"
|
||||
echo "✅ codesign verification passed"
|
||||
spctl -a -t exec -vv "$APP_PATH"
|
||||
echo "✅ spctl assessment passed"
|
||||
xcrun stapler validate "$APP_PATH"
|
||||
echo "✅ .app stapler validation passed"
|
||||
|
||||
# Verify .dmg (from release-assets/, created by create-dmg + notarized)
|
||||
DMG_PATH=$(find release-assets -maxdepth 1 -name "*.dmg" -type f | head -1 || true)
|
||||
if [ -n "$DMG_PATH" ]; then
|
||||
echo "=== Verifying .dmg: $DMG_PATH ==="
|
||||
codesign --verify --verbose=2 "$DMG_PATH"
|
||||
echo "✅ .dmg codesign verification passed"
|
||||
spctl -a -t open --context context:primary-signature -vv "$DMG_PATH"
|
||||
echo "✅ .dmg spctl assessment passed"
|
||||
xcrun stapler validate "$DMG_PATH"
|
||||
echo "✅ .dmg stapler validation passed"
|
||||
if [ -n "$APP_PATH" ]; then
|
||||
APP_DIR=$(dirname "$APP_PATH"); APP_NAME=$(basename "$APP_PATH")
|
||||
NEW_ZIP="CC-Switch-${VERSION}-macOS.zip"
|
||||
cd "$APP_DIR"
|
||||
ditto -c -k --sequesterRsrc --keepParent "$APP_NAME" "$NEW_ZIP"
|
||||
mv "$NEW_ZIP" "$GITHUB_WORKSPACE/release-assets/"
|
||||
echo "macOS zip ready: $NEW_ZIP"
|
||||
else
|
||||
echo "❌ No .dmg found for verification — release would ship without verified DMG" >&2
|
||||
exit 1
|
||||
echo "No .app found to zip (optional)" >&2
|
||||
fi
|
||||
|
||||
- name: Prepare Windows Assets
|
||||
@@ -489,51 +299,6 @@ jobs:
|
||||
echo "Collected signatures (if any alongside artifacts):"
|
||||
ls -la release-assets/*.sig || echo "No signatures found"
|
||||
|
||||
- name: Upload release artifacts to workflow
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: release-assets-${{ runner.os }}-${{ matrix.arch || runner.arch }}
|
||||
path: release-assets/*
|
||||
if-no-files-found: error
|
||||
|
||||
- name: List generated bundles (debug)
|
||||
if: always()
|
||||
shell: bash
|
||||
run: |
|
||||
echo "Listing bundles in src-tauri/target..."
|
||||
find src-tauri/target -maxdepth 4 -type f -name "*.*" 2>/dev/null || true
|
||||
|
||||
- name: Clean up Apple signing keychain
|
||||
if: runner.os == 'macOS' && always()
|
||||
shell: bash
|
||||
run: |
|
||||
if [ -n "${ORIGINAL_DEFAULT_KEYCHAIN:-}" ]; then
|
||||
security default-keychain -s "$ORIGINAL_DEFAULT_KEYCHAIN" || true
|
||||
fi
|
||||
if [ -f "$RUNNER_TEMP/build.keychain-db" ]; then
|
||||
security delete-keychain "$RUNNER_TEMP/build.keychain-db" || true
|
||||
fi
|
||||
|
||||
publish-release:
|
||||
name: Publish GitHub Release
|
||||
runs-on: ubuntu-22.04
|
||||
needs: release
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Download built release artifacts
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
pattern: release-assets-*
|
||||
path: release-assets
|
||||
merge-multiple: true
|
||||
|
||||
- name: List downloaded release artifacts
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
ls -la release-assets
|
||||
|
||||
- name: Upload Release Assets
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
@@ -547,23 +312,28 @@ jobs:
|
||||
|
||||
### 下载
|
||||
|
||||
- **macOS**: `CC-Switch-${{ github.ref_name }}-macOS.dmg`(推荐)或 `CC-Switch-${{ github.ref_name }}-macOS.zip`(解压即用)
|
||||
- **macOS**: `CC-Switch-${{ github.ref_name }}-macOS.zip`(解压即用)或 `CC-Switch-${{ github.ref_name }}-macOS.tar.gz`(Homebrew)
|
||||
- **Windows**: `CC-Switch-${{ github.ref_name }}-Windows.msi`(安装版)或 `CC-Switch-${{ github.ref_name }}-Windows-Portable.zip`(绿色版)
|
||||
- **Linux (x86_64)**: `CC-Switch-${{ github.ref_name }}-Linux-x86_64.AppImage` / `.deb` / `.rpm`
|
||||
- **Linux (ARM64)**: `CC-Switch-${{ github.ref_name }}-Linux-arm64.AppImage` / `.deb` / `.rpm`
|
||||
|
||||
> `.tar.gz` 为 Tauri updater 自动更新专用,无需手动下载。
|
||||
|
||||
---
|
||||
macOS 版本已通过 Apple 代码签名和公证,可直接安装使用。
|
||||
提示:macOS 如遇"已损坏"提示,可在终端执行:`xattr -cr "/Applications/CC Switch.app"`
|
||||
files: release-assets/*
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: List generated bundles (debug)
|
||||
if: always()
|
||||
shell: bash
|
||||
run: |
|
||||
echo "Listing bundles in src-tauri/target..."
|
||||
find src-tauri/target -maxdepth 4 -type f -name "*.*" 2>/dev/null || true
|
||||
|
||||
assemble-latest-json:
|
||||
name: Assemble latest.json
|
||||
runs-on: ubuntu-22.04
|
||||
needs: publish-release
|
||||
needs: release
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
name: Close Stale Issues
|
||||
|
||||
on:
|
||||
schedule:
|
||||
# Run daily at 00:00 UTC
|
||||
- cron: '0 0 * * *'
|
||||
workflow_dispatch: # Allow manual trigger
|
||||
|
||||
permissions:
|
||||
issues: write
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/stale@v9
|
||||
with:
|
||||
# --- Timing ---
|
||||
days-before-stale: 60
|
||||
days-before-close: 14
|
||||
|
||||
# --- Stale label ---
|
||||
stale-issue-label: 'stale'
|
||||
|
||||
# --- Messages (bilingual) ---
|
||||
stale-issue-message: |
|
||||
此 issue 已超过 60 天没有活动,已被标记为 `stale`。
|
||||
如果此问题仍然存在,请回复以保持 issue 打开状态,否则将在 14 天后自动关闭。
|
||||
|
||||
This issue has been automatically marked as `stale` because it has not had activity for 60 days.
|
||||
Please reply to keep it open, otherwise it will be automatically closed in 14 days.
|
||||
close-issue-message: |
|
||||
此 issue 因长时间无活动已被自动关闭。如果问题仍然存在,欢迎重新打开。
|
||||
|
||||
This issue has been automatically closed due to inactivity. If the problem persists, feel free to reopen it.
|
||||
|
||||
# --- Exemptions ---
|
||||
# Issues with these labels will NEVER be marked stale
|
||||
exempt-issue-labels: 'security,performance'
|
||||
# Issues with 3+ reactions are likely popular requests, exempt them
|
||||
exempt-issue-created-after: '2020-01-01'
|
||||
|
||||
# --- Processing limits ---
|
||||
# Process up to 100 issues per run to avoid API rate limits
|
||||
operations-per-run: 100
|
||||
|
||||
# --- Only issues, not PRs ---
|
||||
days-before-pr-stale: -1
|
||||
days-before-pr-close: -1
|
||||
@@ -24,8 +24,4 @@ flatpak/cc-switch.deb
|
||||
flatpak-build/
|
||||
flatpak-repo/
|
||||
.worktrees/
|
||||
.spec-workflow/
|
||||
copilot-api
|
||||
.history
|
||||
CODEBUDDY.md
|
||||
.github
|
||||
.spec-workflow/
|
||||
@@ -1 +1 @@
|
||||
22.12.0
|
||||
22.12.0
|
||||
@@ -7,191 +7,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
Development since v3.12.3 focuses on quota visibility, provider workflow upgrades, stronger proxy compatibility, and lower-overhead tray / session workflows.
|
||||
|
||||
### Added
|
||||
|
||||
- **Lightweight Mode**: Added a tray-only mode that destroys the main window and keeps CC Switch running from the system tray, with the window recreated when users reopen it.
|
||||
- **Provider Model Auto-Fetch**: Added OpenAI-compatible `/v1/models` discovery for Claude, Codex, Gemini, OpenCode, and OpenClaw provider forms, including grouped dropdown selection and failure-specific error messages.
|
||||
- **Quota & Balance Visibility**: Added inline quota or balance display for official Claude / Codex / Gemini providers, GitHub Copilot premium interactions, Codex OAuth providers, Token Plan providers (Kimi / Zhipu GLM / MiniMax), and official balance queries for DeepSeek, StepFun, SiliconFlow, OpenRouter, and Novita AI.
|
||||
- **Skills Discovery & Batch Updates**: Added SHA-256 based skill update detection, per-skill and batch update actions, a storage-location toggle between CC Switch and `~/.agents/skills`, and public `skills.sh` search integration.
|
||||
- **Session Workflow Upgrades**: Added batch delete in Session Manager, a directory picker before launching Claude terminal restore commands, usage import from Claude / Codex / Gemini session logs without requiring proxy interception, and per-app usage filtering for Claude / Codex / Gemini dashboards.
|
||||
- **Codex OAuth Reverse Proxy**: Added ChatGPT Plus / Pro based Codex OAuth reverse proxy support for Claude provider cards, including managed OAuth login and inline subscription quota display.
|
||||
- **OpenCode / OpenClaw Stream Check Coverage**: Added OpenCode npm package mapping plus support for OpenClaw `openai-completions` and the remaining OpenClaw protocol variants in Stream Check.
|
||||
- **Full URL Endpoint Mode**: Added a provider option that treats `base_url` as a complete upstream endpoint so proxy forwarding and stream checks can work with vendors that require nonstandard URL layouts.
|
||||
- **OpenCode StepFun Step Plan Preset**: Added a StepFun Step Plan provider preset for OpenCode.
|
||||
- **Copilot Interaction Optimizer**: Added request classification and routing logic to reduce unnecessary GitHub Copilot premium interaction consumption.
|
||||
|
||||
### Changed
|
||||
|
||||
- **Tray Menu Organization**: Reworked the tray menu into per-app submenus to prevent overflow and make background provider switching scale better with larger provider lists.
|
||||
- **Proxy Forwarding Stack**: Refactored proxy forwarding onto a Hyper-based client with transparent header forwarding, improved endpoint rewriting, and better support for dynamic upstream endpoints.
|
||||
- **OAuth Auth Center UI Polish**: Tightened the Auth Center copy, layout, and icon presentation so the Codex OAuth login flow feels cleaner and less cluttered.
|
||||
- **Provider Key Lifecycle & Live Sync**: Reworked additive provider create / rename / duplicate flows so live config writes, cleanup, and rollback stay consistent across OpenCode / OpenClaw and takeover scenarios.
|
||||
- **Codex OAuth Defaults**: Updated the Codex OAuth preset to the GPT-5.4 model family.
|
||||
|
||||
### Fixed
|
||||
|
||||
- **Copilot Authentication & Proxy Compatibility**: Fixed GitHub Copilot authentication regressions, corrected enterprise / dynamic endpoint handling, repaired clipboard verification-code copying on macOS and Linux, and fixed Responses routing when Copilot-backed Claude providers target OpenAI models.
|
||||
- **Streaming Parser Compatibility**: Fixed SSE parsing to accept fields with optional spaces, improving compatibility with non-strict streaming implementations.
|
||||
- **UTF-8 Stream Chunk Boundaries**: Fixed intermittent garbled output (U+FFFD replacement characters) in Claude Code when multi-byte UTF-8 sequences such as Chinese characters or emoji were split across TCP stream chunks via the Copilot reverse proxy, by preserving incomplete trailing bytes across chunks in all four SSE streaming paths instead of lossy decoding.
|
||||
- **Fragmented System Prompt Normalization**: Fixed strict OpenAI-compatible chat backends (Nvidia, Qwen-style) rejecting requests when converted Claude payloads contained multiple system messages, by merging system content into a single leading system message during the Anthropic → OpenAI chat transformation.
|
||||
- **Provider Switch State Corruption**: Serialized per-app provider switches to prevent concurrent failover or hot-switch operations from leaving `is_current`, settings state, and live backup state out of sync.
|
||||
- **Claude Takeover Live Config Drift**: Fixed provider edits while Claude takeover is active so live settings remain aligned with the latest provider state without breaking takeover restore behavior.
|
||||
- **WebDAV Password Retention & Validation**: Fixed the WebDAV password field so saved credentials remain visible after refresh and treated `MKCOL 405` responses correctly during connection validation.
|
||||
- **Provider Card Action States**: Fixed additive-mode highlight behavior, aligned usage display layout across provider cards, replaced hard proxy-switch blocking with a warning path, and disabled unsupported test / usage actions for Copilot and Codex OAuth cards.
|
||||
- **Usage Accuracy & Pricing**: Fixed MiniMax quota math and 0%→100% progression, corrected CNY→USD pricing plus missing model definitions, improved Gemini session-log syncing, and resolved session-based usage entries being shown as unknown providers.
|
||||
- **Usage Editor & Skills UI Regressions**: Fixed usage query fields being reset while editing extractor code, corrected broken `skills.sh` links and empty descriptions, and fixed auto-query defaults plus number-input clearing in usage configuration.
|
||||
- **Chinese Skills Terminology**: Unified Skills-related labels across settings panels in the `zh` locale so storage and sync options use consistent wording.
|
||||
- **Environment & Preset Compatibility**: Added Bun global bin detection in CLI scan, adapted to the oh-my-openagent rename with backward compatibility, corrected the OpenCode `kimi-for-coding` preset, gated Gemini keychain parsing to macOS, and fixed an OpenClaw serializer panic on empty collections.
|
||||
- **Linux UI Unresponsive on Startup**: Fixed a bug where the window UI (including native title bar buttons) couldn't receive clicks on Linux until the user manually maximized and restored the window. Root causes: (1) Tauri webview did not acquire keyboard focus after `show()` on Linux, so the first click was consumed by X11/Wayland click-to-activate (Tauri #10746, wry #637); (2) GTK surface's input region failed to renegotiate on the `visible:false → show()` path under some WebKitGTK/compositor combinations, leaving the entire window unresponsive. Mitigations: set `WEBKIT_DISABLE_COMPOSITING_MODE=1` at startup, and added a new `linux_fix::nudge_main_window` helper that performs `set_focus` + a ±1px no-op resize ~200ms after show, equivalent to a visually invisible "maximize-and-restore". Wired into all window-re-show paths (normal startup, deeplink, single_instance, tray `show_main`, lightweight exit).
|
||||
- **Linux Drag Region on Header**: Removed `data-tauri-drag-region` from the top header bar on Linux to avoid triggering `gtk_window_begin_move_drag` paths affected by Tauri #13440 under Wayland. macOS drag behavior is preserved.
|
||||
- **OpenCode / OpenClaw Stream Check Edge Cases**: Fixed custom-header passthrough, OpenClaw custom auth-header detection, Bedrock error messaging, and OpenCode default `baseURL` fallback handling in Stream Check.
|
||||
|
||||
### Docs
|
||||
|
||||
- **User Manual Refresh**: Updated the EN / ZH / JA manuals for tray submenus, lightweight mode, provider model fetching, session management, workspace files, WebDAV v2 behavior, OpenCode / OpenClaw activation, and other provider workflow improvements.
|
||||
- **Community & Contribution Docs**: Added `CONTRIBUTING.md`, `SECURITY.md`, `CODE_OF_CONDUCT.md`, bilingual issue / PR templates, Dependabot config, and CI quality checks.
|
||||
- **Release Notes Risk Notice**: Added a Copilot reverse proxy risk notice and anchored highlight links in the v3.12.3 release notes across all three languages.
|
||||
|
||||
---
|
||||
|
||||
## [3.12.3] - 2026-03-24
|
||||
|
||||
Major release adding GitHub Copilot reverse proxy support, macOS code signing & Apple notarization, intelligent reasoning effort mapping for o-series models, skill backup/restore lifecycle, proxy gzip compression, and critical fixes for WebDAV password safety, tool message parsing, and dark mode.
|
||||
|
||||
**Stats**: 36 commits | 107 files changed | +9,124 insertions | -802 deletions
|
||||
|
||||
### Added
|
||||
|
||||
- **GitHub Copilot Reverse Proxy**: Full GitHub Copilot integration as a Claude Code provider via OAuth Device Code flow; includes multi-account management, automatic token refresh, Anthropic ↔ OpenAI format conversion, real-time model list fetching, and usage statistics (#930)
|
||||
- **Copilot Auth Center**: New Auth Center panel in Settings for managing GitHub accounts globally, with per-provider account binding via `meta.authBinding`
|
||||
- **Tool Search Toggle**: Added `ENABLE_TOOL_SEARCH` env var support for Claude 2.1.76+; exposed as a checkbox in the provider Common Config editor (#930)
|
||||
- **Reasoning Effort Mapping**: Two-tier `resolve_reasoning_effort()` for OpenAI o-series and GPT-5+ models — explicit `output_config.effort` takes priority, falling back to thinking `budget_tokens` thresholds (<4 000→low, 4 000–16 000→medium, ≥16 000→high); covers both Chat Completions and Responses API paths with 17 unit tests
|
||||
- **OpenCode SQLite Backend**: Added SQLite session storage support for OpenCode alongside existing JSON backend; dual-backend scan with SQLite priority on ID conflicts, atomic session deletion, and path validation (#1401)
|
||||
- **Skill Auto-Backup**: Skill files are automatically backed up to `~/.cc-switch/skill-backups/` before uninstall, with metadata preserved in `meta.json`; old backups pruned to keep at most 20
|
||||
- **Skill Backup Restore & Delete**: Added list/restore/delete commands for skill backups; restore copies files back to SSOT, saves the DB record, and syncs to the current app with rollback on failure
|
||||
- **macOS Code Signing & Notarization**: CI now imports an Apple Developer ID certificate, signs the universal binary, submits for Apple notarization, and staples the ticket to both `.app` and `.dmg`; a hard-fail verification step (`codesign --verify` + `spctl -a` + `stapler validate`) gates the release for both artifacts
|
||||
- **Codex 1M Context Window Toggle**: One-click checkbox in Codex config editor to set `model_context_window = 1000000` with auto-populated `model_auto_compact_token_limit = 900000`; unchecking removes both fields
|
||||
- **Disable Auto-Upgrade Toggle**: Added `DISABLE_AUTOUPDATER` env var checkbox in the Claude Common Config editor to prevent Claude Code from auto-upgrading
|
||||
|
||||
### Changed
|
||||
|
||||
- **Skills Cache Strategy**: Replaced `invalidateQueries` with direct `setQueryData` updates for skill install/uninstall/import operations; added `staleTime: Infinity` with `keepPreviousData` to eliminate loading flicker (#1573)
|
||||
- **Proxy Gzip Compression**: Non-streaming proxy requests now auto-negotiate gzip compression instead of forcing `identity`; streaming requests conservatively keep `identity` to avoid SSE decompression errors
|
||||
- **o1/o3 Model Compatibility**: Chat Completions proxy forwarding now correctly uses `max_completion_tokens` instead of `max_tokens` for OpenAI o-series models such as o1/o3/o4-mini (#1451)
|
||||
- **OpenCode Model Variants**: Placed OpenCode model variants at top level instead of inside options for better discoverability (#1317)
|
||||
- **Skills Import Flow**: Replaced implicit filesystem-based app inference with explicit `ImportSkillSelection` to prevent incorrect multi-app activation; added reconciliation to remove disabled/orphaned symlinks and MCP servers from live config
|
||||
- **Claude 4.6 Context Window**: Updated Claude Opus 4.6 and Sonnet 4.6 context window from 200K to 1M across OpenClaw and OpenCode presets (GA release)
|
||||
- **MiniMax Model Upgrade**: Updated MiniMax presets from M2.5 to M2.7 across Claude, OpenClaw, and OpenCode configurations with updated partner descriptions in all three locales
|
||||
- **Xiaomi MiMo Model Upgrade**: Updated MiMo presets from mimo-v2-flash to mimo-v2-pro across all supported applications
|
||||
- **AddProviderDialog Simplification**: Removed redundant OAuth tab, reducing dialog from 3 tabs to 2 (app-specific + universal)
|
||||
- **Provider Form Advanced Options Collapse**: Model mapping, API format, and other advanced fields in the Claude provider form now auto-collapse when empty; auto-expands when any value is set or when a preset fills them in
|
||||
|
||||
### Fixed
|
||||
|
||||
- **WebDAV Password Silent Clear**: Fixed WebDAV password being silently wiped when ProviderList or UsageScriptModal saved settings by stripping `webdavSync` from frontend payloads and adding backend backfill logic in `merge_settings_for_save()` to preserve existing passwords
|
||||
- **Tool Message Parsing**: Fixed tool_use/tool_result message classification across Claude (tool_result content blocks), Codex (function_call/function_call_output payloads), and Gemini (array content + toolCalls extraction) session providers (#1401)
|
||||
- **Dark Mode Selector**: Changed Tailwind `darkMode` from `["selector", "class"]` to `["selector", ".dark"]` to ensure correct dark mode activation (#1596)
|
||||
- **Copilot Request Fingerprint**: Unified Copilot request fingerprint headers across all API call sites to prevent User-Agent leakage and stream check mismatches
|
||||
- **o-series Responses API Tokens**: Kept Responses API on the correct `max_output_tokens` field for o-series models instead of incorrectly injecting `max_completion_tokens`
|
||||
- **Provider Form Double Submit**: Prevented duplicate submissions on rapid button clicks in provider add/edit forms (#1352)
|
||||
- **Ghostty Session Restore**: Fixed Claude session restore in Ghostty terminal (#1506)
|
||||
- **Skill ZIP Import Extension**: Added `.skill` file extension support in ZIP import dialog (#1240, #1455)
|
||||
- **Skill ZIP Install Target App**: ZIP skill installs now use the currently active app instead of always defaulting to Claude
|
||||
- **OpenClaw Active Card Highlight**: Fixed active OpenClaw provider card not being highlighted (#1419)
|
||||
- **Responsive Layout with TOC**: Improved responsive design when TOC title exists (#1491)
|
||||
- **Import Skills Dialog White Screen**: Added missing TooltipProvider in ImportSkillsDialog to prevent runtime crash when opening the dialog
|
||||
- **Panel Bottom Blank Area**: Replaced hardcoded `h-[calc(100vh-8rem)]` with `flex-1 min-h-0` across all content panels to eliminate bottom gap caused by mismatched offset values
|
||||
|
||||
### Docs
|
||||
|
||||
- **Pricing Model ID Normalization**: Added documentation section explaining model ID normalization rules (prefix stripping, suffix trimming, `@`→`-` replacement) in EN/ZH/JA user manuals (#1591)
|
||||
- **macOS Signed & Notarized**: Removed all `xattr` workaround instructions and "unidentified developer" warnings from README, README_ZH, installation guides (EN/ZH/JA), and FAQ pages (EN/ZH/JA); replaced with "signed and notarized by Apple" messaging
|
||||
|
||||
---
|
||||
|
||||
## [3.12.2] - 2026-03-12
|
||||
|
||||
Post-v3.12.1 work focuses on Common Config safety during proxy takeover and more reliable Codex TOML editing.
|
||||
|
||||
**Stats**: 5 commits | 22 files changed | +1,716 insertions | -288 deletions
|
||||
|
||||
### Added
|
||||
|
||||
- **Empty State Guidance**: Improved first-run experience with detailed import instructions and a conditional Common Config snippet hint for Claude/Codex/Gemini providers
|
||||
|
||||
### Changed
|
||||
|
||||
- **Proxy Takeover Restore Flow**: Proxy takeover hot-switch and provider sync now refresh the restore backup instead of overwriting live config files, rebuilding effective provider settings with Common Config applied so rollback preserves the real user configuration
|
||||
- **Codex TOML Editing Engine**: Refactored Codex `config.toml` updates onto shared section-aware TOML helpers in Rust and TypeScript, covering `base_url` and `model` field edits across provider forms and takeover cleanup
|
||||
- **Common Config Initialization Lifecycle**: Startup now auto-extracts Common Config snippets from clean live configs before takeover restoration, tracks explicit "snippet cleared" state, and persists a one-time legacy migration flag to avoid repeated backfills
|
||||
|
||||
### Fixed
|
||||
|
||||
- **Common Config Loss During Takeover**: Fixed cases where proxy takeover could drop Common Config changes, overwrite live configs during sync, or produce incomplete restore snapshots when switching providers
|
||||
- **Codex Restore Snapshot Preservation**: Fixed Codex takeover restore backups so existing `mcp_servers` blocks survive provider hot-switches instead of being discarded; changed MCP backup preservation from wholesale table replacement to per-server-id merge so provider/common-config MCP updates win on conflict while live-only servers are retained
|
||||
- **Cleared Snippet Resurrection**: Fixed startup auto-extraction recreating Common Config snippets that users had intentionally cleared
|
||||
- **Codex `base_url` Misplacement**: Fixed Codex `base_url` extraction and editing to target the active `[model_providers.<name>]` section instead of appending to the file tail or confusing `mcp_servers.*.base_url` entries for provider endpoints
|
||||
|
||||
---
|
||||
|
||||
## [3.12.1] - 2026-03-12
|
||||
|
||||
### Patch Release
|
||||
|
||||
Stability-focused patch release fixing the Common Config modal infinite reopen loop, a WebDAV sync foreign key constraint failure, several i18n interpolation issues, and a Windows toolbar compact mode bug. Also adds **StepFun** provider presets, **OpenClaw input type selection** and **authHeader** support, upgrades Gemini to **3.1-pro**, and welcomes four new sponsor partners.
|
||||
|
||||
**Stats**: 19 commits | 56 files changed | +1,429 insertions | -396 deletions
|
||||
|
||||
### Added
|
||||
|
||||
#### Provider Presets
|
||||
|
||||
- **StepFun**: Added StepFun (阶跃星辰) provider presets including the step-3.5-flash model across supported applications (#1369, thanks @hengm3467)
|
||||
|
||||
#### OpenClaw Enhancements
|
||||
|
||||
- **Input Type Selection**: Added input type selection dropdown for model Advanced Options in OpenClaw configuration form (#1368, thanks @liuxxxu)
|
||||
- **authHeader Field**: Added optional `authHeader` boolean to OpenClawProviderConfig for vendor-specific auth header support (e.g. Longcat), and refactored form state to reuse the shared type
|
||||
|
||||
#### Sponsor Partners
|
||||
|
||||
- **Micu API**: Added Micu API as sponsor partner with affiliate links
|
||||
- **XCodeAPI**: Added XCodeAPI as sponsor partner
|
||||
- **SiliconFlow**: Added SiliconFlow (硅基流动) as sponsor partner with affiliate links
|
||||
- **CTok**: Added CTok as sponsor partner
|
||||
|
||||
### Changed
|
||||
|
||||
- **UCloud → Compshare**: Renamed UCloud provider to Compshare (优云智算) with full i18n support across all three locales (EN/ZH/JA)
|
||||
- **Compshare Links**: Updated Compshare sponsor registration links to coding-plan page
|
||||
- **Gemini Model Upgrade**: Upgraded default Gemini model from 2.5-pro to 3.1-pro in provider presets
|
||||
|
||||
### Fixed
|
||||
|
||||
#### Common Config & UI
|
||||
|
||||
- **Common Config Modal Loop**: Fixed an infinite reopen loop in the Common Config modal and added draft editing support to prevent data loss during edits
|
||||
- **Toolbar Compact Mode (Windows)**: Fixed toolbar compact mode not triggering on Windows due to left-side overflow (#1375, thanks @zuoliangyu)
|
||||
- **Session Search Index**: Fixed session search index not syncing with query data, causing stale list display after session deletion
|
||||
|
||||
#### Sync & Data
|
||||
|
||||
- **WebDAV Provider Health FK**: Fixed foreign key constraint failure when restoring `provider_health` table during WebDAV sync
|
||||
|
||||
#### Provider & Preset
|
||||
|
||||
- **Longcat authHeader**: Added missing `authHeader: true` to Longcat provider preset (#1377, thanks @wavever)
|
||||
- **OpenClaw Tool Permissions**: Aligned OpenClaw tool permission profiles with upstream schema (#1355, thanks @bigsongeth)
|
||||
- **X-Code API URL**: Corrected X-Code API URL from `www.x-code.cn` to `x-code.cc`
|
||||
|
||||
#### i18n & Localization
|
||||
|
||||
- **Stream Check Toast**: Fixed stream check toast i18n interpolation keys not matching translation placeholders
|
||||
- **Proxy Startup Toast**: Fixed proxy startup toast not interpolating address and port values (#1399, thanks @Mason-mengze)
|
||||
- **OpenCode API Format Label**: Renamed OpenCode API format label from "OpenAI" to "OpenAI Responses" for accuracy
|
||||
|
||||
---
|
||||
|
||||
## [3.12.0] - 2026-03-09
|
||||
|
||||
@@ -1,175 +0,0 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
> [中文版本](#贡献者公约行为准则)
|
||||
|
||||
## Our Pledge
|
||||
|
||||
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
|
||||
|
||||
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to a positive environment for our community include:
|
||||
|
||||
- Demonstrating empathy and kindness toward other people
|
||||
- Being respectful of differing opinions, viewpoints, and experiences
|
||||
- Giving and gracefully accepting constructive feedback
|
||||
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
||||
- Focusing on what is best not just for us as individuals, but for the overall community
|
||||
|
||||
Examples of unacceptable behavior include:
|
||||
|
||||
- The use of sexualized language or imagery, and sexual attention or advances of any kind
|
||||
- Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
- Public or private harassment
|
||||
- Publishing others' private information, such as a physical or email address, without their explicit permission
|
||||
- Other conduct which could reasonably be considered inappropriate in a professional setting
|
||||
|
||||
## Enforcement Responsibilities
|
||||
|
||||
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
||||
|
||||
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at **farion1231@gmail.com**. All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
|
||||
|
||||
## Enforcement Guidelines
|
||||
|
||||
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
||||
|
||||
### 1. Correction
|
||||
|
||||
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
||||
|
||||
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
||||
|
||||
### 2. Warning
|
||||
|
||||
**Community Impact**: A violation through a single incident or series of actions.
|
||||
|
||||
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
||||
|
||||
### 3. Temporary Ban
|
||||
|
||||
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
|
||||
|
||||
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
|
||||
|
||||
### 4. Permanent Ban
|
||||
|
||||
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
||||
|
||||
**Consequence**: A permanent ban from any sort of public interaction within the community.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
||||
|
||||
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
||||
|
||||
For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations].
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
||||
[Mozilla CoC]: https://github.com/mozilla/diversity
|
||||
[FAQ]: https://www.contributor-covenant.org/faq
|
||||
[translations]: https://www.contributor-covenant.org/translations
|
||||
|
||||
---
|
||||
|
||||
# 贡献者公约行为准则
|
||||
|
||||
> [English Version](#contributor-covenant-code-of-conduct)
|
||||
|
||||
## 我们的承诺
|
||||
|
||||
身为社区成员、贡献者和领袖,我们承诺使社区参与者不受骚扰,无论其年龄、体型、可见或不可见的缺陷、族裔、性征、性别认同和表达、经验水平、教育程度、社会与经济地位、国籍、相貌、种族、种姓、肤色、宗教信仰、性倾向或性取向如何。
|
||||
|
||||
我们承诺以有助于建立开放、友善、多样化、包容、健康社区的方式行事和互动。
|
||||
|
||||
## 我们的准则
|
||||
|
||||
有助于为我们的社区创造积极环境的行为例子包括但不限于:
|
||||
|
||||
- 表现出对他人的同情和善意
|
||||
- 尊重不同的主张、观点和感受
|
||||
- 提出和大方接受建设性意见
|
||||
- 承担责任并向受我们错误影响的人道歉
|
||||
- 注重社区共同诉求,而非个人得失
|
||||
|
||||
不当行为例子包括:
|
||||
|
||||
- 使用情色化的语言或图像,及性引诱或挑逗
|
||||
- 嘲弄、侮辱或诋毁性评论,以及人身或政治攻击
|
||||
- 公开或私下的骚扰行为
|
||||
- 未经他人明确许可,公布他人的私人信息,如物理或电子邮件地址
|
||||
- 其他有理由认定为违反职业操守的不当行为
|
||||
|
||||
## 责任和权力
|
||||
|
||||
社区领袖有责任解释和落实我们所认可的行为准则,并妥善公正地对他们认为不当、威胁、冒犯或有害的任何行为采取纠正措施。
|
||||
|
||||
社区领袖有权力和责任删除、编辑或拒绝与本行为准则不相符的评论(comment)、提交(able)、代码、维基(wiki)编辑、议题(able)或其他贡献,并在适当时告知采取措施的理由。
|
||||
|
||||
## 适用范围
|
||||
|
||||
本行为准则适用于所有社区场合,也适用于在公共场所代表社区时的个人。
|
||||
|
||||
代表社区的情形包括使用官方电子邮件地址、通过官方社交媒体帐户发帖或在线上或线下活动中担任指定代表。
|
||||
|
||||
## 监督
|
||||
|
||||
辱骂、骚扰或其他不可接受的行为可通过 **farion1231@gmail.com** 向负责监督的社区领袖报告。所有投诉都将得到及时和公平的审查和调查。
|
||||
|
||||
所有社区领袖都有义务尊重任何事件报告者的隐私和安全。
|
||||
|
||||
## 处理方针
|
||||
|
||||
社区领袖将遵循下列社区处理方针来明确他们所认定违反本行为准则的行为的处理方式:
|
||||
|
||||
### 1. 纠正
|
||||
|
||||
**社区影响**:使用不恰当的语言或其他在社区中被认定为不符合职业道德或不受欢迎的行为。
|
||||
|
||||
**处理意见**:由社区领袖发出非公开的书面警告,明确说明违规行为的性质,并解释举止如何不妥。或将要求公开道歉。
|
||||
|
||||
### 2. 警告
|
||||
|
||||
**社区影响**:单个或一系列违规行为。
|
||||
|
||||
**处理意见**:警告并对连续性行为进行处理。在指定时间内,不得与相关人员互动,包括主动与行为准则执行者互动。这包括避免在社区场所和外部渠道中的互动。违反这些条款可能会导致临时或永久封禁。
|
||||
|
||||
### 3. 临时封禁
|
||||
|
||||
**社区影响**:严重违反社区准则,包括持续的不当行为。
|
||||
|
||||
**处理意见**:在指定时间内,暂时禁止与社区进行任何形式的互动或公开交流。在此期间,不得与相关人员进行公开或私下互动,包括主动与行为准则执行者互动。违反这些条款可能会导致永久封禁。
|
||||
|
||||
### 4. 永久封禁
|
||||
|
||||
**社区影响**:行为模式表现出违反社区准则,包括持续的不当行为、骚扰个人或攻击或贬低某个类别的个体。
|
||||
|
||||
**处理意见**:永久禁止在社区内进行任何形式的公开互动。
|
||||
|
||||
## 参见
|
||||
|
||||
本行为准则改编自 [Contributor Covenant][homepage] 2.1 版,参见 [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]。
|
||||
|
||||
社区处理方针灵感来源于 [Mozilla 的行为准则执行阶梯][Mozilla CoC]。
|
||||
|
||||
有关本行为准则的常见问题的答案,参见 [https://www.contributor-covenant.org/faq][FAQ]。其他语言翻译参见 [https://www.contributor-covenant.org/translations][translations]。
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
||||
[Mozilla CoC]: https://github.com/mozilla/diversity
|
||||
[FAQ]: https://www.contributor-covenant.org/faq
|
||||
[translations]: https://www.contributor-covenant.org/translations
|
||||
@@ -1,253 +0,0 @@
|
||||
# Contributing to CC Switch
|
||||
|
||||
> [中文版本](#贡献指南)
|
||||
|
||||
Thank you for your interest in contributing to CC Switch! Please read our [Code of Conduct](./CODE_OF_CONDUCT.md) before participating.
|
||||
|
||||
## How to Contribute
|
||||
|
||||
There are many ways to contribute:
|
||||
|
||||
- **Report bugs** — Found something broken? [Open a bug report](https://github.com/farion1231/cc-switch/issues/new?template=bug_report.yml).
|
||||
- **Suggest features** — Have an idea? [Submit a feature request](https://github.com/farion1231/cc-switch/issues/new?template=feature_request.yml).
|
||||
- **Improve docs** — Spot a typo or missing info? [Report a doc issue](https://github.com/farion1231/cc-switch/issues/new?template=doc_issue.yml).
|
||||
- **Contribute code** — Fix bugs or implement features via pull requests.
|
||||
- **Translate** — Help us improve translations for English, Chinese, and Japanese.
|
||||
|
||||
> **Security vulnerabilities**: Please do NOT use public issues. See our [Security Policy](./SECURITY.md) instead.
|
||||
|
||||
## Development Setup
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- Node.js 18+ and pnpm 8+
|
||||
- Rust 1.85+ and Cargo
|
||||
- [Tauri 2.0 prerequisites](https://v2.tauri.app/start/prerequisites/)
|
||||
|
||||
### Quick Start
|
||||
|
||||
```bash
|
||||
# Install dependencies
|
||||
pnpm install
|
||||
|
||||
# Start development server with hot reload
|
||||
pnpm dev
|
||||
```
|
||||
|
||||
### Useful Commands
|
||||
|
||||
| Command | Description |
|
||||
|---------|-------------|
|
||||
| `pnpm dev` | Start dev server (hot reload) |
|
||||
| `pnpm build` | Production build |
|
||||
| `pnpm typecheck` | TypeScript type checking |
|
||||
| `pnpm test:unit` | Run unit tests |
|
||||
| `pnpm lint` | ESLint check |
|
||||
| `pnpm format` | Format code (Prettier) |
|
||||
| `pnpm format:check` | Check code formatting |
|
||||
|
||||
For Rust backend:
|
||||
|
||||
```bash
|
||||
cd src-tauri
|
||||
cargo fmt # Format Rust code
|
||||
cargo clippy # Run linter
|
||||
cargo test # Run tests
|
||||
```
|
||||
|
||||
## Code Style
|
||||
|
||||
- **Frontend**: Prettier for formatting, ESLint for linting, strict TypeScript (`pnpm typecheck`)
|
||||
- **Backend**: `cargo fmt` for formatting, `cargo clippy` for linting
|
||||
- **Tauri 2.0**: Command names must use camelCase
|
||||
|
||||
Run all checks before submitting:
|
||||
|
||||
```bash
|
||||
pnpm typecheck && pnpm format:check && pnpm test:unit
|
||||
cd src-tauri && cargo fmt --check && cargo clippy && cargo test
|
||||
```
|
||||
|
||||
## Pull Request Guidelines
|
||||
|
||||
1. **Open an issue first** for new features — PRs for features that are not a good fit may be closed.
|
||||
2. **Fork and branch** — Create a feature branch from `main` (e.g., `feat/my-feature` or `fix/issue-123`).
|
||||
3. **Keep PRs focused** — One feature or fix per PR. Avoid unrelated changes.
|
||||
4. **Follow the PR template** — Fill in the summary, related issue, and checklist.
|
||||
|
||||
### PR Checklist
|
||||
|
||||
- [ ] `pnpm typecheck` passes
|
||||
- [ ] `pnpm format:check` passes
|
||||
- [ ] `cargo clippy` passes (if Rust code changed)
|
||||
- [ ] Updated i18n files if user-facing text changed
|
||||
|
||||
### Commit Convention
|
||||
|
||||
We use [Conventional Commits](https://www.conventionalcommits.org/):
|
||||
|
||||
```
|
||||
feat(provider): add support for new provider
|
||||
fix(tray): resolve menu not updating after switch
|
||||
docs(readme): update installation instructions
|
||||
ci: add format check workflow
|
||||
chore(deps): update dependencies
|
||||
```
|
||||
|
||||
## AI-Assisted Contributions
|
||||
|
||||
We welcome AI-assisted contributions, but **the responsibility stays with you**. AI tools lower the cost of writing code — they do not lower the cost of reviewing it. Maintainers are not obligated to clean up AI-generated output.
|
||||
|
||||
By submitting a PR, you agree to the following:
|
||||
|
||||
1. **You have read and understood your code.** You must be able to explain any line in your PR. If you cannot, it is not ready for review.
|
||||
2. **You have tested it yourself.** Every change must be verified locally — not just "it looks right." Do not submit code for platforms or features you cannot test.
|
||||
3. **PRs must be small and focused.** One issue, one PR. Large, sprawling, multi-topic PRs will be closed.
|
||||
4. **Open an issue first.** Drive-by PRs with no prior discussion — especially AI-generated ones — may be closed without review.
|
||||
5. **Maintainers may close without explanation.** PRs that appear to be unreviewed AI output — hallucinated fixes, unnecessary refactors, bulk changes with no context — may be closed at the maintainer's discretion.
|
||||
|
||||
**In short**: AI is a tool, not a substitute for understanding. Use it to help you contribute better, not to shift work onto maintainers.
|
||||
|
||||
## Internationalization (i18n)
|
||||
|
||||
CC Switch supports three languages. When modifying user-facing text:
|
||||
|
||||
1. Update **all three** locale files:
|
||||
- `src/locales/en/translation.json`
|
||||
- `src/locales/zh/translation.json`
|
||||
- `src/locales/ja/translation.json`
|
||||
2. Use the `t()` function from i18next for all UI text.
|
||||
3. Never hardcode user-facing strings.
|
||||
|
||||
## Questions?
|
||||
|
||||
- [Open a question](https://github.com/farion1231/cc-switch/issues/new?template=question.yml)
|
||||
- [GitHub Discussions](https://github.com/farion1231/cc-switch/discussions)
|
||||
|
||||
---
|
||||
|
||||
# 贡献指南
|
||||
|
||||
> [English Version](#contributing-to-cc-switch)
|
||||
|
||||
感谢你对 CC Switch 的贡献兴趣!参与之前请阅读我们的[行为准则](./CODE_OF_CONDUCT.md)。
|
||||
|
||||
## 如何贡献
|
||||
|
||||
你可以通过多种方式参与贡献:
|
||||
|
||||
- **报告 Bug** — 发现问题?[提交 Bug 报告](https://github.com/farion1231/cc-switch/issues/new?template=bug_report.yml)。
|
||||
- **建议功能** — 有想法?[提交功能请求](https://github.com/farion1231/cc-switch/issues/new?template=feature_request.yml)。
|
||||
- **改进文档** — 发现错误或缺失?[报告文档问题](https://github.com/farion1231/cc-switch/issues/new?template=doc_issue.yml)。
|
||||
- **贡献代码** — 通过 Pull Request 修复 Bug 或实现新功能。
|
||||
- **翻译** — 帮助改进英文、中文和日文的翻译。
|
||||
|
||||
> **安全漏洞**:请不要使用公开 Issue 报告。请参阅我们的[安全策略](./SECURITY.md)。
|
||||
|
||||
## 开发环境搭建
|
||||
|
||||
### 前提条件
|
||||
|
||||
- Node.js 18+ 和 pnpm 8+
|
||||
- Rust 1.85+ 和 Cargo
|
||||
- [Tauri 2.0 开发环境](https://v2.tauri.app/start/prerequisites/)
|
||||
|
||||
### 快速开始
|
||||
|
||||
```bash
|
||||
# 安装依赖
|
||||
pnpm install
|
||||
|
||||
# 启动开发服务器(热重载)
|
||||
pnpm dev
|
||||
```
|
||||
|
||||
### 常用命令
|
||||
|
||||
| 命令 | 说明 |
|
||||
|------|------|
|
||||
| `pnpm dev` | 启动开发服务器(热重载) |
|
||||
| `pnpm build` | 构建生产版本 |
|
||||
| `pnpm typecheck` | TypeScript 类型检查 |
|
||||
| `pnpm test:unit` | 运行单元测试 |
|
||||
| `pnpm lint` | ESLint 检查 |
|
||||
| `pnpm format` | 格式化代码(Prettier) |
|
||||
| `pnpm format:check` | 检查代码格式 |
|
||||
|
||||
Rust 后端命令:
|
||||
|
||||
```bash
|
||||
cd src-tauri
|
||||
cargo fmt # 格式化 Rust 代码
|
||||
cargo clippy # 运行 Clippy 检查
|
||||
cargo test # 运行测试
|
||||
```
|
||||
|
||||
## 代码规范
|
||||
|
||||
- **前端**:使用 Prettier 格式化、ESLint 检查、严格 TypeScript(`pnpm typecheck`)
|
||||
- **后端**:使用 `cargo fmt` 格式化、`cargo clippy` 检查
|
||||
- **Tauri 2.0**:命令名必须使用 camelCase
|
||||
|
||||
提交前运行所有检查:
|
||||
|
||||
```bash
|
||||
pnpm typecheck && pnpm format:check && pnpm test:unit
|
||||
cd src-tauri && cargo fmt --check && cargo clippy && cargo test
|
||||
```
|
||||
|
||||
## Pull Request 指南
|
||||
|
||||
1. **先开 Issue 讨论** — 新功能请先开 Issue,不适合项目方向的 PR 可能会被关闭。
|
||||
2. **Fork 并创建分支** — 从 `main` 创建功能分支(如 `feat/my-feature` 或 `fix/issue-123`)。
|
||||
3. **保持 PR 专注** — 每个 PR 只做一件事,避免无关改动。
|
||||
4. **遵循 PR 模板** — 填写概述、关联 Issue 和检查清单。
|
||||
|
||||
### PR 检查清单
|
||||
|
||||
- [ ] `pnpm typecheck` 通过
|
||||
- [ ] `pnpm format:check` 通过
|
||||
- [ ] `cargo clippy` 通过(如修改了 Rust 代码)
|
||||
- [ ] 如修改了用户可见文本,已更新国际化文件
|
||||
|
||||
### 提交信息规范
|
||||
|
||||
我们使用 [Conventional Commits](https://www.conventionalcommits.org/):
|
||||
|
||||
```
|
||||
feat(provider): add support for new provider
|
||||
fix(tray): resolve menu not updating after switch
|
||||
docs(readme): update installation instructions
|
||||
ci: add format check workflow
|
||||
chore(deps): update dependencies
|
||||
```
|
||||
|
||||
## AI 辅助贡献
|
||||
|
||||
我们欢迎 AI 辅助的贡献,但**责任始终在你身上**。AI 工具降低了写代码的成本,但并没有降低 review 的成本。维护者没有义务替你清理 AI 的产出。
|
||||
|
||||
提交 PR 即表示你同意以下规则:
|
||||
|
||||
1. **你已阅读并理解了你的代码。** 你必须能解释 PR 中的每一行。如果做不到,说明还没准备好提交 review。
|
||||
2. **你已亲自测试过。** 每个改动都必须在本地验证——而不是"看起来对"。不要提交你自己无法测试的平台或功能的代码。
|
||||
3. **PR 必须小而聚焦。** 一个 Issue 对应一个 PR。大而散、跨多个主题的 PR 会被直接关闭。
|
||||
4. **先开 Issue 讨论。** 没有事先讨论的"路过式 PR"——尤其是 AI 生成的——可能会被直接关闭。
|
||||
5. **维护者可以直接关闭。** 看起来是未经审阅的 AI 产出的 PR——虚构的修复、不必要的重构、缺乏上下文的批量改动——维护者可自行决定关闭。
|
||||
|
||||
**一句话总结**:AI 是工具,不是理解力的替代品。用它来帮助你更好地贡献,而不是把工作转移给维护者。
|
||||
|
||||
## 国际化(i18n)
|
||||
|
||||
CC Switch 支持三种语言。修改用户可见文本时:
|
||||
|
||||
1. **同时更新三个**语言文件:
|
||||
- `src/locales/en/translation.json`
|
||||
- `src/locales/zh/translation.json`
|
||||
- `src/locales/ja/translation.json`
|
||||
2. 所有 UI 文本使用 i18next 的 `t()` 函数。
|
||||
3. 不要硬编码用户可见的字符串。
|
||||
|
||||
## 有疑问?
|
||||
|
||||
- [提问](https://github.com/farion1231/cc-switch/issues/new?template=question.yml)
|
||||
- [GitHub 讨论区](https://github.com/farion1231/cc-switch/discussions)
|
||||
@@ -4,10 +4,10 @@
|
||||
|
||||
### The All-in-One Manager for Claude Code, Codex, Gemini CLI, OpenCode & OpenClaw
|
||||
|
||||
[](https://github.com/farion1231/cc-switch/releases)
|
||||
[](https://github.com/farion1231/cc-switch/releases)
|
||||
[](https://github.com/farion1231/cc-switch/releases)
|
||||
[](https://tauri.app/)
|
||||
[](https://github.com/farion1231/cc-switch/releases/latest)
|
||||
[](https://github.com/farion1231/cc-switch/releases/latest)
|
||||
|
||||
<a href="https://trendshift.io/repositories/15372" target="_blank"><img src="https://trendshift.io/api/badge/repositories/15372" alt="farion1231%2Fcc-switch | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
|
||||
|
||||
@@ -17,16 +17,14 @@ English | [中文](README_ZH.md) | [日本語](README_JA.md) | [Changelog](CHANG
|
||||
|
||||
## ❤️Sponsor
|
||||
|
||||
> [Want to appear here?](mailto:farion1231@gmail.com)
|
||||
|
||||
<details open>
|
||||
<summary>Click to collapse</summary>
|
||||
|
||||
[](https://platform.minimax.io/subscribe/coding-plan?code=ClLhgxr2je&source=link)
|
||||
|
||||
MiniMax-M2.7 is a next-generation large language model designed for autonomous evolution and real-world productivity. Unlike traditional models, M2.7 actively participates in its own improvement through agent teams, dynamic tool use, and reinforcement learning loops. It delivers strong performance in software engineering (56.22% on SWE-Pro, 55.6% on VIBE-Pro, 57.0% on Terminal Bench 2) and excels in complex office workflows, achieving a leading 1495 ELO on GDPval-AA. With high-fidelity editing across Word, Excel, and PowerPoint, and a 97% adherence rate across 40+ complex skills, M2.7 sets a new standard for building AI-native workflows and organizations.
|
||||
MiniMax-M2.5 is a SOTA large language model designed for real-world productivity. Trained in a diverse range of complex real-world digital working environments, M2.5 builds upon the coding expertise of M2.1 to extend into general office work, reaching fluency in generating and operating Word, Excel, and Powerpoint files, context switching between diverse software environments, and working across different agent and human teams. Scoring 80.2% on SWE-Bench Verified, 51.3% on Multi-SWE-Bench, and 76.3% on BrowseComp, M2.5 is also more token efficient than previous generations, having been trained to optimize its actions and output through planning.
|
||||
|
||||
[Click](https://platform.minimax.io/subscribe/coding-plan?code=ClLhgxr2je&source=link) to get an exclusive 12% off the MiniMax Token Plan!
|
||||
[Click](https://platform.minimax.io/subscribe/coding-plan?code=ClLhgxr2je&source=link) to get an exclusive 12% off the MiniMax Coding Plan!
|
||||
|
||||
---
|
||||
|
||||
@@ -36,16 +34,6 @@ MiniMax-M2.7 is a next-generation large language model designed for autonomous e
|
||||
<td>Thanks to PackyCode for sponsoring this project! PackyCode is a reliable and efficient API relay service provider, offering relay services for Claude Code, Codex, Gemini, and more. PackyCode provides special discounts for our software users: register using <a href="https://www.packyapi.com/register?aff=cc-switch">this link</a> and enter the "cc-switch" promo code during first recharge to get 10% off.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="180"><a href="https://cloud.siliconflow.cn/i/drGuwc9k"><img src="assets/partners/logos/silicon_en.jpg" alt="SiliconFlow" width="150"></a></td>
|
||||
<td>Thanks to SiliconFlow for sponsoring this project! SiliconFlow is a high-performance AI infrastructure and model API platform, providing fast and reliable access to language, speech, image, and video models in one place. With pay-as-you-go billing, broad multimodal model support, high-speed inference, and enterprise-grade stability, SiliconFlow helps developers and teams build and scale AI applications more efficiently. Register via <a href="https://cloud.siliconflow.cn/i/drGuwc9k">this link</a> and complete real-name verification to receive ¥20 in bonus credit, usable across models on the platform. SiliconFlow is also now compatible with OpenClaw, allowing users to connect a SiliconFlow API key and call major AI models for free.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="180"><a href="https://www.shengsuanyun.com/?from=CH_4HHXMRYF"><img src="assets/partners/logos/shengsuanyun.svg" alt="Shengsuanyun" width="150"></a></td>
|
||||
<td>Thanks to Shengsuanyun for sponsoring this project! Shengsuanyun is a super factory serving AI Native Teams — an industrial-grade AI task parallel execution platform. Its model marketplace aggregates Claude, ChatGPT, Gemini, and other domestic and international LLM and multimedia model capabilities with direct supply. Absolutely no reverse engineering or dilution — platform-wide model SLA availability reaches 99.7%, with <a href="https://watch.shengsuanyun.com/status/shengsuanyun">monitoring dashboards</a> showing green across the board. It also offers enterprise-grade custom gateways for fine-grained team cost and permission management, smart routing, security protection, and BYOK (Bring Your Own Key) hosting. The platform charges on a pay-per-use and tokens plan (coming soon) basis, with invoicing available. Register via <a href="https://www.shengsuanyun.com/?from=CH_4HHXMRYF">this link</a> as a new user to receive ¥10 in credits plus a 10% bonus on your first top-up.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="180"><a href="https://aigocode.com/invite/CC-SWITCH"><img src="assets/partners/logos/aigocode.png" alt="AIGoCode" width="150"></a></td>
|
||||
<td>Thanks to AIGoCode for sponsoring this project! AIGoCode is an all-in-one platform that integrates Claude Code, Codex, and the latest Gemini models, providing you with stable, efficient, and highly cost-effective AI coding services. The platform offers flexible subscription plans, zero risk of account suspension, direct access with no VPN required, and lightning-fast responses. AIGoCode has prepared a special benefit for CC Switch users: if you register via <a href="https://aigocode.com/invite/CC-SWITCH">this link</a>, you'll receive an extra 10% bonus credit on your first top-up!</td>
|
||||
@@ -68,8 +56,8 @@ Claude Code / Codex / Gemini official channels at 38% / 2% / 9% of original pric
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="180"><a href="https://www.compshare.cn/coding-plan?ytag=GPU_YY_YX_git_cc-switch"><img src="assets/partners/logos/ucloud.png" alt="Compshare" width="150"></a></td>
|
||||
<td>Thanks to Compshare for sponsoring this project! Compshare is UCloud's AI cloud platform, providing stable and comprehensive domestic and international model APIs with just one key. Featuring cost-effective monthly and pay-as-you-go Coding Plan packages at 60-80% off official prices. Supports Claude Code, Codex, and API access. Enterprise-grade high concurrency, 24/7 technical support, and self-service invoicing. Users who register via <a href="https://www.compshare.cn/coding-plan?ytag=GPU_YY_YX_git_cc-switch">this link</a> will receive a free 5 CNY platform trial credit!</td>
|
||||
<td width="180"><a href="https://www.compshare.cn/coding-plan?ytag=GPU_YY_YX_git_cc-switch"><img src="assets/partners/logos/ucloud.png" alt="Ucloud" width="150"></a></td>
|
||||
<td>Thanks to UCloud CompShare for sponsoring this project! CompShare is UCloud's AI cloud platform, providing stable and comprehensive domestic and international model APIs with just one key. Featuring cost-effective monthly and pay-as-you-go Coding Plan packages at 60-80% off official prices. Supports Claude Code, Codex, and API access. Enterprise-grade high concurrency, 24/7 technical support, and self-service invoicing. Users who register via <a href="https://www.compshare.cn/?ytag=GPU_YY_YX_git_cc-switch">this link</a> will receive a free 5 CNY platform trial credit!</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
@@ -83,7 +71,7 @@ Claude Code / Codex / Gemini official channels at 38% / 2% / 9% of original pric
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="180"><a href="https://crazyrouter.com/register?aff=OZcm&ref=cc-switch"><img src="assets/partners/logos/crazyrouter.jpg" alt="Crazyrouter" width="150"></a></td>
|
||||
<td width="180"><a href="https://crazyrouter.com/register?aff=OZcm&ref=cc-switch"><img src="assets/partners/logos/crazyrouter.jpg" alt="AICoding" width="150"></a></td>
|
||||
<td>Thanks to Crazyrouter for sponsoring this project! Crazyrouter is a high-performance AI API aggregation platform — one API key for 300+ models including Claude Code, Codex, Gemini CLI, and more. All models at 55% of official pricing with auto-failover, smart routing, and unlimited concurrency. Crazyrouter offers an exclusive deal for CC Switch users: register via <a href="https://crazyrouter.com/register?aff=OZcm&ref=cc-switch">this link</a> to get <strong>$2 free credit</strong> instantly, plus enter promo code `CCSWITCH` on your first top-up for an extra <strong>30% bonus credit</strong>! </td>
|
||||
</tr>
|
||||
|
||||
@@ -92,37 +80,6 @@ Claude Code / Codex / Gemini official channels at 38% / 2% / 9% of original pric
|
||||
<td>Thanks to SSSAiCode for sponsoring this project! SSSAiCode is a stable and reliable API relay service, dedicated to providing stable, reliable, and affordable Claude and Codex model services, <strong>offering high cost-effective official Claude service at just ¥0.5/$ equivalent</strong>, supporting monthly and pay-as-you-go billing plans with same-day fast invoicing. SSSAiCode offers a special deal for CC Switch users: register via <a href="https://www.sssaicode.com/register?ref=DCP0SM">this link</a> to enjoy $10 extra credit on every top-up!</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="180"><a href="https://www.openclaudecode.cn/register?aff=aOYQ"><img src="assets/partners/logos/mikubanner.svg" alt="Micu" width="150"></a></td>
|
||||
<td>Thanks to Micu API for sponsoring this project! Micu API is a global LLM relay service provider dedicated to delivering the best cost-performance ratio with high stability. Backed by a registered enterprise for core assurance, eliminating any risk of service discontinuation, with fast official invoicing support! We champion "zero cost to try": top up from as low as ¥1 with no minimum, and get fee-free refunds anytime! Micu API offers an exclusive deal for CC Switch users: register via <a href="https://www.openclaudecode.cn/register?aff=aOYQ">this link</a> and enter promo code "ccswitch" when topping up to enjoy a <strong>10% discount</strong>!</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="180"><a href="https://x-code.cc/register?aff=IbPp"><img src="assets/partners/logos/xcodeapi.png" alt="XCodeAPI" width="150"></a></td>
|
||||
<td>Thanks to XCodeAPI for sponsoring this project! XCodeAPI offers a special benefit for CC Switch users: register via <a href="https://x-code.cc/register?aff=IbPp">this link</a> and get an extra 10% credit bonus on your first order! (Contact the site admin to claim)</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="180"><a href="https://ctok.ai"><img src="assets/partners/logos/ctok.png" alt="CTok" width="150"></a></td>
|
||||
<td>Thanks to CTok.ai for sponsoring this project! CTok.ai is dedicated to building a one-stop AI programming tool service platform. We offer professional Claude Code packages and technical community services, with support for Google Gemini and OpenAI Codex. Through carefully designed plans and a professional tech community, we provide developers with reliable service guarantees and continuous technical support, making AI-assisted programming a true productivity tool. Click <a href="https://ctok.ai">here</a> to register!</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="180"><a href="https://chefshop.ai"><img src="assets/partners/logos/chefshop.png" alt="ChefShop" width="150"></a></td>
|
||||
<td>Thanks to ChefShop AI for sponsoring this project! ChefShop AI is a premium account service provider tailored for heavy AI subscription users. The platform offers official top-up and stable account services for mainstream large models including ChatGPT Plus/Pro, Claude Max, Grok Super/Heavy, and Gemini. Click <a href="https://chefshop.ai">here</a> to purchase!</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="180"><a href="https://vibecodingapi.ai"><img src="assets/partners/logos/lioncc.png" alt="LionCC" width="150"></a></td>
|
||||
<td>Thanks to LionCC for sponsoring this project! LionCC is built for Vibe Coders who pursue the ultimate development experience. We provide stable, low-latency, and competitively priced computing services for Claude Code, Codex, and OpenClaw, saving up to 50% in costs. After registering, add customer service on WeChat (HSQBJ088888888) with the code "cc-switch" to receive $10 in free credits (10 million tokens). For other collaborations, follow the blog @LionCC.ai. Click <a href="https://vibecodingapi.ai">here</a> to register!</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="180"><a href="https://ddshub.short.gy/ccswitch"><img src="assets/partners/logos/dds.png" alt="DDS" width="150"></a></td>
|
||||
<td>Thanks to DDS for sponsoring this project! DDS Hub is a reliable and high-performance Claude API proxy service. We provides cost-effective domestic Claude direct acceleration services for both individual and enterprise users. We offer stable and low-latency Claude Max number pools, with full support for Claude Haiku, Opus, Sonnet and other flagship models. Invoices are available for recharges of 1000 RMB or more. Enterprise customers can also enjoy customized grouping and dedicated technical support services.
|
||||
Exclusive benefit for CC Switch users: Register via <a href="https://ddshub.short.gy/ccswitch">the link </a>below and enjoy an extra 10% credit on your first recharge (please contact the group admin to claim after recharging)!</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</details>
|
||||
@@ -149,7 +106,7 @@ Modern AI-powered coding relies on CLI tools like Claude Code, Codex, Gemini CLI
|
||||
|
||||
## Features
|
||||
|
||||
[Full Changelog](CHANGELOG.md) | [Release Notes](docs/release-notes/v3.12.3-en.md)
|
||||
[Full Changelog](CHANGELOG.md) | [Release Notes](docs/release-notes/v3.12.0-en.md)
|
||||
|
||||
### Provider Management
|
||||
|
||||
@@ -207,9 +164,9 @@ CC Switch provides a "Shared Config Snippet" feature to pass common data (beyond
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>macOS installation</strong></summary>
|
||||
<summary><strong>macOS shows "unidentified developer" warning — how do I fix it?</strong></summary>
|
||||
|
||||
CC Switch for macOS is code-signed and notarized by Apple. You can download and install it directly — no extra steps needed. We recommend using the `.dmg` installer.
|
||||
The author doesn't have an Apple Developer account yet (registration in progress). Close the warning, then go to **System Settings → Privacy & Security → Open Anyway**. After that, the app will open normally.
|
||||
|
||||
</details>
|
||||
|
||||
@@ -234,7 +191,6 @@ Add an official provider from the preset list. After switching to it, run the Lo
|
||||
- **Local settings**: `~/.cc-switch/settings.json` (device-level UI preferences)
|
||||
- **Backups**: `~/.cc-switch/backups/` (auto-rotated, keeps 10 most recent)
|
||||
- **Skills**: `~/.cc-switch/skills/` (symlinked to corresponding apps by default)
|
||||
- **Skill Backups**: `~/.cc-switch/skill-backups/` (created automatically before uninstall, keeps 20 most recent)
|
||||
|
||||
</details>
|
||||
|
||||
@@ -267,7 +223,7 @@ For detailed guides on every feature, check out the **[User Manual](docs/user-ma
|
||||
### System Requirements
|
||||
|
||||
- **Windows**: Windows 10 and above
|
||||
- **macOS**: macOS 12 (Monterey) and above
|
||||
- **macOS**: macOS 10.15 (Catalina) and above
|
||||
- **Linux**: Ubuntu 22.04+ / Debian 11+ / Fedora 34+ and other mainstream distributions
|
||||
|
||||
### Windows Users
|
||||
@@ -291,9 +247,9 @@ brew upgrade --cask cc-switch
|
||||
|
||||
**Method 2: Manual Download**
|
||||
|
||||
Download `CC-Switch-v{version}-macOS.dmg` (recommended) or `.zip` from the [Releases](../../releases) page.
|
||||
Download `CC-Switch-v{version}-macOS.zip` from the [Releases](../../releases) page and extract to use.
|
||||
|
||||
> **Note**: CC Switch for macOS is code-signed and notarized by Apple. You can install and open it directly.
|
||||
> **Note**: Since the author doesn't have an Apple Developer account, you may see an "unidentified developer" warning on first launch. Please close it first, then go to "System Settings" → "Privacy & Security" → click "Open Anyway", and you'll be able to open it normally afterwards.
|
||||
|
||||
### Arch Linux Users
|
||||
|
||||
@@ -310,8 +266,14 @@ Download the latest Linux build from the [Releases](../../releases) page:
|
||||
- `CC-Switch-v{version}-Linux.deb` (Debian/Ubuntu)
|
||||
- `CC-Switch-v{version}-Linux.rpm` (Fedora/RHEL/openSUSE)
|
||||
- `CC-Switch-v{version}-Linux.AppImage` (Universal)
|
||||
- `CC-Switch-v{version}-Linux.flatpak` (Flatpak)
|
||||
|
||||
> **Flatpak**: Not included in official releases. You can build it yourself from the `.deb` — see [`flatpak/README.md`](flatpak/README.md) for instructions.
|
||||
Flatpak install & run:
|
||||
|
||||
```bash
|
||||
flatpak install --user ./CC-Switch-v{version}-Linux.flatpak
|
||||
flatpak run com.ccswitch.desktop
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary><strong>Architecture Overview</strong></summary>
|
||||
@@ -350,7 +312,7 @@ Download the latest Linux build from the [Releases](../../releases) page:
|
||||
- **ProviderService**: Provider CRUD, switching, backfill, sorting
|
||||
- **McpService**: MCP server management, import/export, live file sync
|
||||
- **ProxyService**: Local proxy mode with hot-switching and format conversion
|
||||
- **SessionManager**: Conversation history browsing across all supported apps
|
||||
- **SessionManager**: Claude Code conversation history browsing
|
||||
- **ConfigService**: Config import/export, backup rotation
|
||||
- **SpeedtestService**: API endpoint latency measurement
|
||||
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
|
||||
### Claude Code、Codex、Gemini CLI、OpenCode、OpenClaw のオールインワン管理ツール
|
||||
|
||||
[](https://github.com/farion1231/cc-switch/releases)
|
||||
[](https://github.com/farion1231/cc-switch/releases)
|
||||
[](https://github.com/farion1231/cc-switch/releases)
|
||||
[](https://tauri.app/)
|
||||
[](https://github.com/farion1231/cc-switch/releases/latest)
|
||||
[](https://github.com/farion1231/cc-switch/releases/latest)
|
||||
|
||||
<a href="https://trendshift.io/repositories/15372" target="_blank"><img src="https://trendshift.io/api/badge/repositories/15372" alt="farion1231%2Fcc-switch | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
|
||||
|
||||
@@ -17,16 +17,14 @@
|
||||
|
||||
## ❤️スポンサー
|
||||
|
||||
> [ここに掲載しませんか?](mailto:farion1231@gmail.com)
|
||||
|
||||
<details open>
|
||||
<summary>クリックで折りたたむ</summary>
|
||||
|
||||
[](https://platform.minimax.io/subscribe/coding-plan?code=ClLhgxr2je&source=link)
|
||||
|
||||
MiniMax-M2.7 は、自律的進化と実世界の生産性向上のために設計された次世代大規模言語モデルです。従来のモデルとは異なり、M2.7 はエージェントチーム、動的ツール使用、強化学習ループを通じて自身の改善に積極的に参加します。ソフトウェアエンジニアリングにおいて優れた性能を発揮し(SWE-Pro で 56.22%、VIBE-Pro で 55.6%、Terminal Bench 2 で 57.0%)、複雑なオフィスワークフローにも秀でており、GDPval-AA で 1495 ELO のリーディングスコアを達成しています。Word・Excel・PowerPoint の高忠実度編集と、40 以上の複雑なスキルにわたる 97% の遵守率により、M2.7 は AI ネイティブなワークフローと組織構築の新基準を打ち立てます。
|
||||
MiniMax-M2.5 は、実際の生産性向上のために設計された最先端の大規模言語モデルです。多様で複雑な実環境のデジタルワークスペースでトレーニングされた M2.5 は、M2.1 のコーディング能力をベースに一般的なオフィス業務へと拡張し、Word・Excel・PowerPoint ファイルの生成と操作、多様なソフトウェア環境間のコンテキスト切り替え、異なるエージェントや人間チーム間での協働を流暢にこなします。SWE-Bench Verified で 80.2%、Multi-SWE-Bench で 51.3%、BrowseComp で 76.3% を達成し、計画的な行動と出力の最適化トレーニングにより、前世代よりもトークン効率に優れています。
|
||||
|
||||
[こちら](https://platform.minimax.io/subscribe/coding-plan?code=ClLhgxr2je&source=link)から MiniMax Token Plan の限定 12% オフを入手!
|
||||
[こちら](https://platform.minimax.io/subscribe/coding-plan?code=ClLhgxr2je&source=link)から MiniMax Coding Plan の限定 12% オフを入手!
|
||||
|
||||
---
|
||||
|
||||
@@ -36,16 +34,6 @@ MiniMax-M2.7 は、自律的進化と実世界の生産性向上のために設
|
||||
<td>PackyCode のご支援に感謝します!PackyCode は Claude Code、Codex、Gemini などのリレーサービスを提供する信頼性の高い API 中継プラットフォームです。本ソフト利用者向けに特別割引があります:<a href="https://www.packyapi.com/register?aff=cc-switch">このリンク</a>で登録し、チャージ時に「cc-switch」クーポンを入力すると 10% オフになります。</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="180"><a href="https://cloud.siliconflow.cn/i/drGuwc9k"><img src="assets/partners/logos/silicon_en.jpg" alt="SiliconFlow" width="150"></a></td>
|
||||
<td>SiliconFlow のご支援に感謝します!SiliconFlow は高性能 AI インフラストラクチャおよびモデル API プラットフォームで、言語・音声・画像・動画モデルへの高速かつ信頼性の高いアクセスをワンストップで提供します。従量課金制、豊富なマルチモーダルモデル対応、高速推論、エンタープライズグレードの安定性を備え、開発者やチームがより効率的に AI アプリケーションを構築・拡張できるようサポートします。<a href="https://cloud.siliconflow.cn/i/drGuwc9k">このリンク</a>から登録し、本人確認を完了すると、プラットフォーム内の全モデルで利用可能な ¥20 のボーナスクレジットが付与されます。SiliconFlow は OpenClaw にも対応しており、SiliconFlow の API キーを接続することで主要な AI モデルを無料で呼び出すことができます。</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="180"><a href="https://www.shengsuanyun.com/?from=CH_4HHXMRYF"><img src="assets/partners/logos/shengsuanyun.svg" alt="Shengsuanyun" width="150"></a></td>
|
||||
<td>胜算雲(Shengsuanyun)のご支援に感謝します!胜算雲は AI ネイティブチーム向けのスーパーファクトリーであり、産業グレードの AI タスク並列実行プラットフォームです。モデルマーケットプレイスでは Claude、ChatGPT、Gemini をはじめとする国内外の LLM およびマルチメディアモデルの計算リソースを集約・直接提供。リバースエンジニアリングや品質低下は一切なく、プラットフォーム全体のモデル SLA 可用性は 99.7% に達し、<a href="https://watch.shengsuanyun.com/status/shengsuanyun">監視ダッシュボード</a>は常時グリーン表示です。さらにエンタープライズ向けカスタムゲートウェイを提供し、チームのきめ細かなコスト・権限管理、スマートルーティング、セキュリティ保護、BYOK(自社キー持ち込み)ホスティングを実現します。従量課金およびトークンプラン(近日公開)対応で、請求書発行にも対応。<a href="https://www.shengsuanyun.com/?from=CH_4HHXMRYF">このリンク</a>から新規登録すると 10 元分のクレジットと初回チャージ 10% ボーナスが付与されます。</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="180"><a href="https://aigocode.com/invite/CC-SWITCH"><img src="assets/partners/logos/aigocode.png" alt="AIGoCode" width="150"></a></td>
|
||||
<td>本プロジェクトは AIGoCode のスポンサー提供でお届けしています。AIGoCode は、Claude Code・Codex・最新の Gemini モデルを統合したオールインワンのAIコーディングプラットフォームで、安定性・高速性・コストパフォーマンスに優れた開発サービスを提供します。柔軟なサブスクリプションプランを備え、レスポンスも非常に高速です。さらに、CC Switch ユーザー向けの特典として、<a href="https://aigocode.com/invite/CC-SWITCH">このリンク</a>から登録すると、初回チャージ時に10%分のボーナスクレジットが付与されます!</td>
|
||||
@@ -68,8 +56,8 @@ Claude Code / Codex / Gemini 公式チャンネルが最安で元価格の 38% /
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="180"><a href="https://www.compshare.cn/coding-plan?ytag=GPU_YY_YX_git_cc-switch"><img src="assets/partners/logos/ucloud.png" alt="Compshare" width="150"></a></td>
|
||||
<td>Compshare のご支援に感謝します!Compshare は UCloud 傘下の AI クラウドプラットフォームで、国内外の安定した包括的なモデル API を 1 つのキーだけで利用可能。月額・従量課金のコストパフォーマンスに優れた Coding Plan パッケージを提供し、公式価格の 60〜80% オフで利用できます。Claude Code、Codex および API アクセスに対応。エンタープライズ級の高同時接続、24 時間年中無休のテクニカルサポート、セルフサービス請求書発行に対応。<a href="https://www.compshare.cn/coding-plan?ytag=GPU_YY_YX_git_cc-switch">こちらのリンク</a>から登録すると、無料で 5 元分のプラットフォーム体験クレジットがもらえます!</td>
|
||||
<td width="180"><a href="https://www.compshare.cn/coding-plan?ytag=GPU_YY_YX_git_cc-switch"><img src="assets/partners/logos/ucloud.png" alt="Ucloud" width="150"></a></td>
|
||||
<td>UCloud CompShare のご支援に感謝します!CompShare は UCloud 傘下の AI クラウドプラットフォームで、国内外の安定した包括的なモデル API を 1 つのキーだけで利用可能。月額・従量課金のコストパフォーマンスに優れた Coding Plan パッケージを提供し、公式価格の 60〜80% オフで利用できます。Claude Code、Codex および API アクセスに対応。エンタープライズ級の高同時接続、24 時間年中無休のテクニカルサポート、セルフサービス請求書発行に対応。<a href="https://www.compshare.cn/?ytag=GPU_YY_YX_git_cc-switch">こちらのリンク</a>から登録すると、無料で 5 元分のプラットフォーム体験クレジットがもらえます!</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
@@ -83,7 +71,7 @@ Claude Code / Codex / Gemini 公式チャンネルが最安で元価格の 38% /
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="180"><a href="https://crazyrouter.com/register?aff=OZcm&ref=cc-switch"><img src="assets/partners/logos/crazyrouter.jpg" alt="Crazyrouter" width="150"></a></td>
|
||||
<td width="180"><a href="https://crazyrouter.com/register?aff=OZcm&ref=cc-switch"><img src="assets/partners/logos/crazyrouter.jpg" alt="AICoding" width="150"></a></td>
|
||||
<td>Crazyrouter のご支援に感謝します!Crazyrouter は高性能 AI API アグリゲーションプラットフォームです。1 つの API キーで Claude Code、Codex、Gemini CLI など 300 以上のモデルにアクセス可能。全モデルが公式価格の 55% で利用でき、自動フェイルオーバー、スマートルーティング、無制限同時接続に対応。CC Switch ユーザー向けの限定特典:<a href="https://crazyrouter.com/register?aff=OZcm&ref=cc-switch">こちらのリンク</a>から登録すると <strong>$2 の無料クレジット</strong> を即時進呈。さらに初回チャージ時にプロモコード `CCSWITCH` を入力すると <strong>30% のボーナスクレジット</strong> が追加されます!</td>
|
||||
</tr>
|
||||
|
||||
@@ -92,38 +80,6 @@ Claude Code / Codex / Gemini 公式チャンネルが最安で元価格の 38% /
|
||||
<td>SSSAiCode のご支援に感謝します!SSSAiCode は安定性と信頼性に優れた API 中継サービスで、安定的で信頼性が高く、手頃な価格の Claude・Codex モデルサービスを提供しています。<strong>高コストパフォーマンスの公式 Claude サービスを 0.5¥/$ 換算で提供</strong>、月額制・Paygo など多様な課金方式に対応し、当日の迅速な請求書発行をサポート。CC Switch ユーザー向けの特別特典:<a href="https://www.sssaicode.com/register?ref=DCP0SM">こちらのリンク</a>から登録すると、毎回のチャージで $10 の追加ボーナスを受けられます!</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="180"><a href="https://www.openclaudecode.cn/register?aff=aOYQ"><img src="assets/partners/logos/mikubanner.svg" alt="Micu" width="150"></a></td>
|
||||
<td>Micu API のご支援に感謝します!Micu API は、最高のコストパフォーマンスと高い安定性を追求するグローバル大規模言語モデル中継サービスプロバイダーです。法人企業がバックアップしており、サービス停止のリスクを排除、迅速な正規請求書発行に対応!「試行コストゼロ」をモットーに、最低 1 元からチャージ可能で手数料無料、いつでも返金可能!CC Switch ユーザー向けの限定特典:<a href="https://www.openclaudecode.cn/register?aff=aOYQ">こちらのリンク</a>から登録し、チャージ時にプロモコード「ccswitch」を入力すると <strong>10% 割引</strong> が適用されます!</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="180"><a href="https://x-code.cc/register?aff=IbPp"><img src="assets/partners/logos/xcodeapi.png" alt="XCodeAPI" width="150"></a></td>
|
||||
<td>XCodeAPI のご支援に感謝します!CC Switch ユーザー向けの特別特典:<a href="https://x-code.cc/register?aff=IbPp">こちらのリンク</a>から登録すると、初回注文で 10% の追加クレジットボーナスがもらえます!(サイト管理者に連絡して受け取りください)</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="180"><a href="https://ctok.ai"><img src="assets/partners/logos/ctok.png" alt="CTok" width="150"></a></td>
|
||||
<td>CTok.ai のご支援に感謝します!CTok.ai はワンストップ AI プログラミングツールサービスプラットフォームの構築に取り組んでいます。Claude Code のプロフェッショナルプランと技術コミュニティサービスを提供し、Google Gemini や OpenAI Codex にも対応しています。丁寧に設計されたプランと専門的な技術コミュニティを通じて、開発者に安定したサービス保証と継続的な技術サポートを提供し、AI アシストプログラミングを真の生産性ツールにします。<a href="https://ctok.ai">こちら</a>から登録してください!</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="180"><a href="https://chefshop.ai"><img src="assets/partners/logos/chefshop.png" alt="ChefShop" width="150"></a></td>
|
||||
<td>ChefShop AI のご支援に感謝します!ChefShop AI は、AI ヘビーユーザー向けにカスタマイズされたプレミアムアカウントサービスプロバイダーです。ChatGPT Plus/Pro、Claude Max、Grok Super/Heavy、Gemini など主流の大規模モデルの公式チャージと安定したアカウントサービスを提供しています。<a href="https://chefshop.ai">こちら</a>から購入してください!</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="180"><a href="https://vibecodingapi.ai"><img src="assets/partners/logos/lioncc.png" alt="LionCC" width="150"></a></td>
|
||||
<td>LionCC のご支援に感謝します!LionCC は究極の開発体験を追求する「Vibe Coders」のために生まれました。Claude Code、Codex、OpenClaw 向けに安定・低遅延・お得な価格の計算リソースサービスを提供し、最大 50% のコスト削減を実現します。登録後、カスタマーサービスの WeChat(HSQBJ088888888)を追加し、合言葉「cc-switch」を送信すると、10 ドル分のクレジット(1,000 万トークン)がもらえます。その他のコラボレーションについてはブログ @LionCC.ai をフォローしてください。<a href="https://vibecodingapi.ai">こちら</a>から登録してください!</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="180"><a href="https://ddshub.short.gy/ccswitch"><img src="assets/partners/logos/dds.png" alt="DDS" width="150"></a></td>
|
||||
<td>本プロジェクトのスポンサーである DDS に感謝いたします! DDS(呆呆獣 / DDS Hub)は、Claude に特化した信頼性とパフォーマンスの高い API プロキシサービスです。個人および企業ユーザーの皆様に、圧倒的なコストパフォーマンスを誇る Claude 直結アクセラレーションサービスを提供しています。Claude Haiku / Opus / Sonnet などのフルスペックモデルを完全サポートし、安定した低遅延のアクセスを実現します。
|
||||
1,000人民元以上のチャージで領収書(発票)の発行が可能です。さらに、企業のお客様にはカスタマイズされたグループ管理や専用テクニカルサポートをご提供しています。
|
||||
CC Switch ユーザー限定特典: 専用リンクからご<a href="https://ddshub.short.gy/ccswitch">登録</a>いただくと、初回チャージ時に 10% の追加ボーナスクレジット をプレゼントいたします!(※チャージ完了後、グループ管理人へご連絡の上お受け取りください。)</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</details>
|
||||
@@ -150,7 +106,7 @@ CC Switch ユーザー限定特典: 専用リンクからご<a href="https://d
|
||||
|
||||
## 特長
|
||||
|
||||
[完全な更新履歴](CHANGELOG.md) | [リリースノート](docs/release-notes/v3.12.3-ja.md)
|
||||
[完全な更新履歴](CHANGELOG.md) | [リリースノート](docs/release-notes/v3.12.0-ja.md)
|
||||
|
||||
### プロバイダ管理
|
||||
|
||||
@@ -208,9 +164,9 @@ CC Switch には「共有設定スニペット」機能があり、APIキーや
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>macOS のインストールについて</strong></summary>
|
||||
<summary><strong>macOS で「開発元を確認できません」と表示されます。どうすればよいですか?</strong></summary>
|
||||
|
||||
CC Switch の macOS 版は Apple によるコード署名と公証が完了しています。直接ダウンロードしてインストールできます — 追加の手順は不要です。`.dmg` インストーラの使用を推奨します。
|
||||
開発者が Apple Developer アカウントをまだ取得していないためです(登録手続き中)。警告を閉じてから、**システム設定 → プライバシーとセキュリティ → このまま開く**をクリックしてください。以降は通常通り起動できます。
|
||||
|
||||
</details>
|
||||
|
||||
@@ -235,7 +191,6 @@ CC Switch は「最小限の介入」という設計原則に従っています
|
||||
- **ローカル設定**: `~/.cc-switch/settings.json`(デバイスレベルの UI 設定)
|
||||
- **バックアップ**: `~/.cc-switch/backups/`(自動ローテーション、最新 10 件を保持)
|
||||
- **Skills**: `~/.cc-switch/skills/`(デフォルトでシンボリックリンクにより対応アプリに接続)
|
||||
- **Skill バックアップ**: `~/.cc-switch/skill-backups/`(アンインストール前に自動作成、最新 20 件を保持)
|
||||
|
||||
</details>
|
||||
|
||||
@@ -268,7 +223,7 @@ CC Switch は「最小限の介入」という設計原則に従っています
|
||||
### システム要件
|
||||
|
||||
- **Windows**: Windows 10 以上
|
||||
- **macOS**: macOS 12 (Monterey) 以上
|
||||
- **macOS**: macOS 10.15 (Catalina) 以上
|
||||
- **Linux**: Ubuntu 22.04+ / Debian 11+ / Fedora 34+ など主要ディストリビューション
|
||||
|
||||
### Windows ユーザー
|
||||
@@ -311,8 +266,14 @@ paru -S cc-switch-bin
|
||||
- `CC-Switch-v{version}-Linux.deb`(Debian/Ubuntu)
|
||||
- `CC-Switch-v{version}-Linux.rpm`(Fedora/RHEL/openSUSE)
|
||||
- `CC-Switch-v{version}-Linux.AppImage`(汎用)
|
||||
- `CC-Switch-v{version}-Linux.flatpak`(Flatpak)
|
||||
|
||||
> **Flatpak**:公式リリースには含まれていません。`.deb` から自分でビルドできます — 手順は [`flatpak/README.md`](flatpak/README.md) を参照してください。
|
||||
Flatpak のインストールと起動:
|
||||
|
||||
```bash
|
||||
flatpak install --user ./CC-Switch-v{version}-Linux.flatpak
|
||||
flatpak run com.ccswitch.desktop
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary><strong>アーキテクチャ概要</strong></summary>
|
||||
@@ -351,7 +312,7 @@ paru -S cc-switch-bin
|
||||
- **ProviderService**: プロバイダの CRUD、切り替え、バックフィル、ソート
|
||||
- **McpService**: MCP サーバー管理、インポート/エクスポート、ライブファイル同期
|
||||
- **ProxyService**: ローカル Proxy モードのホットスイッチとフォーマット変換
|
||||
- **SessionManager**: 対応する全アプリの会話履歴閲覧
|
||||
- **SessionManager**: Claude Code の会話履歴閲覧
|
||||
- **ConfigService**: 設定のインポート/エクスポート、バックアップローテーション
|
||||
- **SpeedtestService**: API エンドポイントの遅延計測
|
||||
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
|
||||
### Claude Code、Codex、Gemini CLI、OpenCode 和 OpenClaw 的全方位管理工具
|
||||
|
||||
[](https://github.com/farion1231/cc-switch/releases)
|
||||
[](https://github.com/farion1231/cc-switch/releases)
|
||||
[](https://github.com/farion1231/cc-switch/releases)
|
||||
[](https://tauri.app/)
|
||||
[](https://github.com/farion1231/cc-switch/releases/latest)
|
||||
[](https://github.com/farion1231/cc-switch/releases/latest)
|
||||
|
||||
<a href="https://trendshift.io/repositories/15372" target="_blank"><img src="https://trendshift.io/api/badge/repositories/15372" alt="farion1231%2Fcc-switch | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
|
||||
|
||||
@@ -17,16 +17,14 @@
|
||||
|
||||
## ❤️赞助商
|
||||
|
||||
> [想出现在这里?](mailto:farion1231@gmail.com)
|
||||
|
||||
<details open>
|
||||
<summary>点击折叠</summary>
|
||||
|
||||
[](https://platform.minimaxi.com/subscribe/coding-plan?code=7kYF2VoaCn&source=link)
|
||||
|
||||
MiniMax M2.7 是 MiniMax 首个深度参与自我迭代的模型,可自主构建复杂 Agent Harness,并基于 Agent Teams、复杂 Skills、Tool Search Tool 等能力完成高复杂度生产力任务;其在软件工程、端到端项目交付及办公场景中表现优异,多项评测接近行业领先水平,同时具备稳定的复杂任务执行、环境交互能力以及良好的情商与身份保持能力。
|
||||
MiniMax M2.5 在编程、工具调用与搜索、办公等核心生产力场景均达到或刷新行业 SOTA,拥有架构师级代码能力与高效任务拆解能力,推理速度较上一代提升 37%、token 消耗更优;100 token/s 连续工作一小时仅需 1 美金,让复杂 Agent 规模化部署经济可行,已在企业多职能场景深度落地,加速全民 Agent 时代到来。
|
||||
|
||||
[点击此处](https://platform.minimaxi.com/subscribe/coding-plan?code=7kYF2VoaCn&source=link)享 MiniMax Token Plan 专属 88 折优惠!
|
||||
[点击](https://platform.minimaxi.com/subscribe/coding-plan?code=7kYF2VoaCn&source=link)即可领取 MiniMax Coding Plan 专属 88 折优惠!
|
||||
|
||||
---
|
||||
|
||||
@@ -36,16 +34,6 @@ MiniMax M2.7 是 MiniMax 首个深度参与自我迭代的模型,可自主构
|
||||
<td>感谢 PackyCode 赞助了本项目!PackyCode 是一家稳定、高效的API中转服务商,提供 Claude Code、Codex、Gemini 等多种中转服务。PackyCode 为本软件的用户提供了特别优惠,使用<a href="https://www.packyapi.com/register?aff=cc-switch">此链接</a>注册并在充值时填写"cc-switch"优惠码,首次充值可以享受9折优惠!</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="180"><a href="https://cloud.siliconflow.cn/i/drGuwc9k"><img src="assets/partners/logos/silicon_zh.jpg" alt="SiliconFlow" width="150"></a></td>
|
||||
<td>感谢硅基流动赞助了本项目!硅基流动是一个高性能 AI 基础设施与模型 API 平台,一站式提供语言、语音、图像、视频等多模态模型的快速、可靠访问。平台支持按量计费、丰富的多模态模型选择、高速推理和企业级稳定性,帮助开发者和团队更高效地构建和扩展 AI 应用。通过<a href="https://cloud.siliconflow.cn/i/drGuwc9k">此链接</a>注册并完成实名认证,即可获得 ¥20 奖励金,可在平台内跨模型使用。硅基流动现已兼容 OpenClaw,用户可接入硅基流动 API Key 免费调用主流 AI 模型。</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="180"><a href="https://www.shengsuanyun.com/?from=CH_4HHXMRYF"><img src="assets/partners/logos/shengsuanyun.svg" alt="Shengsuanyun" width="150"></a></td>
|
||||
<td>感谢胜算云赞助了本项目!胜算云是专为AI Native Teams服务的超级工厂,工业级AI任务并行执行平台,模型商城集采直供聚合接入了Claude、Chatgpt、Gemini等海内外LLM及图片视频多媒体模型算力,绝无逆向掺水、全站模型SLA可用性高达99.7%、<a href="https://watch.shengsuanyun.com/status/shengsuanyun">监测接口</a>日常全绿。更有企业级专属定制网关,实现团队精细化成本与权限管控,智能路由+安全防护+BYOK企业自带密钥托管。平台按量及tokens plan(即将上线)计费,可开票,使用<a href="https://www.shengsuanyun.com/?from=CH_4HHXMRYF">此链接</a>注册新用户可获10元模力及首充10%赠送。</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="180"><a href="https://aigocode.com/invite/CC-SWITCH"><img src="assets/partners/logos/aigocode.png" alt="AIGoCode" width="150"></a></td>
|
||||
<td>感谢 AIGoCode 赞助了本项目!AIGoCode 是一个集成了 Claude Code、Codex 以及 Gemini 最新模型的一站式平台,为你提供稳定、高效且高性价比的AI编程服务。本站提供灵活的订阅计划,零封号风险,国内直连,无需魔法,极速响应。AIGoCode 为 CC Switch 的用户提供了特别福利,通过<a href="https://aigocode.com/invite/CC-SWITCH">此链接</a>注册的用户首次充值可以获得额外10%奖励额度!</td>
|
||||
@@ -69,8 +57,8 @@ Claude Code / Codex / Gemini 官方渠道低至 3.8 / 0.2 / 0.9 折,充值更
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="180"><a href="https://www.compshare.cn/coding-plan?ytag=GPU_YY_YX_git_cc-switch"><img src="assets/partners/logos/ucloud.png" alt="优云智算" width="150"></a></td>
|
||||
<td>感谢优云智算赞助了本项目!优云智算是UCloud旗下AI云平台,提供稳定、全面的国内外模型API,仅一个key即可调用。主打包月、按量的高性价比 Coding Plan 套餐,基于官方2~5折优惠。支持接入 Claude Code、Codex 及 API 调用。支持企业高并发、7*24技术支持、自助开票。通过<a href="https://www.compshare.cn/coding-plan?ytag=GPU_YY_YX_git_cc-switch">此链接</a>注册的用户,可得免费5元平台体验金!</td>
|
||||
<td width="180"><a href="https://www.compshare.cn/coding-plan?ytag=GPU_YY_YX_git_cc-switch"><img src="assets/partners/logos/ucloud.png" alt="Ucloud" width="150"></a></td>
|
||||
<td>感谢优云智算赞助了本项目!优云智算是UCloud旗下AI云平台,提供稳定、全面的国内外模型API,仅一个key即可调用。主打包月、按量的高性价比 Coding Plan 套餐,基于官方2~5折优惠。支持接入 Claude Code、Codex 及 API 调用。支持企业高并发、7*24技术支持、自助开票。通过<a href="https://www.compshare.cn/?ytag=GPU_YY_YX_git_cc-switch">此链接</a>注册的用户,可得免费5元平台体验金!</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
@@ -84,7 +72,7 @@ Claude Code / Codex / Gemini 官方渠道低至 3.8 / 0.2 / 0.9 折,充值更
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="180"><a href="https://crazyrouter.com/register?aff=OZcm&ref=cc-switch"><img src="assets/partners/logos/crazyrouter.jpg" alt="Crazyrouter" width="150"></a></td>
|
||||
<td width="180"><a href="https://crazyrouter.com/register?aff=OZcm&ref=cc-switch"><img src="assets/partners/logos/crazyrouter.jpg" alt="AICoding" width="150"></a></td>
|
||||
<td>感谢 Crazyrouter 赞助了本项目!Crazyrouter 是一个高性能 AI API 聚合平台——一个 API Key 即可访问 300+ 模型,包括 Claude Code、Codex、Gemini CLI 等。全部模型低至官方定价的 55%,支持自动故障转移、智能路由和无限并发。Crazyrouter 为 CC Switch 用户提供了专属优惠:通过<a href="https://crazyrouter.com/register?aff=OZcm&ref=cc-switch">此链接</a>注册即可获得 <strong>$2 免费额度</strong>,首次充值时输入优惠码 `CCSWITCH` 还可获得额外 <strong>30% 奖励额度</strong>!</td>
|
||||
</tr>
|
||||
|
||||
@@ -93,36 +81,6 @@ Claude Code / Codex / Gemini 官方渠道低至 3.8 / 0.2 / 0.9 折,充值更
|
||||
<td>感谢 SSSAiCode 赞助了本项目!SSSAiCode 是一家稳定可靠的API中转站,致力于提供稳定、可靠、平价的Claude、CodeX模型服务,<strong>提供高性价比折合0.5¥/$的官方Claude服务</strong>,支持包月、Paygo多种计费方式、支持当日快速开票,SSSAiCode为本软件的用户提供特别优惠,使用<a href="https://www.sssaicode.com/register?ref=DCP0SM">此链接</a>注册每次充值均可享受10$的额外奖励!</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="180"><a href="https://www.openclaudecode.cn/register?aff=aOYQ"><img src="assets/partners/logos/mikubanner.svg" alt="Micu" width="150"></a></td>
|
||||
<td>感谢 米醋API 赞助了本项目!米醋API 是一家致力于提供极致性价比与高稳定性的全球大模型中转服务商。米醋API 背后有实体企业做核心保障,杜绝跑路风险,支持极速正规开票!我们主打“试错零成本”:1 元起充低门槛,0 手续费随时退款!米醋API 为本软件的用户提供了特别优惠,使用<a href="https://www.openclaudecode.cn/register?aff=aOYQ">此链接</a>注册并在充值时填写"ccswitch"优惠码可享九折优惠!</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="180"><a href="https://x-code.cc/register?aff=IbPp"><img src="assets/partners/logos/xcodeapi.png" alt="XCodeAPI" width="150"></a></td>
|
||||
<td>感谢 XCodeAPI 赞助了本项目!XCodeAPI 为本软件的用户提供特别福利,使用<a href="https://x-code.cc/register?aff=IbPp">此链接</a>注册后首单加赠10%的额度!(联系站长领取)</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="180"><a href="https://ctok.ai"><img src="assets/partners/logos/ctok.png" alt="CTok" width="150"></a></td>
|
||||
<td>感谢 CTok.ai 赞助了本项目!CTok.ai 致力于打造一站式 AI 编程工具服务平台。我们提供 Claude Code 专业套餐及技术社群服务,同时支持 Google Gemini 和 OpenAI Codex。通过精心设计的套餐方案和专业的技术社群,为开发者提供稳定的服务保障和持续的技术支持,让 AI 辅助编程真正成为开发者的生产力工具。点击<a href="https://ctok.ai">这里</a>注册!</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="180"><a href="https://chefshop.ai"><img src="assets/partners/logos/chefshop.png" alt="ChefShop" width="150"></a></td>
|
||||
<td>感谢 厨师长AI小铺 赞助了本项目!厨师长AI小铺 是一家专为 AI 重度订阅用户量身定制的优质账号服务商。平台提供涵盖 ChatGPT Plus/Pro、Claude Max、Grok Super/Heavy 以及 Gemini 等主流大模型的官方代充与稳定成品账号服务。点击<a href="https://chefshop.ai">这里</a>购买!</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="180"><a href="https://vibecodingapi.ai"><img src="assets/partners/logos/lioncc.png" alt="LionCC" width="150"></a></td>
|
||||
<td>感谢 LionCC 狮子API 赞助了本项目!LionCC 专为追求极致开发体验的”Vibe Coders”而生。我们提供稳定、低延迟、优惠价格的 Claude Code、Codex 及 OpenClaw 算力服务,可节约 50% 成本。注册后添加客服微信 HSQBJ088888888,发暗号 cc-switch 备注即可送 10 美金额度(1000 万 token 算力)。其他项目合作关注博客 @LionCC.ai,点击<a href=”https://vibecodingapi.ai”>这里</a>注册!</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="180"><a href="https://ddshub.short.gy/ccswitch"><img src="assets/partners/logos/dds.png" alt="DDS" width="150"></a></td>
|
||||
<td>感谢 DDS 赞助本项目!呆呆兽是一家专注 Claude 的可靠高效 API 中转站,为个人和企业用户提供极具性价比的国内 Claude 直连加速服务。支持 Claude Haiku / Opus / Sonnet 等满血模型。充值满 1000 元即可开具发票,企业客户更可享受定制化分组和技术支持服务。CC Switch 用户专属福利:通过<a href="https://ddshub.short.gy/ccswitch">此链接</a>注册后,首单充值可额外赠送 10% 额度(充值后请联系群主领取)!</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</details>
|
||||
@@ -149,7 +107,7 @@ Claude Code / Codex / Gemini 官方渠道低至 3.8 / 0.2 / 0.9 折,充值更
|
||||
|
||||
## 功能特性
|
||||
|
||||
[完整更新日志](CHANGELOG.md) | [发布说明](docs/release-notes/v3.12.3-zh.md)
|
||||
[完整更新日志](CHANGELOG.md) | [发布说明](docs/release-notes/v3.12.0-zh.md)
|
||||
|
||||
### 供应商管理
|
||||
|
||||
@@ -207,9 +165,9 @@ CC Switch 使用“通用配置片段”功能,在不同的供应商之间传
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>macOS 安装</strong></summary>
|
||||
<summary><strong>macOS 提示"未知开发者"警告 — 如何解决?</strong></summary>
|
||||
|
||||
CC Switch macOS 版本已通过 Apple 代码签名和公证,可直接下载安装,无需额外操作。推荐使用 `.dmg` 安装包。
|
||||
这是由于作者没有苹果开发者账号(正在注册中)。关闭警告后,前往**系统设置 → 隐私与安全性 → 仍要打开**。之后应用即可正常打开。
|
||||
|
||||
</details>
|
||||
|
||||
@@ -236,7 +194,6 @@ CC Switch macOS 版本已通过 Apple 代码签名和公证,可直接下载安
|
||||
- **本地设置**:`~/.cc-switch/settings.json`(设备级 UI 偏好设置)
|
||||
- **备份**:`~/.cc-switch/backups/`(自动轮换,保留最近 10 个)
|
||||
- **SKILLS**:`~/.cc-switch/skills/`(默认通过软链接连接到对应应用)
|
||||
- **技能备份**:`~/.cc-switch/skill-backups/`(卸载前自动创建,保留最近 20 个)
|
||||
|
||||
</details>
|
||||
|
||||
@@ -269,7 +226,7 @@ CC Switch macOS 版本已通过 Apple 代码签名和公证,可直接下载安
|
||||
### 系统要求
|
||||
|
||||
- **Windows**:Windows 10 及以上
|
||||
- **macOS**:macOS 12 (Monterey) 及以上
|
||||
- **macOS**:macOS 10.15 (Catalina) 及以上
|
||||
- **Linux**:Ubuntu 22.04+ / Debian 11+ / Fedora 34+ 等主流发行版
|
||||
|
||||
### Windows 用户
|
||||
@@ -293,9 +250,9 @@ brew upgrade --cask cc-switch
|
||||
|
||||
**方式二:手动下载**
|
||||
|
||||
从 [Releases](../../releases) 页面下载 `CC-Switch-v{版本号}-macOS.dmg`(推荐)或 `.zip`。
|
||||
从 [Releases](../../releases) 页面下载 `CC-Switch-v{版本号}-macOS.zip` 解压使用。
|
||||
|
||||
> **注意**:CC Switch macOS 版本已通过 Apple 代码签名和公证,可直接安装打开。
|
||||
> **注意**:由于作者没有苹果开发者账号,首次打开可能出现"未知开发者"警告,请先关闭,然后前往"系统设置" → "隐私与安全性" → 点击"仍要打开",之后便可以正常打开。
|
||||
|
||||
### Arch Linux 用户
|
||||
|
||||
@@ -312,8 +269,14 @@ paru -S cc-switch-bin
|
||||
- `CC-Switch-v{版本号}-Linux.deb`(Debian/Ubuntu)
|
||||
- `CC-Switch-v{版本号}-Linux.rpm`(Fedora/RHEL/openSUSE)
|
||||
- `CC-Switch-v{版本号}-Linux.AppImage`(通用)
|
||||
- `CC-Switch-v{版本号}-Linux.flatpak`(Flatpak)
|
||||
|
||||
> **Flatpak**:官方 Release 不包含 Flatpak 包。如需使用,可从 `.deb` 自行构建 — 参见 [`flatpak/README.md`](flatpak/README.md)。
|
||||
Flatpak 安装与运行:
|
||||
|
||||
```bash
|
||||
flatpak install --user ./CC-Switch-v{版本号}-Linux.flatpak
|
||||
flatpak run com.ccswitch.desktop
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary><strong>架构总览</strong></summary>
|
||||
@@ -352,7 +315,7 @@ paru -S cc-switch-bin
|
||||
- **ProviderService**:供应商增删改查、切换、回填、排序
|
||||
- **McpService**:MCP 服务器管理、导入导出、live 文件同步
|
||||
- **ProxyService**:本地 Proxy 模式,支持热切换和格式转换
|
||||
- **SessionManager**:全应用会话历史浏览
|
||||
- **SessionManager**:Claude Code 对话历史浏览
|
||||
- **ConfigService**:配置导入导出、备份轮换
|
||||
- **SpeedtestService**:API 端点延迟测量
|
||||
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
# Security Policy / 安全策略
|
||||
|
||||
## Supported Versions / 支持的版本
|
||||
|
||||
Only the latest release of CC Switch receives security updates.
|
||||
|
||||
仅最新版本的 CC Switch 会收到安全更新。
|
||||
|
||||
| Version / 版本 | Supported / 是否支持 |
|
||||
|----------------|---------------------|
|
||||
| Latest 3.x | ✅ Yes / 是 |
|
||||
| < 3.0 | ❌ No / 否 |
|
||||
|
||||
## Reporting a Vulnerability / 报告漏洞
|
||||
|
||||
**Please do NOT report security vulnerabilities through public GitHub issues.**
|
||||
|
||||
**请不要通过公开的 GitHub Issue 报告安全漏洞。**
|
||||
|
||||
Instead, please report them through [GitHub Security Advisories](https://github.com/farion1231/cc-switch/security/advisories/new).
|
||||
|
||||
请通过 [GitHub 安全公告](https://github.com/farion1231/cc-switch/security/advisories/new) 进行报告。
|
||||
|
||||
When reporting, please include:
|
||||
|
||||
报告时请包含以下信息:
|
||||
|
||||
- A description of the vulnerability / 漏洞描述
|
||||
- Steps to reproduce / 复现步骤
|
||||
- Potential impact / 潜在影响
|
||||
- Affected versions / 受影响版本
|
||||
|
||||
## Response Timeline / 响应时间
|
||||
|
||||
- **Acknowledgment / 确认**: within 48 hours / 48 小时内
|
||||
- **Initial assessment / 初步评估**: within 7 days / 7 天内
|
||||
- **Fix for critical issues / 关键问题修复**: within 14 days / 14 天内
|
||||
|
||||
## Disclosure Policy / 披露政策
|
||||
|
||||
We follow a coordinated disclosure process:
|
||||
|
||||
我们遵循协调披露流程:
|
||||
|
||||
1. The reporter submits the vulnerability privately. / 报告者私下提交漏洞。
|
||||
2. We confirm and work on a fix. / 我们确认并修复漏洞。
|
||||
3. A patch release is published. / 发布修复版本。
|
||||
4. The vulnerability is publicly disclosed. / 公开披露漏洞详情。
|
||||
|
||||
Reporters will be credited in the release notes unless they prefer to remain anonymous.
|
||||
|
||||
除非报告者希望匿名,否则将在发布说明中致谢。
|
||||
|
||||
## Security Updates / 安全更新
|
||||
|
||||
Security fixes are released as patch versions and announced via [GitHub Releases](https://github.com/farion1231/cc-switch/releases). We recommend always updating to the latest version.
|
||||
|
||||
安全修复通过补丁版本发布,并通过 [GitHub Releases](https://github.com/farion1231/cc-switch/releases) 通知。建议始终更新到最新版本。
|
||||
@@ -1,59 +0,0 @@
|
||||
# Support / 获取帮助
|
||||
|
||||
> [中文版本](#获取帮助)
|
||||
|
||||
## How to Get Help
|
||||
|
||||
CC Switch is an open-source project maintained by volunteers. We're happy to help, but please use the right channel so we can respond efficiently.
|
||||
|
||||
### Before Asking
|
||||
|
||||
1. **Read the [FAQ](https://github.com/farion1231/cc-switch#faq)** — most common questions are answered there.
|
||||
2. **Search [existing issues](https://github.com/farion1231/cc-switch/issues)** (including closed ones) — someone may have had the same question.
|
||||
|
||||
### Asking a Question
|
||||
|
||||
- **Usage or configuration questions**: [Open a Question issue](https://github.com/farion1231/cc-switch/issues/new?template=question.yml)
|
||||
- **General discussion**: [GitHub Discussions](https://github.com/farion1231/cc-switch/discussions)
|
||||
|
||||
### Reporting Problems
|
||||
|
||||
- **Bug reports**: [Open a Bug Report](https://github.com/farion1231/cc-switch/issues/new?template=bug_report.yml)
|
||||
- **Documentation issues**: [Open a Doc Issue](https://github.com/farion1231/cc-switch/issues/new?template=doc_issue.yml)
|
||||
- **Security vulnerabilities**: Please do NOT use public issues. See our [Security Policy](./SECURITY.md).
|
||||
|
||||
### Feature Requests
|
||||
|
||||
- [Submit a Feature Request](https://github.com/farion1231/cc-switch/issues/new?template=feature_request.yml)
|
||||
- Please open an issue for discussion before submitting a PR for new features.
|
||||
|
||||
---
|
||||
|
||||
# 获取帮助
|
||||
|
||||
> [English Version](#support--获取帮助)
|
||||
|
||||
## 如何获取帮助
|
||||
|
||||
CC Switch 是一个由志愿者维护的开源项目。我们很乐意提供帮助,但请使用合适的渠道,以便我们高效响应。
|
||||
|
||||
### 提问之前
|
||||
|
||||
1. **阅读 [常见问题](https://github.com/farion1231/cc-switch#常见问题)** — 大多数常见问题都已在其中解答。
|
||||
2. **搜索 [已有的 Issue](https://github.com/farion1231/cc-switch/issues)**(包括已关闭的) — 可能已经有人问过相同的问题。
|
||||
|
||||
### 提问
|
||||
|
||||
- **使用或配置问题**:[提交问题 Issue](https://github.com/farion1231/cc-switch/issues/new?template=question.yml)
|
||||
- **一般讨论**:[GitHub 讨论区](https://github.com/farion1231/cc-switch/discussions)
|
||||
|
||||
### 报告问题
|
||||
|
||||
- **Bug 报告**:[提交 Bug 报告](https://github.com/farion1231/cc-switch/issues/new?template=bug_report.yml)
|
||||
- **文档问题**:[提交文档问题](https://github.com/farion1231/cc-switch/issues/new?template=doc_issue.yml)
|
||||
- **安全漏洞**:请不要使用公开 Issue。请参阅我们的[安全策略](./SECURITY.md)。
|
||||
|
||||
### 功能请求
|
||||
|
||||
- [提交功能请求](https://github.com/farion1231/cc-switch/issues/new?template=feature_request.yml)
|
||||
- 提交新功能的 PR 之前,请先开 Issue 讨论。
|
||||
|
Before Width: | Height: | Size: 902 KiB After Width: | Height: | Size: 207 KiB |
|
Before Width: | Height: | Size: 895 KiB After Width: | Height: | Size: 193 KiB |
|
Before Width: | Height: | Size: 280 KiB |
|
Before Width: | Height: | Size: 246 KiB |
|
Before Width: | Height: | Size: 99 KiB |
|
Before Width: | Height: | Size: 27 KiB |
@@ -1,63 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg id="_图层_2" data-name="图层 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1075.78 240.6">
|
||||
<defs>
|
||||
<style>
|
||||
.cls-1 {
|
||||
fill: #068cde;
|
||||
}
|
||||
|
||||
.cls-2 {
|
||||
fill: #02a4fd;
|
||||
}
|
||||
|
||||
.cls-3 {
|
||||
fill: #fff;
|
||||
}
|
||||
|
||||
.cls-4 {
|
||||
fill: #02a6ff;
|
||||
}
|
||||
</style>
|
||||
</defs>
|
||||
<g id="_图层_1-2" data-name="图层 1">
|
||||
<path class="cls-1" d="M226.14,157.63c-3.62,0-7.24,0-10.95,0v-24.96c5.2,0,10.17,0,15.13,0,5.55-.01,8.52-4.01,10.18-8.16,1.34-3.37,1.36-7.51-1.34-11.1-3.16-4.2-7.23-5.72-12.25-5.63-3.87.07-7.74.01-11.66.01v-24.79c6.56-.43,12.93.45,19.3-1.13.4-.42.85-1.05,1.44-1.49,4.61-3.47,6.48-9.22,4.67-14.51-1.63-4.76-6.67-8.03-12.22-7.99-4.37.03-8.74,0-13.42,0,0-5.79.1-11.16-.04-16.54-.08-3.23-1.09-6.23-3.22-8.79-7.6-9.17-17.84-6.02-28.13-6.29-.39-.23-.63-1.14-.45-2.35.73-4.72.37-9.44-.24-14.13-.51-3.95-5.79-9.24-9.1-9.56-10.42-1-15.88,5.21-15.83,14.89.02,3.54,0,7.08,0,10.92h-24.44c-.76-1.03-.45-2.13-.42-3.19.15-5.2.71-10.35-1.11-15.5-2.15-6.08-11.68-9.27-17.05-5.79-5.27,3.41-7.22,7.95-6.99,13.99.14,3.56.53,7.22-.44,10.6h-23.98c-.22-.38-.37-.51-.37-.66-.05-4.56,0-9.12-.14-13.68-.15-5.18-4.72-10.76-9.31-11.57-8.81-1.55-15.64,4.23-15.64,13.24,0,4.11,0,8.21,0,12.61-4.92,0-9.32.08-13.72-.02-10.41-.22-18.81,7.79-17.84,18.57.39,4.32.06,8.7.06,13.34-5.17,0-9.9-.05-14.63.01-5.36.07-11.08,5.57-11.83,10.1-1.39,8.44,6.23,15.25,14.55,14.78,3.86-.22,7.74-.04,11.75-.04v24.92c-4.45,0-8.67-.07-12.89.02-3.2.07-6.5.62-8.75,2.93-3.6,3.69-6.1,8.11-4.12,13.5,2.13,5.8,6.42,8.43,12.98,8.43,4.21,0,8.42,0,12.83,0v24.95c-3.48,0-6.79-.12-10.08.03-3.74.18-7.43.36-10.78,2.69-4.11,2.87-6.48,8.21-5.32,12.83,1.1,4.36,7.17,9.83,11.59,9.41,4.82-.46,9.72-.1,14.69-.1,0,5.18.51,9.88-.1,14.44-1.36,10,8.64,18.06,17.22,17.5,4.62-.3,9.28-.05,14.15-.05,1.26,9.11-3.28,19.95,9.5,25.9,10.27,1.43,15.74-3.33,15.75-15.14,0-3.45,0-6.9,0-10.55h24.94c0,3.39,0,6.6,0,9.8,0,3.81.26,7.41,2.73,10.76,3.09,4.2,8.64,6.68,14,4.87,3.62-1.22,8.31-5.43,8.3-10.7,0-4.85,0-9.7,0-14.7h24.92c0,3.98-.14,7.7.03,11.41.22,4.83,1.4,9.35,5.68,12.32,5.16,3.59,12.81,2.96,17.28-2.41,3.93-7.43,2.05-14.57,2.39-21.58,5.71,0,11.1.03,16.49-.02,1.98-.02,4.05-.06,5.8-1.09,6.78-3.99,9.8-9.94,9.36-17.81-.23-4.18-.04-8.39-.04-12.56,8.59-1.68,18.23,2.96,24.73-6.3.08-.31.31-1.1.5-1.9.97-4.19,1.82-8.06-1.59-12.01-3.49-4.05-7.66-5.05-12.52-5.04ZM168.3,160.54c0,3.41-1.48,4.58-4.69,4.49-4.41-.12-8.82-.09-13.23-.05-3.15.03-4.43-1.39-4.41-4.56.06-16.85.02-33.69-.03-50.54,0-.99.44-2.13-.73-3.15-4.49,13.97-8.94,27.8-13.44,41.79h-21.8c-4.39-13.78-8.8-27.62-13.55-42.54-.15,1.94-.29,2.89-.29,3.84-.01,16.68-.08,33.36.04,50.04.03,3.7-1.18,5.38-5.05,5.16-5.51-.31-11.08.38-16.22-.44-1.24-1.59-1.21-2.95-1.21-4.26.07-27.3.18-54.6.22-81.9,0-2.16.89-3.46,2.97-3.48,9.9-.06,19.8,0,29.7.05.31,0,.63.19,1.39.44,4.22,14.29,8.51,28.79,12.8,43.3.29.05.58.1.87.15,4.53-14.59,9.07-29.17,13.66-43.95,10.35,0,20.48-.03,30.62.03,1.76.01,2.38,1.37,2.42,2.92.08,2.57.1,5.14.1,7.71-.06,24.98-.16,49.95-.15,74.93Z"/>
|
||||
<rect class="cls-4" x="48.86" y="48.46" width="143.67" height="143.67" rx="10.57" ry="10.57"/>
|
||||
<path class="cls-3" d="M165.55,75.28c-10.14-.06-20.27-.03-30.62-.03-4.59,14.78-9.12,29.36-13.66,43.95-.29-.05-.58-.1-.87-.15-4.29-14.51-8.58-29.01-12.8-43.3-.77-.25-1.08-.44-1.39-.44-9.9-.04-19.8-.1-29.7-.05-2.08.01-2.96,1.32-2.97,3.48-.04,27.3-.15,54.6-.22,81.9,0,1.31-.03,2.67,1.21,4.26,5.13.82,10.7.13,16.22.44,3.87.22,5.07-1.46,5.05-5.16-.12-16.68-.06-33.36-.04-50.04,0-.95.14-1.9.29-3.84,4.75,14.91,9.16,28.76,13.55,42.54h21.8c4.5-13.99,8.94-27.82,13.44-41.79,1.18,1.01.73,2.16.73,3.15.04,16.85.09,33.69.03,50.54-.01,3.17,1.26,4.59,4.41,4.56,4.41-.04,8.82-.07,13.23.05,3.21.09,4.69-1.08,4.69-4.49-.01-24.98.09-49.95.15-74.93,0-2.57-.02-5.14-.1-7.71-.05-1.55-.67-2.91-2.42-2.92Z"/>
|
||||
<g>
|
||||
<path class="cls-2" d="M372.64,135.48c-.13-.49-.54-.78-.71-.89-7.15-4.87-14.15-9.95-21.35-14.75-4.85-3.24-7.95-5.93-8.98-6.85-3.54-3.13-6.16-6.05-7.88-8.11,18.27.05,31.65-.03,32.44-.05.12,0,.6-.03.98-.42.22-.22.31-.45.35-.59.02-4.96.04-9.91.06-14.87,0-.78-.62-1.42-1.39-1.42-8.12.04-16.23.08-24.35.12,4.03-4.67,7.45-8.18,9.86-10.55,2.43-2.39,4.46-5.14,6.77-7.64,1.93-2.09,4.11-4.37,3.5-6.38-.2-.66-.63-1.08-.87-1.29-3.46-2.9-6.93-5.8-10.39-8.7-.41-.25-1.2-.63-2.04-.42-.82.21-1.3.88-1.47,1.12-3.4,4.75-5.17,7.07-5.2,7.12,0,0-1.32,2.51-13.36,16.27-.12.14-.48.54-.48,1.08,0,.5.31.88.49,1.07,2.96,2.73,5.93,5.46,8.89,8.2h-10.94v-37.5c0-.78-.62-1.42-1.39-1.42h-15.19c-.77,0-1.39.64-1.39,1.42v37.5h-13.87l10.91-9.45c.55-.48.65-1.31.23-1.91-1.08-1.54-2.47-3.35-4.11-5.37-1.64-2.02-3.6-4.28-5.8-6.7-2.13-2.43-4.13-4.59-5.93-6.43-1.8-1.83-3.5-3.43-5.06-4.75-.53-.45-1.31-.43-1.82.04l-10.51,9.67c-.29.27-.46.65-.46,1.05s.17.78.46,1.05c.96.88,2.1,2.06,3.39,3.49,1.33,1.47,2.71,3.04,4.15,4.7,1.44,1.66,2.87,3.36,4.26,5.04,1.41,1.71,2.71,3.27,3.89,4.68,1.17,1.39,2.11,2.54,2.83,3.44.86,1.09,1.04,1.35,1.04,1.35.02.03.03.06.05.09h-23.14c-.77,0-1.39.64-1.39,1.42v14.45c0,.78.62,1.42,1.39,1.42,10.73.14,21.47.29,32.2.43-3.44,3.44-6.64,6.34-9.41,8.73-4.74,4.08-8.53,6.9-9.53,7.64-5.15,3.8-7.72,5.7-9.46,6.47,0,0-1.99,2.06-9.47,6.03-.37.2-.63.55-.72.96-.09.41.01.84.27,1.18,3.31,4.84,6.62,9.68,9.93,14.51,2.17-1.39,5.05-3.3,8.34-5.71,1.13-.83,4.24-3.11,8.34-6.5,6.58-5.43,8.21-7.48,15.62-13.59,1.43-1.18,2.61-2.13,3.36-2.73v32.48c0,.78.62,1.42,1.39,1.42h15.19c.77,0,1.39-.64,1.39-1.42v-32.91c2.78,2.65,6.21,5.83,10.21,9.33,10.52,9.2,9.2,6.82,12.78,10.6,0,0,7.52,6.23,12.33,9.29.65.41,1.5.21,1.91-.45l8.68-14c.21-.34.27-.75.17-1.13Z"/>
|
||||
<g>
|
||||
<path class="cls-2" d="M481.65,98.3h-43.96c-.78,0-1.42.63-1.42,1.42v51.72c0,.78.63,1.42,1.42,1.42h43.96c.78,0,1.42-.63,1.42-1.42v-51.72c0-.78-.63-1.42-1.42-1.42ZM467.34,137.4h-15.33v-4.1h15.33v4.1ZM467.34,118.08h-15.33v-4.1h15.33v4.1Z"/>
|
||||
<path class="cls-2" d="M485.91,80.91h-8.67v-6.03h6.54c.78,0,1.42-.63,1.42-1.42v-13.3c0-.78-.63-1.42-1.42-1.42h-6.54v-9.15c0-.78-.63-1.42-1.42-1.42h-12.56c-.78,0-1.42.63-1.42,1.42v9.15h-4.46v-9.15c0-.78-.63-1.42-1.42-1.42h-12.45c-.78,0-1.42.63-1.42,1.42v9.15h-5.54c-.56,0-1.04.32-1.27.79v-5.86c0-.78-.63-1.42-1.42-1.42h-48.55c-.78,0-1.42.63-1.42,1.42v12.96c0,.78.63,1.42,1.42,1.42h11.48v5.24h-9.91c-.78,0-1.42.63-1.42,1.42v76.27c0,.78.63,1.42,1.42,1.42h46.2c.78,0,1.42-.63,1.42-1.42v-54.75c.26.29.63.46,1.05.46h50.35c.78,0,1.42-.63,1.42-1.42v-12.96c0-.78-.63-1.42-1.42-1.42ZM421.7,136.6h-23.18v-3.98h23.18v3.98ZM421.7,117.28h-19.16c1.54-2.24,2.74-4.23,3.57-5.91.83-1.69,1.57-3.33,2.19-4.91,1.19-3.22,1.77-7.95,1.77-14.47v-3.02h.08v13.36c0,3.98.93,7.04,2.78,9.08,1.84,2.04,4.77,3.29,8.61,3.69l.17.03v2.16ZM442.11,80.91h-6.54c-.42,0-.79.18-1.05.46v-6.66c0-.78-.63-1.42-1.42-1.42h-9.57v-5.24h10.36c.56,0,1.04-.32,1.27-.79v6.2c0,.78.63,1.42,1.42,1.42h5.54v6.03ZM461.85,80.91h-4.46v-6.03h4.46v6.03Z"/>
|
||||
</g>
|
||||
<path class="cls-2" d="M608.47,127.84c-4.56-1.17-9.11-2.33-13.67-3.5-.16-20.74-.33-41.47-.49-62.21,0-.79-.63-1.43-1.42-1.43h-34.31v-10.58c0-.79-.63-1.43-1.42-1.43h-14.6c-.78,0-1.42.64-1.42,1.43v10.58h-32.96c-.78,0-1.42.64-1.42,1.43v66c0,.79.63,1.43,1.42,1.43h32.96v6.12c0,3.15.28,5.89.83,8.12.57,2.35,1.57,4.34,2.95,5.92,1.39,1.59,3.28,2.81,5.6,3.61,2.2.76,4.97,1.27,8.25,1.51,1.43.07,3.35.15,5.76.23,2.44.08,4.95.11,7.46.11s5-.02,7.33-.06c2.4-.04,4.24-.14,5.62-.29,3.19-.31,5.93-.72,8.16-1.23,3.05-.7,5.13-2.13,5.99-2.65,1.51-.92,3.64-2.22,5.55-4.66,1.81-2.3,2.48-4.4,3.28-6.89.81-2.52,1.79-5.71,1.06-9.61-.15-.82-.35-1.48-.5-1.94ZM541.15,112.97h-17.16v-9.73h17.16v9.73ZM541.15,87.12h-17.16v-9.84h17.16v9.84ZM558.59,77.28h18.51v9.84h-18.51v-9.84ZM558.59,103.24h18.51v9.73h-18.51v-9.73ZM590.3,133.5c-.06.19-.43,1.31-.83,1.94-1.12,1.76-3.83,1.83-12.61,1.89-7.06.05-.21-.03-7.33-.06-5.89-.02-7.51.05-8.56-1.22-1.02-1.24-1.31-3.54-1.44-4.56-.1-.8-.12-1.48-.11-1.95,10.48.04,20.96.08,31.44.12.02.9-.05,2.27-.56,3.83Z"/>
|
||||
<path class="cls-2" d="M721.16,93.62h-39.92v-.2c6.24-3.1,12.4-6.63,18.31-10.49,6.14-4.01,12.31-8.35,18.34-12.9.35-.27.56-.69.56-1.13v-14.44c0-.78-.63-1.42-1.42-1.42h-87.02c-.78,0-1.42.63-1.42,1.42v14.32c0,.78.63,1.42,1.42,1.42h54.17c-.81.75-2.1,1.91-3.75,3.22-3.49,2.77-5.95,4.13-9.75,6.58-1.85,1.19-4.54,2.98-7.75,5.33-.03,2.76-.06,5.52-.1,8.29h-41.41c-.78,0-1.41.63-1.41,1.42v15c0,.78.63,1.42,1.41,1.42h41.41v21.77c0,1.22-.04,2.25-.11,3.05-.05.57-.06,1.11-.42,1.34-.35.22-.82.04-1.08-.04-1.08-.36-2.28-.11-3.42-.17-2.27-.12-2.51.11-5,.04-2.39-.07-4.79.16-7.17-.08-.27-.03-.93-.1-1.29.29-.44.48-.17,1.38-.04,1.75,1.43,4.35,2.86,8.69,4.29,13.04.11.5.34,1.22.92,1.83,1.16,1.24,2.98,1.26,4.12,1.25,9.2-.06,11.21-.21,11.21-.21,4.83-.36,5.78-.39,7.58-.96,1.76-.56,3.69-1.19,5.38-2.95,1.68-1.74,2.36-3.6,2.76-5.45.44-2.03.66-4.52.66-7.4v-27.11h39.92c.78,0,1.41-.63,1.41-1.42v-15c0-.78-.63-1.42-1.41-1.42Z"/>
|
||||
<path class="cls-2" d="M839.47,131.72h-40.52v-59.68h33.89c.78,0,1.42-.63,1.42-1.42v-15.57c0-.78-.63-1.42-1.42-1.42h-86.74c-.78,0-1.42.63-1.42,1.42v15.57c0,.78.63,1.42,1.42,1.42h33.55v59.68h-40.41c-.78,0-1.42.63-1.42,1.42v15.35c0,.78.63,1.42,1.42,1.42h100.22c.78,0,1.42-.63,1.42-1.42v-15.35c0-.78-.63-1.42-1.42-1.42Z"/>
|
||||
<path class="cls-2" d="M955.36,61.13h-39.83c.46-1.11.9-2.22,1.3-3.32.65-1.74,1.31-3.52,2-5.34.14-.37.12-.79-.06-1.14-.18-.35-.5-.62-.88-.72l-14.29-3.98c-.73-.2-1.49.2-1.73.93-2.48,7.62-5.66,15.09-9.45,22.22-3,5.64-6.11,10.87-9.28,15.62v-12.58c1.19-3.03,2.37-6.23,3.52-9.52,1.16-3.3,2.38-6.9,3.73-10.99.12-.36.09-.76-.09-1.1-.18-.34-.48-.59-.85-.7l-13.84-4.21c-.36-.11-.76-.07-1.09.11-.33.18-.58.49-.68.86-1.13,4.04-2.62,8.43-4.42,13.05-1.81,4.65-3.82,9.34-5.97,13.95-2.16,4.62-4.45,9.15-6.82,13.44-2.37,4.3-4.71,8.14-6.96,11.42-.42.61-.3,1.43.27,1.9l11.21,9.21c.31.26.72.37,1.12.31.4-.06.75-.29.97-.63l1.97-3.03v46.25c0,.78.63,1.42,1.42,1.42h15.09c.78,0,1.42-.63,1.42-1.42v-57.07l8.02,6.03c.62.47,1.5.35,1.98-.27,2.9-3.8,5.62-7.74,8.08-11.71,2.03-3.29,3.95-6.68,5.73-10.12v73.83c0,.78.63,1.42,1.42,1.42h14.98c.78,0,1.42-.63,1.42-1.42v-20.29h27.52c.78,0,1.42-.63,1.42-1.42v-15.12c0-.78-.63-1.42-1.42-1.42h-27.52v-10.01h25.11c.78,0,1.42-.63,1.42-1.42v-14.89c0-.78-.63-1.42-1.42-1.42h-25.11v-9.21h30.6c.78,0,1.42-.63,1.42-1.42v-14.66c0-.78-.63-1.42-1.42-1.42Z"/>
|
||||
<path class="cls-2" d="M1074.36,137.97h-41.39v-4.55h31.04c.78,0,1.42-.63,1.42-1.42v-13.19c0-.78-.63-1.42-1.42-1.42h-2.25l8.41-9.22c.49-.53.5-1.35.02-1.89-2.83-3.22-6.98-7.17-12.38-11.75l-3.96-3.29h9.69c.78,0,1.42-.63,1.42-1.42v-10.52h8.59c.78,0,1.42-.63,1.42-1.42v-19.1c0-.78-.63-1.42-1.42-1.42h-39.96l-2.28-8.83c-.17-.67-.81-1.12-1.49-1.06l-16.17,1.36c-.42.04-.8.25-1.04.59-.24.34-.32.77-.21,1.18.61,2.31,1.17,4.58,1.68,6.75h-39.86c-.78,0-1.42.63-1.42,1.42v19.1c0,.78.63,1.42,1.42,1.42h8.47v10.52c0,.78.63,1.42,1.42,1.42h11.51c-1.07.86-2.12,1.69-3.13,2.46-1.91,1.47-3.64,2.66-5.15,3.54-1.12.66-2.24,1.28-3.31,1.84-.94.49-1.91.8-2.9.93-.38.05-.71.25-.94.55-.23.3-.33.68-.28,1.06l1.63,11.71c.1.69.68,1.21,1.38,1.22,5.55.08,11.18.06,16.74-.06,5.06-.1,10.15-.22,15.25-.36v3.26h-31.39c-.78,0-1.42.63-1.42,1.42v13.19c0,.78.63,1.42,1.42,1.42h31.39v4.55h-41.86c-.78,0-1.42.63-1.42,1.42v12.62c0,.78.63,1.42,1.42,1.42h101.32c.78,0,1.42-.63,1.42-1.42v-12.62c0-.78-.63-1.42-1.42-1.42ZM1055.75,115.62c.57.62,1.11,1.21,1.64,1.77h-24.42v-3.81c3.26-.13,6.47-.27,9.64-.4,3.37-.14,6.82-.32,10.27-.53,1.04,1.03,2.01,2.03,2.87,2.97ZM990.4,76.13v-3.3h66.73v3.3h-66.73ZM1009.78,99.75c1.14-.79,2.29-1.62,3.43-2.48,2.38-1.78,4.82-3.8,7.26-6.03h15.11l-2.47,2.47c-.29.29-.44.7-.41,1.11s.24.79.58,1.03c.92.68,1.91,1.41,2.95,2.2.21.16.43.33.66.51-5.44.39-10.57.68-15.27.87-4.02.16-7.98.26-11.83.31Z"/>
|
||||
</g>
|
||||
<g>
|
||||
<polygon class="cls-2" points="700.41 193.09 700.29 193.09 695.84 175.52 688.42 175.52 688.42 199.6 692.65 199.6 692.65 179.03 692.76 178.9 698.35 199.6 702.12 199.6 708.05 178.9 708.05 179.03 708.05 199.6 712.28 199.6 712.28 175.52 705.2 175.52 700.41 193.09"/>
|
||||
<path class="cls-2" d="M727.36,178.51c3.04.09,4.65,1.61,4.83,4.56h5.64c-.36-5.47-3.85-8.24-10.47-8.33-6.62.26-10.07,4.47-10.33,12.63.18,7.98,3.62,12.06,10.33,12.23,6.71-.09,10.2-2.78,10.47-8.07h-5.64c-.09,2.95-1.7,4.47-4.83,4.56-2.95-.17-4.52-3.08-4.7-8.72.18-5.73,1.75-8.68,4.7-8.85Z"/>
|
||||
<path class="cls-2" d="M756.74,188.14c.08,2.86-.24,4.82-.98,5.86-.73,1.22-2.03,1.82-3.9,1.82s-3.21-.61-4.02-1.82c-.73-1.04-1.06-2.99-.97-5.86v-13.15h-4.87v15.1c.16,5.99,3.45,9.07,9.87,9.24,6.25-.17,9.5-3.25,9.75-9.24v-15.1h-4.87v13.15Z"/>
|
||||
<polygon class="cls-2" points="782.14 188.79 792.21 188.79 792.21 184.76 782.14 184.76 782.14 179.16 792.98 179.16 792.98 175.13 776.98 175.13 776.98 199.2 793.37 199.2 793.37 195.17 782.14 195.17 782.14 188.79"/>
|
||||
<rect class="cls-2" x="797.64" y="174.74" width="4.33" height="24.08"/>
|
||||
<path class="cls-2" d="M822.27,188.31c-.09-1.04-.4-2.04-.94-2.99-1.34-2.6-3.8-3.9-7.38-3.9-5.19.26-7.92,3.21-8.19,8.85-.09,5.81,2.64,8.68,8.19,8.59,4.83,0,7.47-1.73,7.92-5.21h-4.7c-.45,1.48-1.52,2.17-3.22,2.08-2.06.09-3.04-1.3-2.95-4.17h11.41c0-1.13-.05-2.21-.13-3.25ZM810.99,188.18c.09-2.34,1.07-3.51,2.95-3.51,2.06,0,3.09,1.17,3.09,3.51h-6.04Z"/>
|
||||
<path class="cls-2" d="M831.26,189.46c.28-3.34,1.07-5.01,2.37-5.01,1.67,0,2.6,1.08,2.79,3.25h5.3c-.19-4.24-2.84-6.45-7.96-6.63-4.93.36-7.63,3.43-8.1,9.2.37,5.78,3.07,8.75,8.1,8.93,5.02,0,7.68-2.21,7.96-6.63h-5.3c-.09,2.26-.98,3.38-2.65,3.38-1.49,0-2.33-1.8-2.51-5.41v-1.08Z"/>
|
||||
<path class="cls-2" d="M927.16,189.69c.28-3.34,1.07-5.01,2.37-5.01,1.67,0,2.6,1.08,2.79,3.25h5.3c-.19-4.24-2.84-6.45-7.96-6.63-4.93.36-7.63,3.43-8.1,9.2.37,5.78,3.07,8.75,8.1,8.93,5.02,0,7.68-2.21,7.96-6.63h-5.3c-.09,2.26-.98,3.38-2.65,3.38-1.49,0-2.33-1.8-2.51-5.41v-1.08Z"/>
|
||||
<path class="cls-2" d="M854.41,195.73c-1.36.26-1.97-.65-1.8-2.73v-7.81h3.37v-3.38h-3.37v-5.08c-1.56,0-3.12,0-4.69,0,0,1.69,0,3.39,0,5.08h-3.13v3.38h3.13c0,3.23-.02,6.45-.03,9.68.03.49.17,2.15,1.47,3.24.82.7,1.73.84,2.75,1,.82.13,2.18.24,3.88-.17,0-1.11,0-2.23-.01-3.34-.48.09-1,.13-1.56.13Z"/>
|
||||
<path class="cls-2" d="M999.9,195.61c-1.36.26-1.97-.65-1.8-2.73v-7.81h3.37v-3.38h-3.37v-5.08c-1.56,0-3.12,0-4.69,0,0,1.69,0,3.39,0,5.08h-3.13v3.38h3.13l-.03,9.68c.03.49.17,2.15,1.47,3.24.82.7,1.73.84,2.75,1,.82.13,2.18.24,3.88-.17v-3.34c-.5.09-1.02.13-1.58.13Z"/>
|
||||
<path class="cls-2" d="M863.85,184.64h-.13v-3.25h-4.7c0,.54.04,1.31.13,2.3v15.17h5.1v-9.21c.18-1.08.4-1.94.67-2.57.45-.54,1.3-.95,2.55-1.22h2.28v-4.6c-2.95-.18-4.92.95-5.91,3.39Z"/>
|
||||
<path class="cls-2" d="M881.19,181.41c-5.4.26-8.23,3.21-8.49,8.85.25,5.55,3.08,8.42,8.49,8.59,5.4-.17,8.23-3.04,8.49-8.59-.25-5.64-3.08-8.59-8.49-8.85ZM881.19,195.73c-2.28,0-3.42-1.82-3.42-5.47s1.14-5.6,3.42-5.6c2.45,0,3.63,1.87,3.55,5.6,0,3.64-1.18,5.47-3.55,5.47Z"/>
|
||||
<path class="cls-2" d="M908.77,185.85c-.08-.78-.14-1.32-.38-1.9-.5-1.26-1.5-1.96-1.82-2.16-1.45-.93-2.93-.77-3.33-.71-.79-.01-2.53.08-4.12,1.26-.46.34-.82.71-1.1,1.06,0-.67,0-1.34-.01-2h-5.1v17.48h5.1v-10.43c.27-2.53,1.3-3.88,3.09-4.07,2.06,0,3.09,1.36,3.09,4.07v10.43c1.56,0,3.12,0,4.68.01,0-3.79-.02-7.57-.03-11.36.01-.42,0-.99-.07-1.67Z"/>
|
||||
<rect class="cls-2" x="913.06" y="174.68" width="4.81" height="4.29"/>
|
||||
<rect class="cls-2" x="913.18" y="181.97" width="4.58" height="16.79"/>
|
||||
<path class="cls-2" d="M950.52,188.05c-2.08-.52-3.12-1.13-3.12-1.82,0-1.04.62-1.56,1.87-1.56,1.33.09,2.04.65,2.12,1.69h4.37c-.25-3.3-2.41-4.95-6.49-4.95-4.41.35-6.7,2-6.86,4.95-.17,2.86,1.79,4.69,5.86,5.47,2.08.44,3.16,1.13,3.24,2.08,0,1.22-.75,1.82-2.24,1.82-1.58-.09-2.45-.74-2.62-1.95h-4.49c.17,3.3,2.54,4.99,7.11,5.08,4.57-.35,6.99-2.08,7.24-5.21-.67-3.47-2.66-5.34-5.99-5.6Z"/>
|
||||
<path class="cls-2" d="M980.42,184.99c-.32-.09-.51-.13-.59-.13-2.84-.43-4.18-1.56-4.02-3.38.08-1.91,1.26-2.95,3.55-3.12,2.29,0,3.47,1.22,3.55,3.64h4.5c-.24-4.69-2.72-7.16-7.45-7.42-5.84.35-8.87,2.99-9.11,7.94,0,3.21,2.4,5.42,7.22,6.64.16.09.43.17.83.26,2.76.61,4.14,1.74,4.14,3.38-.08,2-1.54,3.04-4.38,3.12-2.45-.17-3.67-1.65-3.67-4.43h-4.73c-.08,5.29,2.72,7.94,8.4,7.94,6.15-.17,9.26-2.78,9.34-7.81.08-3.3-2.45-5.51-7.57-6.64Z"/>
|
||||
<path class="cls-2" d="M1020.78,181.81h-3.98c0,3.43.01,6.87.02,10.3,0,.19-.07,2.13-1.58,3.1-.96.62-2.02.54-2.38.52-.37-.03-1.06-.05-1.65-.47-.81-.57-1.24-1.68-1.29-3.31v-10.15h-4.23c-.01,3.67-.03,7.34-.04,11.01-.01.42.01,1.04.21,1.75.62,2.23,2.61,4.11,4.98,4.62,2.07.45,3.82-.28,4.27-.48.4-.17.72-.36.95-.5,0,.34,0,.68.01,1.02,1.58-.01,3.15-.03,4.73-.04,0-1.2-.01-2.39-.02-3.59v-13.8Z"/>
|
||||
<path class="cls-2" d="M1042.61,174.52h-4.95v9.24c-1.1-1.47-2.58-2.26-4.44-2.34-4.74.26-7.27,3.21-7.61,8.85.34,5.55,2.71,8.42,7.1,8.59,2.37,0,4.01-.87,4.95-2.6,0,.26.04.65.13,1.17v1.17h4.95c-.09-1.04-.13-2.17-.13-3.38v-20.69ZM1034.24,195.73c-2.45,0-3.64-1.82-3.55-5.47-.09-3.73,1.1-5.6,3.55-5.6,2.11.17,3.25,2.04,3.42,5.6-.17,3.47-1.31,5.29-3.42,5.47Z"/>
|
||||
<rect class="cls-2" x="1046.8" y="174.52" width="4.96" height="4.29"/>
|
||||
<rect class="cls-2" x="1046.92" y="181.81" width="4.71" height="16.79"/>
|
||||
<path class="cls-2" d="M1063.98,181.41c-5.35.26-8.14,3.21-8.39,8.85.25,5.55,3.05,8.42,8.39,8.59,5.34-.17,8.14-3.04,8.39-8.59-.25-5.64-3.05-8.59-8.39-8.85ZM1063.98,195.73c-2.25,0-3.38-1.82-3.38-5.47s1.13-5.6,3.38-5.6c2.42,0,3.59,1.87,3.51,5.6,0,3.64-1.17,5.47-3.51,5.47Z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 179 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 116 KiB |
|
Before Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 7.4 KiB |
@@ -19,4 +19,3 @@
|
||||
"hooks": "@/hooks"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,146 +0,0 @@
|
||||
# CC Switch v3.12.1
|
||||
|
||||
> Stability Fixes, StepFun Presets, OpenClaw authHeader, and New Sponsor Partners
|
||||
|
||||
**[中文版 →](v3.12.1-zh.md) | [日本語版 →](v3.12.1-ja.md)**
|
||||
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
CC Switch v3.12.1 is a patch release focused on stability improvements and bug fixes. It resolves a Common Config modal infinite reopen loop, a WebDAV sync foreign key constraint failure, and several i18n interpolation issues. It also adds **StepFun** provider presets, **OpenClaw input type selection** and **authHeader** support, upgrades the default Gemini model to **3.1-pro**, and welcomes four new sponsor partners.
|
||||
|
||||
**Release Date**: 2026-03-12
|
||||
|
||||
**Update Scale**: 19 commits | 56 files changed | +1,429 / -396 lines
|
||||
|
||||
---
|
||||
|
||||
## Highlights
|
||||
|
||||
- **Common Config modal fix**: Resolved an infinite reopen loop in the Common Config modal and added draft editing support
|
||||
- **WebDAV sync reliability**: Fixed a foreign key constraint failure when restoring `provider_health` during WebDAV sync
|
||||
- **StepFun presets**: Added StepFun (阶跃星辰) provider presets including the step-3.5-flash model
|
||||
- **OpenClaw enhancements**: Added input type selection for model Advanced Options and `authHeader` field for vendor-specific auth header support
|
||||
- **Gemini model upgrade**: Upgraded default Gemini model to 3.1-pro in provider presets
|
||||
- **New sponsors**: Welcomed Micu API, XCodeAPI, SiliconFlow, and CTok as sponsor partners
|
||||
|
||||
---
|
||||
|
||||
## New Features
|
||||
|
||||
### StepFun Provider Presets
|
||||
|
||||
Added provider presets for StepFun (阶跃星辰), a leading Chinese AI model provider.
|
||||
|
||||
- New preset entries for StepFun across supported applications
|
||||
- Includes the step-3.5-flash model (#1369, thanks @hengm3467)
|
||||
|
||||
### OpenClaw Enhancements
|
||||
|
||||
Enhanced the OpenClaw configuration with more granular control and better vendor compatibility.
|
||||
|
||||
- Added input type selection dropdown for model Advanced Options (#1368, thanks @liuxxxu)
|
||||
- Added optional `authHeader` boolean to `OpenClawProviderConfig` for vendor-specific auth header support (e.g. Longcat), and refactored form state to reuse the shared type
|
||||
|
||||
### Sponsor Partners
|
||||
|
||||
- **Micu API**: Added Micu API as sponsor partner with affiliate links
|
||||
- **XCodeAPI**: Added XCodeAPI as sponsor partner
|
||||
- **SiliconFlow**: Added SiliconFlow (硅基流动) as sponsor partner with affiliate links
|
||||
- **CTok**: Added CTok as sponsor partner
|
||||
|
||||
---
|
||||
|
||||
## Changes
|
||||
|
||||
- **UCloud → Compshare**: Renamed UCloud provider to Compshare (优云智算) with full i18n support across all three locales (EN/ZH/JA)
|
||||
- **Compshare Links**: Updated Compshare sponsor registration links to coding-plan page
|
||||
- **Gemini Model Upgrade**: Upgraded default Gemini model from 2.5-pro to 3.1-pro in provider presets
|
||||
|
||||
---
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
### Common Config & UI
|
||||
|
||||
- Fixed an infinite reopen loop in the Common Config modal and added draft editing support to prevent data loss during edits
|
||||
- Fixed toolbar compact mode not triggering on Windows due to left-side overflow (#1375, thanks @zuoliangyu)
|
||||
- Fixed session search index not syncing with query data, causing stale list display after session deletion
|
||||
|
||||
### Sync & Data
|
||||
|
||||
- Fixed foreign key constraint failure when restoring `provider_health` table during WebDAV sync
|
||||
|
||||
### Provider & Preset
|
||||
|
||||
- Added missing `authHeader: true` to Longcat provider preset (#1377, thanks @wavever)
|
||||
- Aligned OpenClaw tool permission profiles with upstream schema (#1355, thanks @bigsongeth)
|
||||
- Corrected X-Code API URL from `www.x-code.cn` to `x-code.cc`
|
||||
|
||||
### i18n & Localization
|
||||
|
||||
- Fixed stream check toast i18n interpolation keys not matching translation placeholders
|
||||
- Fixed proxy startup toast not interpolating address and port values (#1399, thanks @Mason-mengze)
|
||||
- Renamed OpenCode API format label from "OpenAI" to "OpenAI Responses" for accuracy
|
||||
|
||||
---
|
||||
|
||||
## Special Thanks
|
||||
|
||||
Thanks to all contributors for their contributions to this release!
|
||||
|
||||
@hengm3467 @liuxxxu @bigsongeth @zuoliangyu @wavever @Mason-mengze
|
||||
|
||||
---
|
||||
|
||||
## Download & Installation
|
||||
|
||||
Visit [Releases](https://github.com/farion1231/cc-switch/releases/latest) to download the appropriate version.
|
||||
|
||||
### System Requirements
|
||||
|
||||
| System | Minimum Version | Architecture |
|
||||
| ------- | ------------------------------- | ----------------------------------- |
|
||||
| Windows | Windows 10 or later | x64 |
|
||||
| macOS | macOS 10.15 (Catalina) or later | Intel (x64) / Apple Silicon (arm64) |
|
||||
| Linux | See table below | x64 |
|
||||
|
||||
### Windows
|
||||
|
||||
| File | Description |
|
||||
| ------------------------------------------ | ---------------------------------------------------- |
|
||||
| `CC-Switch-v3.12.1-Windows.msi` | **Recommended** - MSI installer with auto-update |
|
||||
| `CC-Switch-v3.12.1-Windows-Portable.zip` | Portable version, extract and run, no registry write |
|
||||
|
||||
### macOS
|
||||
|
||||
| File | Description |
|
||||
| ---------------------------------- | -------------------------------------------------------------------- |
|
||||
| `CC-Switch-v3.12.1-macOS.zip` | **Recommended** - Extract and drag to Applications, Universal Binary |
|
||||
| `CC-Switch-v3.12.1-macOS.tar.gz` | For Homebrew installation and auto-update |
|
||||
|
||||
> **Note**: Since the author doesn't have an Apple Developer account, you may see an "unidentified developer" warning on first launch. Please close it, then go to "System Settings" -> "Privacy & Security" -> click "Open Anyway", and it will open normally afterwards.
|
||||
|
||||
### Homebrew (macOS)
|
||||
|
||||
```bash
|
||||
brew tap farion1231/ccswitch
|
||||
brew install --cask cc-switch
|
||||
```
|
||||
|
||||
Update:
|
||||
|
||||
```bash
|
||||
brew upgrade --cask cc-switch
|
||||
```
|
||||
|
||||
### Linux
|
||||
|
||||
| Distribution | Recommended Format | Installation Method |
|
||||
| --------------------------------------- | ------------------ | ---------------------------------------------------------------------- |
|
||||
| Ubuntu / Debian / Linux Mint / Pop!\_OS | `.deb` | `sudo dpkg -i CC-Switch-*.deb` or `sudo apt install ./CC-Switch-*.deb` |
|
||||
| Fedora / RHEL / CentOS / Rocky Linux | `.rpm` | `sudo rpm -i CC-Switch-*.rpm` or `sudo dnf install ./CC-Switch-*.rpm` |
|
||||
| openSUSE | `.rpm` | `sudo zypper install ./CC-Switch-*.rpm` |
|
||||
| Arch Linux / Manjaro | `.AppImage` | Add execute permission and run directly, or use AUR |
|
||||
| Other distributions / Unsure | `.AppImage` | `chmod +x CC-Switch-*.AppImage && ./CC-Switch-*.AppImage` |
|
||||
@@ -1,146 +0,0 @@
|
||||
# CC Switch v3.12.1
|
||||
|
||||
> 安定性修正、StepFun プリセット、OpenClaw authHeader 対応、新スポンサーパートナー
|
||||
|
||||
**[中文版 →](v3.12.1-zh.md) | [English →](v3.12.1-en.md)**
|
||||
|
||||
---
|
||||
|
||||
## 概要
|
||||
|
||||
CC Switch v3.12.1 は、安定性の改善とバグ修正に焦点を当てたパッチリリースです。共通設定モーダルの無限再オープンループ、WebDAV 同期時の外部キー制約エラー、複数の i18n 補間問題を修正しました。また、**StepFun(阶跃星辰)** プロバイダープリセットの追加、OpenClaw の**入力タイプ選択**と **authHeader** サポート、デフォルト Gemini モデルの **3.1-pro** へのアップグレード、4 つの新スポンサーパートナーの追加が含まれます。
|
||||
|
||||
**リリース日**: 2026-03-12
|
||||
|
||||
**更新規模**: 19 commits | 56 files changed | +1,429 / -396 lines
|
||||
|
||||
---
|
||||
|
||||
## ハイライト
|
||||
|
||||
- **共通設定モーダル修正**: 共通設定モーダルの無限再オープンループを解決し、下書き編集サポートを追加
|
||||
- **WebDAV 同期の信頼性向上**: WebDAV 同期で `provider_health` 復元時の外部キー制約エラーを修正
|
||||
- **StepFun プリセット**: StepFun(阶跃星辰)プロバイダープリセットを追加、step-3.5-flash モデルを含む
|
||||
- **OpenClaw 強化**: モデル詳細設定に入力タイプ選択を追加、ベンダー固有の認証ヘッダーサポート用 `authHeader` フィールドを追加
|
||||
- **Gemini モデルアップグレード**: プロバイダープリセットのデフォルト Gemini モデルを 3.1-pro にアップグレード
|
||||
- **新スポンサー**: Micu API、XCodeAPI、SiliconFlow、CTok をスポンサーパートナーとして追加
|
||||
|
||||
---
|
||||
|
||||
## 新機能
|
||||
|
||||
### StepFun プロバイダープリセット
|
||||
|
||||
中国の主要 AI モデルプロバイダーである StepFun(阶跃星辰)のプロバイダープリセットを追加しました。
|
||||
|
||||
- サポート対象アプリケーション全体に StepFun プリセットエントリーを追加
|
||||
- step-3.5-flash モデルを含む(#1369、@hengm3467 に感謝)
|
||||
|
||||
### OpenClaw 強化
|
||||
|
||||
OpenClaw 設定をより細かく制御でき、ベンダー互換性を向上させました。
|
||||
|
||||
- モデル詳細設定に入力タイプ(input type)選択ドロップダウンを追加(#1368、@liuxxxu に感謝)
|
||||
- `OpenClawProviderConfig` にオプションの `authHeader` ブール値を追加し、ベンダー固有の認証ヘッダー(例: Longcat)をサポート。フォーム状態を共有型の再利用にリファクタリング
|
||||
|
||||
### スポンサーパートナー
|
||||
|
||||
- **Micu API**: Micu API をスポンサーパートナーとして追加、アフィリエイトリンク付き
|
||||
- **XCodeAPI**: XCodeAPI をスポンサーパートナーとして追加
|
||||
- **SiliconFlow**: SiliconFlow(硅基流动)をスポンサーパートナーとして追加、アフィリエイトリンク付き
|
||||
- **CTok**: CTok をスポンサーパートナーとして追加
|
||||
|
||||
---
|
||||
|
||||
## 変更
|
||||
|
||||
- **UCloud → Compshare**: UCloud プロバイダーを Compshare(优云智算)にリネームし、3 言語(EN/ZH/JA)の完全な i18n サポートを追加
|
||||
- **Compshare リンク**: Compshare スポンサー登録リンクを coding-plan ページに更新
|
||||
- **Gemini モデルアップグレード**: プロバイダープリセットのデフォルト Gemini モデルを 2.5-pro から 3.1-pro にアップグレード
|
||||
|
||||
---
|
||||
|
||||
## バグ修正
|
||||
|
||||
### 共通設定と UI
|
||||
|
||||
- 共通設定モーダルの無限再オープンループを修正し、編集中のデータ損失を防ぐための下書き編集サポートを追加
|
||||
- Windows でツールバーコンパクトモードが左側のオーバーフローにより機能しない問題を修正(#1375、@zuoliangyu に感謝)
|
||||
- セッション削除後にクエリデータと検索インデックスが同期されず、リストが更新されない問題を修正
|
||||
|
||||
### 同期とデータ
|
||||
|
||||
- WebDAV 同期で `provider_health` テーブルを復元する際の外部キー制約エラーを修正
|
||||
|
||||
### プロバイダーとプリセット
|
||||
|
||||
- Longcat プロバイダープリセットに欠落していた `authHeader: true` を追加(#1377、@wavever に感謝)
|
||||
- OpenClaw のツール権限プロファイルをアップストリームスキーマに合わせて修正(#1355、@bigsongeth に感謝)
|
||||
- X-Code API の URL を `www.x-code.cn` から `x-code.cc` に修正
|
||||
|
||||
### i18n とローカリゼーション
|
||||
|
||||
- Stream Check トーストの i18n 補間キーが翻訳プレースホルダーと一致しない問題を修正
|
||||
- プロキシ起動トーストでアドレスとポート値が補間されない問題を修正(#1399、@Mason-mengze に感謝)
|
||||
- OpenCode の API フォーマットラベルを「OpenAI」から「OpenAI Responses」にリネームし、正確性を向上
|
||||
|
||||
---
|
||||
|
||||
## 謝辞
|
||||
|
||||
以下のコントリビューターの皆様、このリリースへの貢献に感謝します!
|
||||
|
||||
@hengm3467 @liuxxxu @bigsongeth @zuoliangyu @wavever @Mason-mengze
|
||||
|
||||
---
|
||||
|
||||
## ダウンロードとインストール
|
||||
|
||||
[Releases](https://github.com/farion1231/cc-switch/releases/latest) から適切なバージョンをダウンロードしてください。
|
||||
|
||||
### システム要件
|
||||
|
||||
| システム | 最小バージョン | アーキテクチャ |
|
||||
| -------- | -------------------------------- | ----------------------------------- |
|
||||
| Windows | Windows 10 以降 | x64 |
|
||||
| macOS | macOS 10.15 (Catalina) 以降 | Intel (x64) / Apple Silicon (arm64) |
|
||||
| Linux | 下表参照 | x64 |
|
||||
|
||||
### Windows
|
||||
|
||||
| ファイル | 説明 |
|
||||
| ------------------------------------------ | ---------------------------------------------------- |
|
||||
| `CC-Switch-v3.12.1-Windows.msi` | **推奨** - MSI インストーラー、自動更新対応 |
|
||||
| `CC-Switch-v3.12.1-Windows-Portable.zip` | ポータブル版、解凍して実行、レジストリ書き込みなし |
|
||||
|
||||
### macOS
|
||||
|
||||
| ファイル | 説明 |
|
||||
| ---------------------------------- | ----------------------------------------------------------------- |
|
||||
| `CC-Switch-v3.12.1-macOS.zip` | **推奨** - 解凍して Applications にドラッグ、Universal Binary |
|
||||
| `CC-Switch-v3.12.1-macOS.tar.gz` | Homebrew インストールと自動更新用 |
|
||||
|
||||
> **注意**: 作者が Apple Developer アカウントを持っていないため、初回起動時に「開発元を確認できません」という警告が表示される場合があります。一度閉じてから、「システム設定」→「プライバシーとセキュリティ」→「このまま開く」をクリックすると、その後は正常に開けます。
|
||||
|
||||
### Homebrew (macOS)
|
||||
|
||||
```bash
|
||||
brew tap farion1231/ccswitch
|
||||
brew install --cask cc-switch
|
||||
```
|
||||
|
||||
更新:
|
||||
|
||||
```bash
|
||||
brew upgrade --cask cc-switch
|
||||
```
|
||||
|
||||
### Linux
|
||||
|
||||
| ディストリビューション | 推奨形式 | インストール方法 |
|
||||
| --------------------------------------- | ----------- | ---------------------------------------------------------------------- |
|
||||
| Ubuntu / Debian / Linux Mint / Pop!\_OS | `.deb` | `sudo dpkg -i CC-Switch-*.deb` または `sudo apt install ./CC-Switch-*.deb` |
|
||||
| Fedora / RHEL / CentOS / Rocky Linux | `.rpm` | `sudo rpm -i CC-Switch-*.rpm` または `sudo dnf install ./CC-Switch-*.rpm` |
|
||||
| openSUSE | `.rpm` | `sudo zypper install ./CC-Switch-*.rpm` |
|
||||
| Arch Linux / Manjaro | `.AppImage` | 実行権限を追加して直接実行、または AUR を使用 |
|
||||
| その他のディストリビューション / 不明 | `.AppImage` | `chmod +x CC-Switch-*.AppImage && ./CC-Switch-*.AppImage` |
|
||||
@@ -1,146 +0,0 @@
|
||||
# CC Switch v3.12.1
|
||||
|
||||
> 稳定性修复、StepFun 预设、OpenClaw authHeader 支持,以及新赞助商伙伴
|
||||
|
||||
**[English →](v3.12.1-en.md) | [日本語版 →](v3.12.1-ja.md)**
|
||||
|
||||
---
|
||||
|
||||
## 概览
|
||||
|
||||
CC Switch v3.12.1 是一个以稳定性改进和 Bug 修复为主的补丁版本。修复了通用配置弹窗无限重复打开的循环问题、WebDAV 同步时的外键约束失败以及多个 i18n 插值问题。同时新增了 **StepFun(阶跃星辰)** 供应商预设、OpenClaw **输入类型选择** 和 **authHeader** 支持,将默认 Gemini 模型升级到 **3.1-pro**,并欢迎四位新赞助商伙伴加入。
|
||||
|
||||
**发布日期**:2026-03-12
|
||||
|
||||
**更新规模**:19 commits | 56 files changed | +1,429 / -396 lines
|
||||
|
||||
---
|
||||
|
||||
## 重点内容
|
||||
|
||||
- **通用配置弹窗修复**:解决了通用配置弹窗无限重复打开的循环问题,并新增草稿编辑支持
|
||||
- **WebDAV 同步可靠性**:修复了 WebDAV 同步恢复 `provider_health` 时的外键约束失败
|
||||
- **StepFun 预设**:新增 StepFun(阶跃星辰)供应商预设,包含 step-3.5-flash 模型
|
||||
- **OpenClaw 增强**:新增模型高级选项的输入类型选择和 `authHeader` 字段,支持供应商特定的认证头
|
||||
- **Gemini 模型升级**:供应商预设中的默认 Gemini 模型升级到 3.1-pro
|
||||
- **新赞助商**:欢迎 Micu API、XCodeAPI、SiliconFlow、CTok 加入赞助伙伴
|
||||
|
||||
---
|
||||
|
||||
## 新功能
|
||||
|
||||
### StepFun 供应商预设
|
||||
|
||||
新增 StepFun(阶跃星辰)供应商预设,阶跃星辰是领先的中国 AI 模型提供商。
|
||||
|
||||
- 在各支持应用中新增 StepFun 预设条目
|
||||
- 包含 step-3.5-flash 模型(#1369,感谢 @hengm3467)
|
||||
|
||||
### OpenClaw 增强
|
||||
|
||||
增强 OpenClaw 配置能力,提供更细粒度的控制和更好的供应商兼容性。
|
||||
|
||||
- 新增模型高级选项的输入类型(input type)选择下拉框(#1368,感谢 @liuxxxu)
|
||||
- 在 `OpenClawProviderConfig` 中新增可选的 `authHeader` 布尔字段,支持供应商特定的认证头(如 Longcat),并重构表单状态以复用共享类型
|
||||
|
||||
### 赞助商伙伴
|
||||
|
||||
- **Micu API**:新增 Micu API 赞助商及推广链接
|
||||
- **XCodeAPI**:新增 XCodeAPI 赞助商
|
||||
- **SiliconFlow**:新增 SiliconFlow(硅基流动)赞助商及推广链接
|
||||
- **CTok**:新增 CTok 赞助商
|
||||
|
||||
---
|
||||
|
||||
## 变更
|
||||
|
||||
- **UCloud → Compshare**:将 UCloud 供应商更名为 Compshare(优云智算),支持三种语言(中/英/日)的完整国际化
|
||||
- **Compshare 链接**:更新 Compshare 赞助商注册链接指向 coding-plan 页面
|
||||
- **Gemini 模型升级**:供应商预设中的默认 Gemini 模型从 2.5-pro 升级到 3.1-pro
|
||||
|
||||
---
|
||||
|
||||
## Bug 修复
|
||||
|
||||
### 通用配置与 UI
|
||||
|
||||
- 修复通用配置弹窗无限重复打开的循环问题,并新增草稿编辑支持以防止编辑过程中数据丢失
|
||||
- 修复 Windows 下因左侧溢出导致工具栏紧凑模式不触发的问题(#1375,感谢 @zuoliangyu)
|
||||
- 修复会话删除后搜索索引未与查询数据同步,导致列表显示过期的问题
|
||||
|
||||
### 同步与数据
|
||||
|
||||
- 修复 WebDAV 同步恢复 `provider_health` 表时的外键约束失败
|
||||
|
||||
### 供应商与预设
|
||||
|
||||
- 为 Longcat 供应商预设补充缺失的 `authHeader: true`(#1377,感谢 @wavever)
|
||||
- 对齐 OpenClaw 工具权限配置与上游 schema(#1355,感谢 @bigsongeth)
|
||||
- 修正 X-Code API URL,从 `www.x-code.cn` 改为 `x-code.cc`
|
||||
|
||||
### i18n 与本地化
|
||||
|
||||
- 修复 Stream Check Toast 的 i18n 插值 key 与翻译占位符不匹配
|
||||
- 修复代理启动 Toast 未正确插值地址和端口的问题(#1399,感谢 @Mason-mengze)
|
||||
- 将 OpenCode API 格式标签从 "OpenAI" 改为 "OpenAI Responses",更准确地反映实际格式
|
||||
|
||||
---
|
||||
|
||||
## 特别感谢
|
||||
|
||||
感谢以下贡献者为本版本做出的贡献!
|
||||
|
||||
@hengm3467 @liuxxxu @bigsongeth @zuoliangyu @wavever @Mason-mengze
|
||||
|
||||
---
|
||||
|
||||
## 下载与安装
|
||||
|
||||
访问 [Releases](https://github.com/farion1231/cc-switch/releases/latest) 下载对应版本。
|
||||
|
||||
### 系统要求
|
||||
|
||||
| 系统 | 最低版本 | 架构 |
|
||||
| ------- | ----------------------------- | ----------------------------------- |
|
||||
| Windows | Windows 10 及以上 | x64 |
|
||||
| macOS | macOS 10.15 (Catalina) 及以上 | Intel (x64) / Apple Silicon (arm64) |
|
||||
| Linux | 见下表 | x64 |
|
||||
|
||||
### Windows
|
||||
|
||||
| 文件 | 说明 |
|
||||
| ------------------------------------------ | ----------------------------------- |
|
||||
| `CC-Switch-v3.12.1-Windows.msi` | **推荐** - MSI 安装包,支持自动更新 |
|
||||
| `CC-Switch-v3.12.1-Windows-Portable.zip` | 便携版,解压即用,不写入注册表 |
|
||||
|
||||
### macOS
|
||||
|
||||
| 文件 | 说明 |
|
||||
| ---------------------------------- | --------------------------------------------------------- |
|
||||
| `CC-Switch-v3.12.1-macOS.zip` | **推荐** - 解压后拖入 Applications 即可,Universal Binary |
|
||||
| `CC-Switch-v3.12.1-macOS.tar.gz` | 用于 Homebrew 安装和自动更新 |
|
||||
|
||||
> **注意**:由于作者没有苹果开发者账号,首次打开可能出现"未知开发者"警告,请先关闭,然后前往"系统设置" → "隐私与安全性" → 点击"仍要打开",之后便可以正常打开
|
||||
|
||||
### Homebrew(macOS)
|
||||
|
||||
```bash
|
||||
brew tap farion1231/ccswitch
|
||||
brew install --cask cc-switch
|
||||
```
|
||||
|
||||
更新:
|
||||
|
||||
```bash
|
||||
brew upgrade --cask cc-switch
|
||||
```
|
||||
|
||||
### Linux
|
||||
|
||||
| 发行版 | 推荐格式 | 安装方式 |
|
||||
| --------------------------------------- | ----------- | ---------------------------------------------------------------------- |
|
||||
| Ubuntu / Debian / Linux Mint / Pop!\_OS | `.deb` | `sudo dpkg -i CC-Switch-*.deb` 或 `sudo apt install ./CC-Switch-*.deb` |
|
||||
| Fedora / RHEL / CentOS / Rocky Linux | `.rpm` | `sudo rpm -i CC-Switch-*.rpm` 或 `sudo dnf install ./CC-Switch-*.rpm` |
|
||||
| openSUSE | `.rpm` | `sudo zypper install ./CC-Switch-*.rpm` |
|
||||
| Arch Linux / Manjaro | `.AppImage` | 添加执行权限后直接运行,或使用 AUR |
|
||||
| 其他发行版 / 不确定 | `.AppImage` | `chmod +x CC-Switch-*.AppImage && ./CC-Switch-*.AppImage` |
|
||||
@@ -1,138 +0,0 @@
|
||||
# CC Switch v3.12.2
|
||||
|
||||
> Common Config Protection During Proxy Takeover, Snippet Lifecycle Stability, Section-Aware Codex TOML Editing
|
||||
|
||||
**[中文版 →](v3.12.2-zh.md) | [日本語版 →](v3.12.2-ja.md)**
|
||||
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
CC Switch v3.12.2 is a reliability-focused patch release that addresses Common Config loss during proxy takeover and improves Codex TOML editing accuracy. Proxy takeover hot-switches and provider sync now update the restore backup instead of overwriting live config files; the startup sequence has been reordered so snippets are extracted from clean live files before takeover state is restored; and Codex `base_url` editing has been refactored into a section-aware model that no longer appends to the end of the file.
|
||||
|
||||
**Release Date**: 2026-03-12
|
||||
|
||||
**Update Scale**: 5 commits | 22 files changed | +1,716 / -288 lines
|
||||
|
||||
---
|
||||
|
||||
## Highlights
|
||||
|
||||
- **Empty state guidance**: Provider list empty state now shows detailed import instructions with a conditional Common Config snippet hint for Claude/Codex/Gemini
|
||||
|
||||
- **Proxy takeover restore flow rework**: Hot-switches and provider sync now refresh the restore backup instead of overwriting live config files, preserving the full user configuration on rollback
|
||||
- **Snippet lifecycle stability**: Introduced a `cleared` flag to prevent auto-extraction from resurrecting cleared snippets, and reordered startup to extract from clean state
|
||||
- **Section-aware Codex TOML editing**: `base_url` and `model` field reads/writes now target the correct `[model_providers.<name>]` section
|
||||
- **Codex MCP config protection**: Existing `mcp_servers` blocks in restore snapshots survive provider hot-switches via per-server-id merge instead of wholesale replacement, with provider/common-config definitions winning on conflict
|
||||
|
||||
---
|
||||
|
||||
## New Features
|
||||
|
||||
### Empty State Guidance
|
||||
|
||||
Improved the first-run experience with helpful guidance when the provider list is empty.
|
||||
|
||||
- Empty state page shows step-by-step import instructions
|
||||
- Conditionally displays a Common Config snippet hint for Claude/Codex/Gemini providers (not shown for OpenCode/OpenClaw)
|
||||
|
||||
---
|
||||
|
||||
## Changes
|
||||
|
||||
### Proxy Takeover Restore Flow
|
||||
|
||||
The proxy takeover hot-switch and provider sync logic has been reworked to protect Common Config throughout the takeover lifecycle.
|
||||
|
||||
- Provider sync now updates the restore backup instead of writing directly to live config files when takeover is active
|
||||
- Effective provider settings are rebuilt with Common Config applied before saving restore snapshots, so rollback restores the real user configuration
|
||||
- Legacy providers with inferred common config usage are automatically marked with `commonConfigEnabled=true`
|
||||
|
||||
### Codex TOML Editing Engine
|
||||
|
||||
Codex `config.toml` update logic has been refactored onto shared section-aware TOML helpers.
|
||||
|
||||
- New Rust module `codex_config.rs` with `update_codex_toml_field` and `remove_codex_toml_base_url_if`
|
||||
- New frontend utilities `getTomlSectionRange` / `getCodexProviderSectionName` for section-aware operations
|
||||
- Inline TOML editing logic scattered across `proxy.rs` now delegates to the new module
|
||||
|
||||
### Common Config Initialization Lifecycle
|
||||
|
||||
The startup sequence has been reordered for more robust snippet extraction and migration.
|
||||
|
||||
- Startup now auto-extracts Common Config snippets from clean live files before restoring proxy takeover state
|
||||
- Introduced a snippet `cleared` flag to track whether a user intentionally cleared a snippet
|
||||
- Persisted a one-time legacy migration flag to avoid repeated `commonConfigEnabled` backfills
|
||||
|
||||
---
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
### Common Config Loss
|
||||
|
||||
- Fixed multiple scenarios where Common Config could be dropped during proxy takeover: sync overwriting live files, hot-switches producing incomplete restore snapshots, and provider switches losing config changes
|
||||
|
||||
### Codex Restore Snapshot Preservation
|
||||
|
||||
- Fixed Codex takeover restore backups discarding existing `mcp_servers` blocks during provider hot-switches; changed MCP backup preservation from wholesale table replacement to per-server-id merge so provider/common-config MCP updates win on conflict while backup-only servers are retained
|
||||
|
||||
### Cleared Snippet Resurrection
|
||||
|
||||
- Fixed startup auto-extraction recreating Common Config snippets that users had intentionally cleared
|
||||
|
||||
### Codex `base_url` Misplacement
|
||||
|
||||
- Fixed Codex `base_url` extraction and editing not targeting the correct `[model_providers.<name>]` section, causing it to append to the file tail or confuse `mcp_servers.*.base_url` entries for provider endpoints
|
||||
|
||||
---
|
||||
|
||||
## Download & Installation
|
||||
|
||||
Visit [Releases](https://github.com/farion1231/cc-switch/releases/latest) to download the appropriate version.
|
||||
|
||||
### System Requirements
|
||||
|
||||
| System | Minimum Version | Architecture |
|
||||
| ------- | ------------------------------- | ----------------------------------- |
|
||||
| Windows | Windows 10 or later | x64 |
|
||||
| macOS | macOS 10.15 (Catalina) or later | Intel (x64) / Apple Silicon (arm64) |
|
||||
| Linux | See table below | x64 |
|
||||
|
||||
### Windows
|
||||
|
||||
| File | Description |
|
||||
| ------------------------------------------ | ---------------------------------------------------- |
|
||||
| `CC-Switch-v3.12.2-Windows.msi` | **Recommended** - MSI installer with auto-update |
|
||||
| `CC-Switch-v3.12.2-Windows-Portable.zip` | Portable version, extract and run, no registry write |
|
||||
|
||||
### macOS
|
||||
|
||||
| File | Description |
|
||||
| ---------------------------------- | -------------------------------------------------------------------- |
|
||||
| `CC-Switch-v3.12.2-macOS.zip` | **Recommended** - Extract and drag to Applications, Universal Binary |
|
||||
| `CC-Switch-v3.12.2-macOS.tar.gz` | For Homebrew installation and auto-update |
|
||||
|
||||
> **Note**: Since the author doesn't have an Apple Developer account, you may see an "unidentified developer" warning on first launch. Please close it, then go to "System Settings" -> "Privacy & Security" -> click "Open Anyway", and it will open normally afterwards.
|
||||
|
||||
### Homebrew (macOS)
|
||||
|
||||
```bash
|
||||
brew tap farion1231/ccswitch
|
||||
brew install --cask cc-switch
|
||||
```
|
||||
|
||||
Update:
|
||||
|
||||
```bash
|
||||
brew upgrade --cask cc-switch
|
||||
```
|
||||
|
||||
### Linux
|
||||
|
||||
| Distribution | Recommended Format | Installation Method |
|
||||
| --------------------------------------- | ------------------ | ---------------------------------------------------------------------- |
|
||||
| Ubuntu / Debian / Linux Mint / Pop!\_OS | `.deb` | `sudo dpkg -i CC-Switch-*.deb` or `sudo apt install ./CC-Switch-*.deb` |
|
||||
| Fedora / RHEL / CentOS / Rocky Linux | `.rpm` | `sudo rpm -i CC-Switch-*.rpm` or `sudo dnf install ./CC-Switch-*.rpm` |
|
||||
| openSUSE | `.rpm` | `sudo zypper install ./CC-Switch-*.rpm` |
|
||||
| Arch Linux / Manjaro | `.AppImage` | Add execute permission and run directly, or use AUR |
|
||||
| Other distributions / Unsure | `.AppImage` | `chmod +x CC-Switch-*.AppImage && ./CC-Switch-*.AppImage` |
|
||||
@@ -1,138 +0,0 @@
|
||||
# CC Switch v3.12.2
|
||||
|
||||
> プロキシテイクオーバー中の共通設定保護、Snippet ライフサイクルの安定化、Codex TOML セクション対応編集
|
||||
|
||||
**[中文版 →](v3.12.2-zh.md) | [English →](v3.12.2-en.md)**
|
||||
|
||||
---
|
||||
|
||||
## 概要
|
||||
|
||||
CC Switch v3.12.2 は、信頼性を重視したパッチリリースです。プロキシテイクオーバーモードでの共通設定(Common Config)の消失問題を解決し、Codex TOML 設定の編集精度を改善しました。テイクオーバーのホットスイッチとプロバイダー同期は、ライブ設定ファイルを上書きする代わりにリストアバックアップを更新するようになりました。起動シーケンスを再整理し、テイクオーバー状態を復元する前にクリーンなライブファイルから Snippet を抽出するようにしました。また Codex の `base_url` 編集をセクション対応モデルにリファクタリングし、ファイル末尾への誤追加を防止しました。
|
||||
|
||||
**リリース日**: 2026-03-12
|
||||
|
||||
**更新規模**: 5 commits | 22 files changed | +1,716 / -288 lines
|
||||
|
||||
---
|
||||
|
||||
## ハイライト
|
||||
|
||||
- **空状態ガイダンスの改善**: プロバイダーリストが空の場合に詳細なインポート手順を表示し、Claude/Codex/Gemini には共通設定 Snippet のヒントを条件付きで表示
|
||||
|
||||
- **プロキシテイクオーバーリストアフロー刷新**: ホットスイッチとプロバイダー同期がライブ設定ファイルの上書きではなくリストアバックアップの更新を行うようになり、ロールバック時に完全なユーザー設定を保持
|
||||
- **Snippet ライフサイクルの安定化**: `cleared` フラグを導入し、クリア済み Snippet の自動再抽出を防止。起動順序を調整してクリーンな状態から抽出
|
||||
- **Codex TOML セクション対応編集**: `base_url` と `model` フィールドの読み書きが正しい `[model_providers.<name>]` セクションを対象にするように改善
|
||||
- **Codex MCP 設定の保護**: プロバイダーホットスイッチ時にリストアスナップショット内の既存 `mcp_servers` ブロックが保持されるように修正。テーブル全体の置換からサーバー ID ごとのマージに変更し、プロバイダー/共通設定の MCP 定義が競合時に優先
|
||||
|
||||
---
|
||||
|
||||
## 新機能
|
||||
|
||||
### 空状態ガイダンスの改善
|
||||
|
||||
プロバイダーリストが空の場合の初回利用体験を改善しました。
|
||||
|
||||
- 空状態ページにプロバイダーインポートの操作ガイドを表示
|
||||
- Claude/Codex/Gemini アプリケーションに共通設定 Snippet のヒントを条件付きで表示(OpenCode/OpenClaw には非表示)
|
||||
|
||||
---
|
||||
|
||||
## 変更
|
||||
|
||||
### プロキシテイクオーバーリストアフロー
|
||||
|
||||
テイクオーバーのホットスイッチとプロバイダー同期ロジックをリファクタリングし、テイクオーバーライフサイクル全体で共通設定を保護します。
|
||||
|
||||
- テイクオーバーがアクティブな場合、プロバイダー同期がライブ設定ファイルへの直接書き込みではなくリストアバックアップを更新
|
||||
- リストアスナップショットの保存前に共通設定を適用した実効プロバイダー設定を再構築し、ロールバックで実際のユーザー設定を復元
|
||||
- 共通設定の使用が推測されるレガシープロバイダーに `commonConfigEnabled=true` を自動マーク
|
||||
|
||||
### Codex TOML 編集エンジン
|
||||
|
||||
Codex `config.toml` の更新ロジックを共有のセクション対応 TOML ヘルパーにリファクタリングしました。
|
||||
|
||||
- Rust 側に新モジュール `codex_config.rs` を追加(`update_codex_toml_field` と `remove_codex_toml_base_url_if`)
|
||||
- フロントエンドにセクション対応ユーティリティ `getTomlSectionRange` / `getCodexProviderSectionName` を追加
|
||||
- `proxy.rs` に散在していたインライン TOML 編集ロジックを新モジュールに委譲
|
||||
|
||||
### 共通設定初期化ライフサイクル
|
||||
|
||||
Snippet の抽出とマイグレーションをより堅牢にするため、起動シーケンスを再整理しました。
|
||||
|
||||
- 起動時にプロキシテイクオーバー状態を復元する前に、クリーンなライブファイルから共通設定 Snippet を自動抽出
|
||||
- Snippet の `cleared` フラグを導入し、ユーザーが意図的にクリアしたかどうかを追跡
|
||||
- 一回限りのレガシーマイグレーションフラグを永続化し、`commonConfigEnabled` のバックフィルの繰り返しを防止
|
||||
|
||||
---
|
||||
|
||||
## バグ修正
|
||||
|
||||
### 共通設定の消失
|
||||
|
||||
- プロキシテイクオーバー中に共通設定が消失する複数のシナリオを修正:同期によるライブファイルの上書き、ホットスイッチによる不完全なリストアスナップショット、プロバイダー切り替え時の設定変更の消失
|
||||
|
||||
### Codex リストアスナップショットの保護
|
||||
|
||||
- プロバイダーホットスイッチ時に Codex テイクオーバーリストアバックアップが既存の `mcp_servers` ブロックを破棄する問題を修正。MCP バックアップ保持をテーブル全体の置換からサーバー ID ごとのマージに変更し、プロバイダー/共通設定の MCP 更新が競合時に優先され、バックアップのみのサーバーも保持
|
||||
|
||||
### クリア済み Snippet の復活
|
||||
|
||||
- 起動時の自動抽出が、ユーザーが意図的にクリアした共通設定 Snippet を再作成する問題を修正
|
||||
|
||||
### Codex `base_url` の配置エラー
|
||||
|
||||
- Codex `base_url` の抽出と編集が正しい `[model_providers.<name>]` セクションを対象にせず、ファイル末尾に追加されたり `mcp_servers.*.base_url` をプロバイダーエンドポイントと誤認する問題を修正
|
||||
|
||||
---
|
||||
|
||||
## ダウンロードとインストール
|
||||
|
||||
[Releases](https://github.com/farion1231/cc-switch/releases/latest) から適切なバージョンをダウンロードしてください。
|
||||
|
||||
### システム要件
|
||||
|
||||
| システム | 最小バージョン | アーキテクチャ |
|
||||
| -------- | -------------------------------- | ----------------------------------- |
|
||||
| Windows | Windows 10 以降 | x64 |
|
||||
| macOS | macOS 10.15 (Catalina) 以降 | Intel (x64) / Apple Silicon (arm64) |
|
||||
| Linux | 下表参照 | x64 |
|
||||
|
||||
### Windows
|
||||
|
||||
| ファイル | 説明 |
|
||||
| ------------------------------------------ | ---------------------------------------------------- |
|
||||
| `CC-Switch-v3.12.2-Windows.msi` | **推奨** - MSI インストーラー、自動更新対応 |
|
||||
| `CC-Switch-v3.12.2-Windows-Portable.zip` | ポータブル版、解凍して実行、レジストリ書き込みなし |
|
||||
|
||||
### macOS
|
||||
|
||||
| ファイル | 説明 |
|
||||
| ---------------------------------- | ----------------------------------------------------------------- |
|
||||
| `CC-Switch-v3.12.2-macOS.zip` | **推奨** - 解凍して Applications にドラッグ、Universal Binary |
|
||||
| `CC-Switch-v3.12.2-macOS.tar.gz` | Homebrew インストールと自動更新用 |
|
||||
|
||||
> **注意**: 作者が Apple Developer アカウントを持っていないため、初回起動時に「開発元を確認できません」という警告が表示される場合があります。一度閉じてから、「システム設定」→「プライバシーとセキュリティ」→「このまま開く」をクリックすると、その後は正常に開けます。
|
||||
|
||||
### Homebrew (macOS)
|
||||
|
||||
```bash
|
||||
brew tap farion1231/ccswitch
|
||||
brew install --cask cc-switch
|
||||
```
|
||||
|
||||
更新:
|
||||
|
||||
```bash
|
||||
brew upgrade --cask cc-switch
|
||||
```
|
||||
|
||||
### Linux
|
||||
|
||||
| ディストリビューション | 推奨形式 | インストール方法 |
|
||||
| --------------------------------------- | ----------- | ---------------------------------------------------------------------- |
|
||||
| Ubuntu / Debian / Linux Mint / Pop!\_OS | `.deb` | `sudo dpkg -i CC-Switch-*.deb` または `sudo apt install ./CC-Switch-*.deb` |
|
||||
| Fedora / RHEL / CentOS / Rocky Linux | `.rpm` | `sudo rpm -i CC-Switch-*.rpm` または `sudo dnf install ./CC-Switch-*.rpm` |
|
||||
| openSUSE | `.rpm` | `sudo zypper install ./CC-Switch-*.rpm` |
|
||||
| Arch Linux / Manjaro | `.AppImage` | 実行権限を追加して直接実行、または AUR を使用 |
|
||||
| その他のディストリビューション / 不明 | `.AppImage` | `chmod +x CC-Switch-*.AppImage && ./CC-Switch-*.AppImage` |
|
||||
@@ -1,138 +0,0 @@
|
||||
# CC Switch v3.12.2
|
||||
|
||||
> 代理接管期间通用配置保护、Snippet 生命周期稳定性、Codex TOML Section 感知编辑
|
||||
|
||||
**[English →](v3.12.2-en.md) | [日本語版 →](v3.12.2-ja.md)**
|
||||
|
||||
---
|
||||
|
||||
## 概览
|
||||
|
||||
CC Switch v3.12.2 是一个以可靠性为核心的补丁版本,重点解决代理(Proxy)接管模式下通用配置(Common Config)丢失的问题,并改进了 Codex TOML 配置的编辑准确性。代理接管的热切换和供应商同步现在会更新恢复备份而非直接覆盖 live 文件;启动流程重新排序,确保先从干净的 live 文件提取 Snippet 再恢复接管状态;Codex 的 `base_url` 编辑重构为 Section 感知模式,不再错误追加到文件末尾。
|
||||
|
||||
**发布日期**:2026-03-12
|
||||
|
||||
**更新规模**:5 commits | 22 files changed | +1,716 / -288 lines
|
||||
|
||||
---
|
||||
|
||||
## 重点内容
|
||||
|
||||
- **首次使用引导优化**:供应商列表空状态显示详细的导入说明,Claude/Codex/Gemini 还会提示通用配置 Snippet 功能
|
||||
|
||||
- **代理接管恢复流程重构**:热切换和供应商同步现在刷新恢复备份,而非覆盖 live 配置文件,回滚时保留完整的用户配置
|
||||
- **Snippet 生命周期稳定**:引入 `cleared` 标志防止已清除的 Snippet 被自动重新提取,启动顺序调整确保从干净状态提取
|
||||
- **Codex TOML Section 感知编辑**:`base_url` 和 `model` 字段的读写现在定位到正确的 `[model_providers.<name>]` Section
|
||||
- **Codex MCP 配置保护**:热切换供应商时保留恢复快照中已有的 `mcp_servers` 配置块,按 server id 合并而非整表替换,供应商/通用配置的 MCP 定义优先
|
||||
|
||||
---
|
||||
|
||||
## 新功能
|
||||
|
||||
### 空状态引导优化
|
||||
|
||||
改善首次使用体验,当供应商列表为空时显示详细的导入说明。
|
||||
|
||||
- 空状态页面展示导入供应商的操作指引
|
||||
- 对 Claude/Codex/Gemini 应用有条件地显示通用配置 Snippet 提示(OpenCode/OpenClaw 不显示)
|
||||
|
||||
---
|
||||
|
||||
## 变更
|
||||
|
||||
### 代理接管恢复流程
|
||||
|
||||
代理接管的热切换和供应商同步逻辑经过重构,确保通用配置在整个接管生命周期中得到保护。
|
||||
|
||||
- 接管活跃时,供应商同步更新恢复备份而非直接写入 live 配置文件
|
||||
- 保存恢复快照前先应用通用配置,使回滚能还原真实的用户配置
|
||||
- 遗留供应商中推断使用了通用配置的条目自动标记 `commonConfigEnabled=true`
|
||||
|
||||
### Codex TOML 编辑引擎
|
||||
|
||||
将 Codex `config.toml` 的更新逻辑重构到共享的 Section 感知 TOML 辅助函数上。
|
||||
|
||||
- Rust 端新增 `codex_config.rs` 模块,包含 `update_codex_toml_field` 和 `remove_codex_toml_base_url_if`
|
||||
- 前端新增 `getTomlSectionRange` / `getCodexProviderSectionName` 等 Section 感知工具函数
|
||||
- `proxy.rs` 中散落的 TOML 内联编辑逻辑统一委托给新模块
|
||||
|
||||
### 通用配置初始化生命周期
|
||||
|
||||
启动流程重新排序,通用配置 Snippet 的提取和迁移逻辑更加健壮。
|
||||
|
||||
- 启动时先从干净的 live 文件自动提取通用配置 Snippet,再恢复代理接管状态
|
||||
- 引入 Snippet `cleared` 标志,追踪用户是否主动清除了某个 Snippet
|
||||
- 持久化一次性遗留迁移标志,避免重复执行旧版 `commonConfigEnabled` 回填
|
||||
|
||||
---
|
||||
|
||||
## Bug 修复
|
||||
|
||||
### 通用配置丢失
|
||||
|
||||
- 修复代理接管期间通用配置可能被丢弃的多种场景:同步覆盖 live 文件、热切换产生不完整的恢复快照、供应商切换丢失配置变更
|
||||
|
||||
### Codex 恢复快照保护
|
||||
|
||||
- 修复 Codex 接管恢复备份在供应商热切换时丢弃已有 `mcp_servers` 配置块的问题;将 MCP 备份保留策略从整表替换改为按 server id 合并,供应商/通用配置的 MCP 定义在冲突时优先,备份中独有的服务器仍被保留
|
||||
|
||||
### 已清除 Snippet 复活
|
||||
|
||||
- 修复启动时自动提取机制重新创建用户已主动清除的通用配置 Snippet 的问题
|
||||
|
||||
### Codex `base_url` 位置错误
|
||||
|
||||
- 修复 Codex `base_url` 提取和编辑未定位到正确的 `[model_providers.<name>]` Section,导致追加到文件末尾或误将 `mcp_servers.*.base_url` 识别为供应商端点的问题
|
||||
|
||||
---
|
||||
|
||||
## 下载与安装
|
||||
|
||||
访问 [Releases](https://github.com/farion1231/cc-switch/releases/latest) 下载对应版本。
|
||||
|
||||
### 系统要求
|
||||
|
||||
| 系统 | 最低版本 | 架构 |
|
||||
| ------- | ----------------------------- | ----------------------------------- |
|
||||
| Windows | Windows 10 及以上 | x64 |
|
||||
| macOS | macOS 10.15 (Catalina) 及以上 | Intel (x64) / Apple Silicon (arm64) |
|
||||
| Linux | 见下表 | x64 |
|
||||
|
||||
### Windows
|
||||
|
||||
| 文件 | 说明 |
|
||||
| ------------------------------------------ | ----------------------------------- |
|
||||
| `CC-Switch-v3.12.2-Windows.msi` | **推荐** - MSI 安装包,支持自动更新 |
|
||||
| `CC-Switch-v3.12.2-Windows-Portable.zip` | 便携版,解压即用,不写入注册表 |
|
||||
|
||||
### macOS
|
||||
|
||||
| 文件 | 说明 |
|
||||
| ---------------------------------- | --------------------------------------------------------- |
|
||||
| `CC-Switch-v3.12.2-macOS.zip` | **推荐** - 解压后拖入 Applications 即可,Universal Binary |
|
||||
| `CC-Switch-v3.12.2-macOS.tar.gz` | 用于 Homebrew 安装和自动更新 |
|
||||
|
||||
> **注意**:由于作者没有苹果开发者账号,首次打开可能出现"未知开发者"警告,请先关闭,然后前往"系统设置" → "隐私与安全性" → 点击"仍要打开",之后便可以正常打开
|
||||
|
||||
### Homebrew(macOS)
|
||||
|
||||
```bash
|
||||
brew tap farion1231/ccswitch
|
||||
brew install --cask cc-switch
|
||||
```
|
||||
|
||||
更新:
|
||||
|
||||
```bash
|
||||
brew upgrade --cask cc-switch
|
||||
```
|
||||
|
||||
### Linux
|
||||
|
||||
| 发行版 | 推荐格式 | 安装方式 |
|
||||
| --------------------------------------- | ----------- | ---------------------------------------------------------------------- |
|
||||
| Ubuntu / Debian / Linux Mint / Pop!\_OS | `.deb` | `sudo dpkg -i CC-Switch-*.deb` 或 `sudo apt install ./CC-Switch-*.deb` |
|
||||
| Fedora / RHEL / CentOS / Rocky Linux | `.rpm` | `sudo rpm -i CC-Switch-*.rpm` 或 `sudo dnf install ./CC-Switch-*.rpm` |
|
||||
| openSUSE | `.rpm` | `sudo zypper install ./CC-Switch-*.rpm` |
|
||||
| Arch Linux / Manjaro | `.AppImage` | 添加执行权限后直接运行,或使用 AUR |
|
||||
| 其他发行版 / 不确定 | `.AppImage` | `chmod +x CC-Switch-*.AppImage && ./CC-Switch-*.AppImage` |
|
||||
@@ -1,313 +0,0 @@
|
||||
# CC Switch v3.12.3
|
||||
|
||||
> GitHub Copilot Reverse Proxy, macOS Code Signing & Notarization, Reasoning Effort Mapping, OpenCode SQLite Backend
|
||||
|
||||
**[中文版 →](v3.12.3-zh.md) | [日本語版 →](v3.12.3-ja.md)**
|
||||
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
CC Switch v3.12.3 is a major feature release that adds GitHub Copilot reverse proxy support with a dedicated Auth Center, introduces macOS code signing and Apple notarization for a seamless install experience, maps reasoning effort levels across providers, migrates OpenCode to a SQLite backend, enables Tool Search via the native `ENABLE_TOOL_SEARCH` environment variable toggle, and delivers a full skill backup/restore lifecycle. Additional improvements include proxy gzip compression, o-series model compatibility, Skills import rework, Ghostty terminal fix, Skills cache strategy optimization, Claude 4.6 context window update, and multiple bug fixes.
|
||||
|
||||
**Release Date**: 2026-03-24
|
||||
|
||||
**Update Scale**: 36 commits | 107 files changed | +9,124 / -802 lines
|
||||
|
||||
---
|
||||
|
||||
## Highlights
|
||||
|
||||
- **GitHub Copilot reverse proxy**: Full Copilot proxy support with OAuth device flow authentication, token refresh, and request fingerprint emulation ([⚠️ Risk Notice](#️-risk-notice))
|
||||
- **Copilot Auth Center**: Dedicated authentication management UI for GitHub Copilot OAuth flow with token status display and one-click refresh
|
||||
- **macOS code signing & notarization**: macOS builds are now code-signed and notarized by Apple, eliminating the "unidentified developer" warning entirely
|
||||
- **Reasoning Effort mapping**: Proxy-layer auto-mapping — explicit `output_config.effort` takes priority, falling back to `budget_tokens` thresholds (<4 000→low, 4 000–16 000→medium, ≥16 000→high) for o-series and GPT-5+ models
|
||||
- **OpenCode SQLite backend**: Added SQLite session storage for OpenCode alongside existing JSON backend; dual-backend scan with SQLite priority on ID conflicts
|
||||
- **Codex 1M context window toggle**: One-click checkbox to set `model_context_window = 1000000` with auto-populated `model_auto_compact_token_limit`
|
||||
- **Disable Auto-Upgrade toggle**: Added `DISABLE_AUTOUPDATER` env var checkbox in the Claude Common Config editor to prevent Claude Code from auto-upgrading
|
||||
- **Tool Search env var toggle**: Tool Search enabled via Claude 2.1.76+ native `ENABLE_TOOL_SEARCH` environment variable in the Common Config editor — no binary patching required
|
||||
- **Skill backup/restore lifecycle**: Skills are automatically backed up before uninstall; backup list with restore and delete management added
|
||||
- **Proxy gzip compression**: Non-streaming proxy requests now auto-negotiate gzip compression, reducing bandwidth usage
|
||||
- **o-series model compatibility**: Chat Completions proxy correctly uses `max_completion_tokens` for o1/o3/o4-mini models; Responses API kept on the correct `max_output_tokens` field
|
||||
- **Skills import rework**: Replaced implicit filesystem-based app inference with explicit `ImportSkillSelection` to prevent incorrect multi-app activation
|
||||
- **Ghostty terminal support**: Fixed Claude session restore in Ghostty terminal
|
||||
|
||||
---
|
||||
|
||||
## New Features
|
||||
|
||||
### GitHub Copilot Reverse Proxy
|
||||
|
||||
Added full reverse proxy support for GitHub Copilot, enabling Copilot-authenticated requests to be forwarded through CC Switch.
|
||||
|
||||
- Implements OAuth device flow authentication for GitHub Copilot
|
||||
- Automatic token refresh and session management
|
||||
- Request fingerprint emulation for seamless compatibility
|
||||
- Integrated into the existing proxy infrastructure alongside Claude, Codex, and Gemini handlers
|
||||
|
||||
### Copilot Auth Center
|
||||
|
||||
A dedicated authentication management UI for GitHub Copilot.
|
||||
|
||||
- OAuth device flow with code display and browser-based authorization
|
||||
- Token status display showing expiration and validity
|
||||
- One-click token refresh without re-authentication
|
||||
- Integrated into the settings panel for easy access
|
||||
|
||||
### Reasoning Effort Mapping
|
||||
|
||||
Proxy-layer auto-mapping of reasoning effort for OpenAI o-series and GPT-5+ models.
|
||||
|
||||
- Two-tier resolution: explicit `output_config.effort` takes priority, falling back to thinking `budget_tokens` thresholds (<4 000→low, 4 000–16 000→medium, ≥16 000→high)
|
||||
- Covers both Chat Completions and Responses API paths with 17 unit tests
|
||||
|
||||
### OpenCode SQLite Backend
|
||||
|
||||
Added SQLite session storage support for OpenCode alongside the existing JSON backend.
|
||||
|
||||
- Dual-backend scan with SQLite priority on ID conflicts
|
||||
- Atomic session deletion and path validation
|
||||
- JSON backend remains functional for backwards compatibility
|
||||
|
||||
### Codex 1M Context Window Toggle
|
||||
|
||||
Added a one-click toggle for Codex 1M context window in the config editor.
|
||||
|
||||
- Checkbox sets `model_context_window = 1000000` in `config.toml`
|
||||
- Auto-populates `model_auto_compact_token_limit = 900000` when enabled
|
||||
- Unchecking removes both fields cleanly
|
||||
|
||||
### Disable Auto-Upgrade Toggle
|
||||
|
||||
Added a checkbox in the Claude Common Config editor to disable Claude Code auto-upgrades.
|
||||
|
||||
- Sets `DISABLE_AUTOUPDATER=1` in the environment configuration when enabled
|
||||
- Displayed alongside Teammates mode, Tool Search, and High Effort toggles
|
||||
|
||||
### Tool Search Environment Variable Toggle
|
||||
|
||||
Tool Search is now enabled via the native `ENABLE_TOOL_SEARCH` environment variable introduced in Claude 2.1.76+.
|
||||
|
||||
- Toggle available in the Common Config editor under environment variables
|
||||
- Sets `ENABLE_TOOL_SEARCH=1` in the Claude environment configuration
|
||||
- No binary patching required — uses Claude's built-in support
|
||||
|
||||
### macOS Code Signing & Notarization
|
||||
|
||||
macOS builds are now code-signed and notarized by Apple.
|
||||
|
||||
- Application signed with a valid Apple Developer certificate
|
||||
- Notarized through Apple's notarization service for Gatekeeper approval
|
||||
- DMG installer also signed and notarized
|
||||
- Eliminates the "unidentified developer" warning on first launch
|
||||
|
||||
### Skill Auto-Backup on Uninstall
|
||||
|
||||
Skill files are now automatically backed up before uninstall to prevent accidental data loss.
|
||||
|
||||
- Backups stored in `~/.cc-switch/skill-backups/` with all skill files and a `meta.json` containing original metadata
|
||||
- Old backups are automatically pruned to keep at most 20
|
||||
- Backup path is returned to the frontend and shown in the success toast
|
||||
|
||||
### Skill Backup Restore & Delete
|
||||
|
||||
Added management commands for skill backups created during uninstall.
|
||||
|
||||
- List all available skill backups with metadata
|
||||
- Restore copies files back to SSOT, saves the DB record, and syncs to the current app with rollback on failure
|
||||
- Delete removes the backup directory after a confirmation dialog
|
||||
- ConfirmDialog gains a configurable zIndex prop to support nested dialog stacking
|
||||
|
||||
---
|
||||
|
||||
## Changes
|
||||
|
||||
### Skills Cache Strategy Optimization
|
||||
|
||||
Optimized the Skills cache invalidation strategy for better performance.
|
||||
|
||||
- Reduced unnecessary cache refreshes during skill operations
|
||||
- Improved cache coherence between skill install/uninstall and list queries
|
||||
|
||||
### Claude 4.6 Context Window Update
|
||||
|
||||
Updated Claude 4.6 model preset with the latest context window size.
|
||||
|
||||
- Reflects the expanded context window for Claude 4.6 models
|
||||
- Updated in provider presets for accurate model information display
|
||||
|
||||
### MiniMax M2.7 Upgrade
|
||||
|
||||
- Updated MiniMax provider preset to M2.7 model variant
|
||||
|
||||
### Xiaomi MiMo Upgrade
|
||||
|
||||
- Updated Xiaomi MiMo provider preset to the latest model version
|
||||
|
||||
### AddProviderDialog Simplification
|
||||
|
||||
- Removed redundant OAuth tab, reducing dialog from 3 tabs to 2 (app-specific + universal)
|
||||
|
||||
### Provider Form Advanced Options Collapse
|
||||
|
||||
- Model mapping, API format, and other advanced fields in the Claude provider form now auto-collapse when empty
|
||||
- Auto-expands when any value is set or when a preset fills them in; does not auto-collapse when manually cleared
|
||||
|
||||
### Proxy Gzip Compression
|
||||
|
||||
Non-streaming proxy requests now support gzip compression for reduced bandwidth usage.
|
||||
|
||||
- Non-streaming requests let reqwest auto-negotiate gzip and transparently decompress responses
|
||||
- Streaming requests conservatively keep `Accept-Encoding: identity` to avoid decompression errors on interrupted SSE streams
|
||||
|
||||
### o1/o3 Model Compatibility
|
||||
|
||||
Proxy forwarding now handles OpenAI o-series model token parameters correctly.
|
||||
|
||||
- Chat Completions path uses `max_completion_tokens` instead of `max_tokens` for o1/o3/o4-mini models (#1451, thanks @Hemilt0n)
|
||||
- Responses API path kept on the correct `max_output_tokens` field instead of incorrectly injecting `max_completion_tokens`
|
||||
|
||||
### OpenCode Model Variants
|
||||
|
||||
- Placed OpenCode model variants at top level instead of inside options for better discoverability (#1317)
|
||||
|
||||
### Skills Import Flow
|
||||
|
||||
The Skills import flow has been reworked for correctness and cleanup.
|
||||
|
||||
- Replaced implicit filesystem-based app inference with explicit `ImportSkillSelection` to prevent incorrect multi-app activation when the same skill directory exists under multiple app paths
|
||||
- Added reconciliation to `sync_to_app` to remove disabled/orphaned symlinks
|
||||
- MCP `sync_all_enabled` now removes disabled servers from live config
|
||||
- Schema migration preserves a snapshot of legacy app mappings to avoid lossy reconstruction
|
||||
|
||||
---
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
### WebDAV Password Clearing
|
||||
|
||||
- Fixed an issue where the WebDAV password was silently cleared when saving unrelated settings
|
||||
|
||||
### Tool Message Parsing
|
||||
|
||||
- Fixed incorrect parsing of tool-use messages in certain proxy response formats
|
||||
|
||||
### Dark Mode Styling
|
||||
|
||||
- Fixed dark mode rendering inconsistencies in UI components
|
||||
|
||||
### Copilot Request Fingerprint
|
||||
|
||||
- Fixed request fingerprint generation for Copilot proxy to match expected format
|
||||
|
||||
### Provider Form Double Submit
|
||||
|
||||
- Prevented duplicate submissions on rapid button clicks in provider add/edit forms (#1352, thanks @Hexi1997)
|
||||
|
||||
### Ghostty Session Restore
|
||||
|
||||
- Fixed Claude session restore in Ghostty terminal (#1506, thanks @canyonsehun)
|
||||
|
||||
### Skill ZIP Import Extension
|
||||
|
||||
- Added `.skill` file extension support in ZIP import dialog (#1240, #1455, thanks @yovinchen)
|
||||
|
||||
### Skill ZIP Install Target App
|
||||
|
||||
- ZIP skill installs now use the currently active app instead of always defaulting to Claude
|
||||
|
||||
### OpenClaw Active Card Highlight
|
||||
|
||||
- Fixed active OpenClaw provider card not being highlighted (#1419, thanks @funnytime75)
|
||||
|
||||
### Responsive Layout with TOC
|
||||
|
||||
- Improved responsive design when TOC title exists (#1491, thanks @West-Pavilion)
|
||||
|
||||
### Import Skills Dialog White Screen
|
||||
|
||||
- Added missing TooltipProvider in ImportSkillsDialog to prevent runtime crash when opening the dialog
|
||||
|
||||
### Panel Bottom Blank Area
|
||||
|
||||
- Replaced hardcoded `h-[calc(100vh-8rem)]` with `flex-1 min-h-0` across all content panels to eliminate bottom gap caused by mismatched offset values on different platforms
|
||||
|
||||
---
|
||||
|
||||
## Documentation
|
||||
|
||||
### Pricing Model ID Normalization
|
||||
|
||||
- Added documentation section explaining model ID normalization rules (prefix stripping, suffix trimming, `@`→`-` replacement) in EN/ZH/JA user manuals (#1591, thanks @makoMakoGo)
|
||||
|
||||
### macOS Signed Build Messaging
|
||||
|
||||
- Removed all `xattr` workaround instructions and "unidentified developer" warnings from README, README_ZH, installation guides (EN/ZH/JA), and FAQ pages (EN/ZH/JA); replaced with "signed and notarized by Apple" messaging
|
||||
|
||||
---
|
||||
|
||||
## ⚠️ Risk Notice
|
||||
|
||||
**GitHub Copilot Reverse Proxy Disclaimer**
|
||||
|
||||
The Copilot reverse proxy feature introduced in this release accesses GitHub Copilot services through reverse-engineered, unofficial APIs. Please be aware of the following risks before enabling this feature:
|
||||
|
||||
1. **Terms of Service**: This feature may violate [GitHub's Acceptable Use Policies](https://docs.github.com/en/site-policy/acceptable-use-policies/github-acceptable-use-policies) and [Terms for Additional Products and Features](https://docs.github.com/en/site-policy/github-terms/github-terms-for-additional-products-and-features), which prohibit excessive automated bulk activity, unauthorized service reproduction, and placing undue burden on servers through automated means.
|
||||
2. **Account Risk**: There are documented cases of GitHub issuing warning emails to users of similar tools, citing "scripted interactions or otherwise deliberately unusual or strenuous" usage patterns. Continued use after a warning may result in temporary or permanent suspension of Copilot access.
|
||||
3. **No Guarantee**: GitHub may update its detection mechanisms at any time, and usage patterns that work today may be flagged in the future.
|
||||
|
||||
Users enable this feature **at their own risk**. CC Switch is not responsible for any account restrictions, warnings, or service suspensions resulting from the use of this feature.
|
||||
|
||||
---
|
||||
|
||||
## Download & Installation
|
||||
|
||||
Visit [Releases](https://github.com/farion1231/cc-switch/releases/latest) to download the appropriate version.
|
||||
|
||||
### System Requirements
|
||||
|
||||
| System | Minimum Version | Architecture |
|
||||
| ------- | ------------------------------- | ----------------------------------- |
|
||||
| Windows | Windows 10 or later | x64 |
|
||||
| macOS | macOS 12 (Monterey) or later | Intel (x64) / Apple Silicon (arm64) |
|
||||
| Linux | See table below | x64 |
|
||||
|
||||
### Windows
|
||||
|
||||
| File | Description |
|
||||
| ------------------------------------------ | ---------------------------------------------------- |
|
||||
| `CC-Switch-v3.12.3-Windows.msi` | **Recommended** - MSI installer with auto-update |
|
||||
| `CC-Switch-v3.12.3-Windows-Portable.zip` | Portable version, extract and run, no registry write |
|
||||
|
||||
### macOS
|
||||
|
||||
| File | Description |
|
||||
| ---------------------------------- | -------------------------------------------------------------------- |
|
||||
| `CC-Switch-v3.12.3-macOS.dmg` | **Recommended** - DMG installer, drag to Applications, Universal Binary |
|
||||
| `CC-Switch-v3.12.3-macOS.zip` | ZIP archive, extract and drag to Applications, Universal Binary |
|
||||
| `CC-Switch-v3.12.3-macOS.tar.gz` | For Homebrew installation and auto-update |
|
||||
|
||||
> macOS builds are code-signed and notarized by Apple for a seamless install experience.
|
||||
|
||||
### Homebrew (macOS)
|
||||
|
||||
```bash
|
||||
brew tap farion1231/ccswitch
|
||||
brew install --cask cc-switch
|
||||
```
|
||||
|
||||
Update:
|
||||
|
||||
```bash
|
||||
brew upgrade --cask cc-switch
|
||||
```
|
||||
|
||||
### Linux
|
||||
|
||||
| Distribution | Recommended Format | Installation Method |
|
||||
| --------------------------------------- | ------------------ | ---------------------------------------------------------------------- |
|
||||
| Ubuntu / Debian / Linux Mint / Pop!\_OS | `.deb` | `sudo dpkg -i CC-Switch-*.deb` or `sudo apt install ./CC-Switch-*.deb` |
|
||||
| Fedora / RHEL / CentOS / Rocky Linux | `.rpm` | `sudo rpm -i CC-Switch-*.rpm` or `sudo dnf install ./CC-Switch-*.rpm` |
|
||||
| openSUSE | `.rpm` | `sudo zypper install ./CC-Switch-*.rpm` |
|
||||
| Arch Linux / Manjaro | `.AppImage` | Add execute permission and run directly, or use AUR |
|
||||
| Other distributions / Unsure | `.AppImage` | `chmod +x CC-Switch-*.AppImage && ./CC-Switch-*.AppImage` |
|
||||
@@ -1,313 +0,0 @@
|
||||
# CC Switch v3.12.3
|
||||
|
||||
> GitHub Copilot リバースプロキシ、macOS コード署名と公証、Reasoning Effort マッピング、Tool Search 環境変数トグル、Skill バックアップ/リストア、OpenCode SQLite バックエンド
|
||||
|
||||
**[中文版 →](v3.12.3-zh.md) | [English →](v3.12.3-en.md)**
|
||||
|
||||
---
|
||||
|
||||
## 概要
|
||||
|
||||
CC Switch v3.12.3 は、GitHub Copilot リバースプロキシと Copilot Auth Center を追加し、Copilot トークンを使用した Claude/OpenAI API へのアクセスを実現しました。macOS ビルドに Apple コード署名と公証を導入し、「開発元を確認できません」の警告を解消しました。Reasoning Effort マッピングにより、Claude の thinking budget を OpenAI 互換の reasoning_effort パラメータに自動変換します。Tool Search は従来のバイナリパッチ方式から Claude 2.1.76+ ネイティブの `ENABLE_TOOL_SEARCH` 環境変数トグルに移行し、共通設定エディタから切り替え可能になりました。OpenCode バックエンドを JSON から SQLite に移行し、Skill バックアップ/リストアライフサイクル、プロキシ gzip 圧縮、o シリーズモデル互換性の改善も含まれます。
|
||||
|
||||
**リリース日**: 2026-03-24
|
||||
|
||||
**更新規模**: 36 commits | 107 files changed | +9,124 / -802 lines
|
||||
|
||||
---
|
||||
|
||||
## ハイライト
|
||||
|
||||
- **GitHub Copilot リバースプロキシ**: Copilot トークンを使用して Claude/OpenAI API にアクセスするリバースプロキシを追加。Copilot Auth Center でトークンの取得と管理が可能([⚠️ リスクに関する注意事項](#️-リスクに関する注意事項))
|
||||
- **macOS コード署名と公証**: macOS ビルドが Apple のコード署名と公証に対応し、初回起動時の警告なしでインストール可能に。DMG インストーラーを新たに提供
|
||||
- **Reasoning Effort マッピング**: プロキシ層での自動マッピング — 明示的な `output_config.effort` を優先し、`budget_tokens` 閾値(<4000→low, 4000–16000→medium, ≥16000→high)にフォールバック。o シリーズおよび GPT-5+ モデルに対応
|
||||
- **Tool Search 環境変数トグル**: バイナリパッチ方式を廃止し、Claude 2.1.76+ ネイティブの `ENABLE_TOOL_SEARCH` 環境変数による切り替えに移行。共通設定エディタから設定可能
|
||||
- **Skill バックアップ/リストアライフサイクル**: アンインストール前に Skill ファイルを自動バックアップ。バックアップリスト、リストア、削除の管理機能を追加
|
||||
- **OpenCode SQLite バックエンド**: OpenCode に SQLite セッションストレージを追加(既存の JSON バックエンドと併存)。ID 競合時は SQLite を優先するデュアルバックエンドスキャン
|
||||
- **Codex 1M コンテキストウィンドウトグル**: 設定エディタでワンクリックで `model_context_window = 1000000` を設定可能。`model_auto_compact_token_limit` も自動設定
|
||||
- **自動アップグレード無効化トグル**: Claude 共通設定エディタに `DISABLE_AUTOUPDATER` 環境変数のチェックボックスを追加し、Claude Code の自動アップグレードを防止
|
||||
- **プロキシ Gzip 圧縮**: 非ストリーミングプロキシリクエストが gzip 圧縮を自動ネゴシエーションし、帯域幅消費を削減
|
||||
- **o シリーズモデル互換性**: Chat Completions プロキシが o1/o3/o4-mini モデルに `max_completion_tokens` を正しく使用。Responses API は正しい `max_output_tokens` フィールドを維持
|
||||
- **Skills インポートの刷新**: ファイルシステムベースの暗黙的なアプリ推論を明示的な `ImportSkillSelection` に置き換え、複数アプリの誤った有効化を防止
|
||||
- **Ghostty ターミナルサポート**: Ghostty ターミナルでの Claude セッション復元を修正
|
||||
|
||||
---
|
||||
|
||||
## 新機能
|
||||
|
||||
### GitHub Copilot リバースプロキシ
|
||||
|
||||
GitHub Copilot トークンを使用して Claude API および OpenAI API にアクセスするリバースプロキシ機能を追加しました。
|
||||
|
||||
- Copilot のアクセストークンを利用し、Claude Code や Codex などのクライアントからプロキシ経由で API リクエストを転送
|
||||
- Copilot 固有のリクエストフィンガープリントとヘッダー処理に対応
|
||||
- プロバイダープリセットに Copilot 用テンプレートを追加
|
||||
|
||||
### Copilot Auth Center
|
||||
|
||||
Copilot トークンの取得と管理を行う認証センターを追加しました。
|
||||
|
||||
- GitHub デバイスフローによるトークン取得をサポート
|
||||
- トークンの有効期限管理と自動リフレッシュ
|
||||
- フロントエンドから直接トークンステータスの確認と再認証が可能
|
||||
|
||||
### Reasoning Effort マッピング
|
||||
|
||||
OpenAI o シリーズおよび GPT-5+ モデル向けのプロキシ層自動マッピング機能を追加しました。
|
||||
|
||||
- 二段階の解決ロジック:明示的な `output_config.effort` を優先し、thinking `budget_tokens` 閾値(<4000→low, 4000–16000→medium, ≥16000→high)にフォールバック
|
||||
- Chat Completions と Responses API の両パスをカバー、17 個のユニットテスト付き
|
||||
|
||||
### Tool Search 環境変数トグル
|
||||
|
||||
Claude CLI Tool Search の有効化/無効化を環境変数で制御する設定を追加しました。
|
||||
|
||||
- Claude 2.1.76+ で導入されたネイティブの `ENABLE_TOOL_SEARCH` 環境変数を使用
|
||||
- 共通設定(Common Config)エディタから直接トグル可能
|
||||
- 従来のバイナリパッチ方式は不要になり、CLI アップデート時の再適用も不要
|
||||
|
||||
### Skill アンインストール時の自動バックアップ
|
||||
|
||||
アンインストール前に Skill ファイルを自動バックアップし、意図しないデータ損失を防止します。
|
||||
|
||||
- バックアップは `~/.cc-switch/skill-backups/` に保存され、すべての skill ファイルと元のメタデータを含む `meta.json` が含まれます
|
||||
- 古いバックアップは自動的にプルーニングされ、最大 20 個を保持
|
||||
- バックアップパスはフロントエンドに返され、成功トーストに表示
|
||||
|
||||
### Skill バックアップのリストアと削除
|
||||
|
||||
アンインストール時に作成された Skill バックアップの管理コマンドを追加しました。
|
||||
|
||||
- すべての利用可能な skill バックアップをメタデータ付きで一覧表示
|
||||
- リストアはファイルを SSOT にコピーし、DB レコードを保存し、現在のアプリに同期。失敗時は自動ロールバック
|
||||
- 削除は確認ダイアログの後にバックアップディレクトリを削除
|
||||
- ConfirmDialog にネストされたダイアログスタッキングをサポートする設定可能な zIndex プロパティを追加
|
||||
|
||||
### OpenCode SQLite バックエンド
|
||||
|
||||
OpenCode に SQLite セッションストレージサポートを追加しました(既存の JSON バックエンドと併存)。
|
||||
|
||||
- デュアルバックエンドスキャン、ID 競合時は SQLite を優先
|
||||
- アトミックなセッション削除とパス検証
|
||||
- JSON バックエンドは後方互換性のため引き続き機能
|
||||
|
||||
### Codex 1M コンテキストウィンドウトグル
|
||||
|
||||
設定エディタに Codex 1M コンテキストウィンドウのワンクリックトグルを追加しました。
|
||||
|
||||
- チェックボックスで `config.toml` に `model_context_window = 1000000` を設定
|
||||
- 有効化時に `model_auto_compact_token_limit = 900000` を自動設定
|
||||
- 無効化時は両フィールドをクリーンに削除
|
||||
|
||||
### 自動アップグレード無効化トグル
|
||||
|
||||
Claude 共通設定エディタに自動アップグレードを無効化するチェックボックスを追加しました。
|
||||
|
||||
- 有効化時に `DISABLE_AUTOUPDATER=1` 環境変数を設定し、Claude Code の自動アップグレードを防止
|
||||
- Teammates モード、Tool Search、高強度思考トグルと同じ行に表示
|
||||
|
||||
### macOS コード署名と公証
|
||||
|
||||
macOS ビルドに Apple のコード署名と公証を導入しました。
|
||||
|
||||
- Apple Developer ID による署名と Apple 公証サービスによる公証を実施
|
||||
- 初回起動時の「開発元を確認できません」警告が不要に
|
||||
- DMG インストーラーを新たに提供し、ドラッグ&ドロップでのインストールに対応
|
||||
- CI/CD パイプラインに署名・公証ステップを統合
|
||||
|
||||
---
|
||||
|
||||
## 変更
|
||||
|
||||
### Skills キャッシュ戦略の最適化
|
||||
|
||||
Skills のキャッシュ戦略を最適化し、パフォーマンスと信頼性を向上しました。
|
||||
|
||||
- キャッシュの有効期限管理とインバリデーション戦略を改善
|
||||
- 不要なキャッシュ再構築を削減し、起動時間を短縮
|
||||
|
||||
### Claude 4.6 コンテキストウィンドウ更新
|
||||
|
||||
Claude 4.6 モデルのコンテキストウィンドウサイズを更新しました。
|
||||
|
||||
- Claude 4.6 の最新コンテキストウィンドウサイズをプリセットに反映
|
||||
|
||||
### MiniMax M2.7 アップグレード
|
||||
|
||||
MiniMax モデルプリセットを M2.7 にアップグレードしました。
|
||||
|
||||
- MiniMax プロバイダープリセットのモデル ID とパラメータを M2.7 に更新
|
||||
|
||||
### Xiaomi MiMo アップグレード
|
||||
|
||||
Xiaomi MiMo モデルプリセットをアップグレードしました。
|
||||
|
||||
- MiMo プロバイダープリセットのモデル ID とパラメータを最新版に更新
|
||||
|
||||
### AddProviderDialog の簡素化
|
||||
|
||||
- 冗長な OAuth タブを削除し、ダイアログを 3 タブから 2 タブ(アプリ固有 + ユニバーサル)に簡素化
|
||||
|
||||
### プロバイダーフォームの高度なオプション折りたたみ
|
||||
|
||||
- Claude プロバイダーフォームのモデルマッピング、API フォーマットなどの高度なフィールドが未入力時にデフォルトで折りたたまれるように変更
|
||||
- プリセットが値を入力すると自動展開。手動クリア時は自動折りたたみしない
|
||||
|
||||
### プロキシ Gzip 圧縮
|
||||
|
||||
非ストリーミングプロキシリクエストが gzip 圧縮をサポートし、帯域幅消費を削減しました。
|
||||
|
||||
- 非ストリーミングリクエストは reqwest が gzip を自動ネゴシエーションし、レスポンスを透過的に解凍
|
||||
- ストリーミングリクエストは中断された SSE ストリームの解凍エラーを避けるため、保守的に `Accept-Encoding: identity` を維持
|
||||
|
||||
### o1/o3 モデル互換性
|
||||
|
||||
プロキシ転送が OpenAI o シリーズモデルのトークンパラメータを正しく処理するようになりました。
|
||||
|
||||
- Chat Completions パスが o1/o3/o4-mini モデルに `max_tokens` の代わりに `max_completion_tokens` を使用 (#1451、@Hemilt0n に感謝)
|
||||
- Responses API パスが正しい `max_output_tokens` フィールドを維持し、`max_completion_tokens` の誤った注入を防止
|
||||
|
||||
### OpenCode モデルバリアント
|
||||
|
||||
- OpenCode のモデルバリアントを options 内部ではなくプリセットのトップレベルに配置し、発見しやすさを向上 (#1317)
|
||||
|
||||
### Skills インポートフロー
|
||||
|
||||
Skills インポートフローが正確性とクリーンアップのためにリワークされました。
|
||||
|
||||
- ファイルシステムベースの暗黙的なアプリ推論を明示的な `ImportSkillSelection` に置き換え、同じ skill ディレクトリが複数アプリパスに存在する場合の複数アプリ誤有効化を防止
|
||||
- `sync_to_app` に調整ロジックを追加し、無効化/孤立したシンボリックリンクを削除
|
||||
- MCP `sync_all_enabled` がライブ設定から無効化されたサーバーを削除するように改善
|
||||
- スキーママイグレーションがレガシーアプリマッピングのスナップショットを保持し、損失のある再構築を回避
|
||||
|
||||
---
|
||||
|
||||
## バグ修正
|
||||
|
||||
### WebDAV パスワードの消失
|
||||
|
||||
- 無関係な設定保存時に WebDAV パスワードがサイレントにクリアされる問題を修正
|
||||
|
||||
### ツールメッセージのパース
|
||||
|
||||
- プロキシのツールメッセージパース処理の不具合を修正し、特定のツール呼び出しパターンでのエラーを解消
|
||||
|
||||
### ダークモードの表示
|
||||
|
||||
- ダークモードでの一部 UI コンポーネントの表示不具合を修正
|
||||
|
||||
### Copilot リクエストフィンガープリント
|
||||
|
||||
- Copilot リバースプロキシのリクエストフィンガープリント生成の不具合を修正し、認証エラーを解消
|
||||
|
||||
### プロバイダーフォームの二重送信
|
||||
|
||||
- プロバイダー追加/編集フォームでの高速連続クリックによる重複送信を防止 (#1352、@Hexi1997 に感謝)
|
||||
|
||||
### Ghostty ターミナルセッション復元
|
||||
|
||||
- Ghostty ターミナルでの Claude セッション復元の失敗を修正 (#1506、@canyonsehun に感謝)
|
||||
|
||||
### Skill ZIP インポート拡張子
|
||||
|
||||
- ZIP インポートダイアログが `.skill` ファイル拡張子をサポートするように修正 (#1240, #1455、@yovinchen に感謝)
|
||||
|
||||
### Skill ZIP インストール対象アプリ
|
||||
|
||||
- ZIP 方式でインストールされた skill が常に Claude をデフォルトにするのではなく、現在アクティブなアプリを使用するように修正
|
||||
|
||||
### OpenClaw アクティブカードのハイライト
|
||||
|
||||
- OpenClaw の現在アクティブなプロバイダーカードがハイライト表示されない問題を修正 (#1419、@funnytime75 に感謝)
|
||||
|
||||
### TOC 付きレスポンシブレイアウト
|
||||
|
||||
- TOC タイトルが存在する場合のレスポンシブデザインを改善 (#1491、@West-Pavilion に感謝)
|
||||
|
||||
### Skills インポートダイアログの白い画面
|
||||
|
||||
- ImportSkillsDialog に不足していた TooltipProvider を追加し、ダイアログを開く際のランタイムクラッシュを防止
|
||||
|
||||
### パネル下部の空白エリア
|
||||
|
||||
- すべてのコンテンツパネルのハードコードされた `h-[calc(100vh-8rem)]` を `flex-1 min-h-0` に置き換え、異なるプラットフォーム間のオフセット値の不一致による下部のギャップを解消
|
||||
|
||||
---
|
||||
|
||||
## ドキュメント
|
||||
|
||||
### 料金モデル ID の正規化
|
||||
|
||||
- 中英日三言語のユーザーマニュアルにモデル ID 正規化ルール(プレフィックス除去、サフィックストリミング、`@`→`-` 置換)の説明セクションを追加 (#1591、@makoMakoGo に感謝)
|
||||
|
||||
### macOS 署名済みメッセージの更新
|
||||
|
||||
- README、README_ZH、インストールガイド(EN/ZH/JA)、FAQ ページ(EN/ZH/JA)からすべての `xattr` 回避策と「開発元を確認できません」警告を削除し、「Apple のコード署名と公証済み」メッセージに置換
|
||||
|
||||
---
|
||||
|
||||
## ⚠️ リスクに関する注意事項
|
||||
|
||||
**GitHub Copilot リバースプロキシに関する免責事項**
|
||||
|
||||
本リリースで追加された Copilot リバースプロキシ機能は、リバースエンジニアリングによる非公式 API を通じて GitHub Copilot サービスにアクセスします。この機能を有効にする前に、以下のリスクをご確認ください:
|
||||
|
||||
1. **利用規約違反の可能性**:この機能は [GitHub 利用規約](https://docs.github.com/en/site-policy/acceptable-use-policies/github-acceptable-use-policies)および[追加製品の利用条件](https://docs.github.com/en/site-policy/github-terms/github-terms-for-additional-products-and-features)に違反する可能性があります。これらの規約では、過度な自動一括操作、サービスの無断複製、自動化手段によるサーバーへの過度な負荷が禁止されています。
|
||||
2. **アカウントリスク**:類似ツールの利用者が GitHub から「スクリプト化されたインタラクション、または意図的に異常もしくは過度な使用」を指摘する警告メールを受け取った事例が報告されています。警告後も使用を継続した場合、Copilot へのアクセスが一時的または永久的に停止される可能性があります。
|
||||
3. **将来の利用保証なし**:GitHub は検出メカニズムをいつでも更新する可能性があり、現在利用可能な使用パターンが将来的にフラグ付けされる可能性があります。
|
||||
|
||||
この機能を有効にすることで、ユーザーは**すべてのリスクを自己責任で負う**ものとします。CC Switch は、この機能の使用に起因するアカウント制限、警告、またはサービス停止について一切の責任を負いません。
|
||||
|
||||
---
|
||||
|
||||
## ダウンロードとインストール
|
||||
|
||||
[Releases](https://github.com/farion1231/cc-switch/releases/latest) から適切なバージョンをダウンロードしてください。
|
||||
|
||||
### システム要件
|
||||
|
||||
| システム | 最小バージョン | アーキテクチャ |
|
||||
| -------- | -------------------------------- | ----------------------------------- |
|
||||
| Windows | Windows 10 以降 | x64 |
|
||||
| macOS | macOS 12 (Monterey) 以降 | Intel (x64) / Apple Silicon (arm64) |
|
||||
| Linux | 下表参照 | x64 |
|
||||
|
||||
### Windows
|
||||
|
||||
| ファイル | 説明 |
|
||||
| ------------------------------------------ | ---------------------------------------------------- |
|
||||
| `CC-Switch-v3.12.3-Windows.msi` | **推奨** - MSI インストーラー、自動更新対応 |
|
||||
| `CC-Switch-v3.12.3-Windows-Portable.zip` | ポータブル版、解凍して実行、レジストリ書き込みなし |
|
||||
|
||||
### macOS
|
||||
|
||||
| ファイル | 説明 |
|
||||
| ---------------------------------- | ----------------------------------------------------------------- |
|
||||
| `CC-Switch-v3.12.3-macOS.dmg` | **推奨** - DMG インストーラー、ドラッグ&ドロップでインストール |
|
||||
| `CC-Switch-v3.12.3-macOS.zip` | 解凍して Applications にドラッグ、Universal Binary |
|
||||
| `CC-Switch-v3.12.3-macOS.tar.gz` | Homebrew インストールと自動更新用 |
|
||||
|
||||
> macOS 版は Apple のコード署名と公証済みで、そのままインストールしてご利用いただけます。
|
||||
|
||||
### Homebrew (macOS)
|
||||
|
||||
```bash
|
||||
brew tap farion1231/ccswitch
|
||||
brew install --cask cc-switch
|
||||
```
|
||||
|
||||
更新:
|
||||
|
||||
```bash
|
||||
brew upgrade --cask cc-switch
|
||||
```
|
||||
|
||||
### Linux
|
||||
|
||||
| ディストリビューション | 推奨形式 | インストール方法 |
|
||||
| --------------------------------------- | ----------- | ---------------------------------------------------------------------- |
|
||||
| Ubuntu / Debian / Linux Mint / Pop!\_OS | `.deb` | `sudo dpkg -i CC-Switch-*.deb` または `sudo apt install ./CC-Switch-*.deb` |
|
||||
| Fedora / RHEL / CentOS / Rocky Linux | `.rpm` | `sudo rpm -i CC-Switch-*.rpm` または `sudo dnf install ./CC-Switch-*.rpm` |
|
||||
| openSUSE | `.rpm` | `sudo zypper install ./CC-Switch-*.rpm` |
|
||||
| Arch Linux / Manjaro | `.AppImage` | 実行権限を追加して直接実行、または AUR を使用 |
|
||||
| その他のディストリビューション / 不明 | `.AppImage` | `chmod +x CC-Switch-*.AppImage && ./CC-Switch-*.AppImage` |
|
||||
@@ -1,296 +0,0 @@
|
||||
# CC Switch v3.12.3
|
||||
|
||||
> GitHub Copilot 反向代理、macOS 代码签名与公证、Reasoning Effort 映射、Tool Search 环境变量开关、Skill 备份/恢复生命周期
|
||||
|
||||
**[English →](v3.12.3-en.md) | [日本語版 →](v3.12.3-ja.md)**
|
||||
|
||||
---
|
||||
|
||||
## 概览
|
||||
|
||||
CC Switch v3.12.3 新增了 **GitHub Copilot 反向代理** 支持和 **Copilot Auth Center** 认证管理,引入了 **Reasoning Effort 映射** 实现跨供应商推理强度控制,通过 Claude 2.1.76+ 原生 `ENABLE_TOOL_SEARCH` 环境变量实现了 **Tool Search 开关**,新增了 **OpenCode SQLite 后端** 支持,并完成了 **macOS 代码签名与 Apple 公证**。同时引入了完整的 Skill 备份/恢复生命周期,改进了代理对 OpenAI o 系列模型的兼容性和 gzip 压缩支持,优化了 Skills 缓存策略,更新了 Claude 4.6 上下文窗口、MiniMax M2.7 和小米 MiMo 模型预设,并修复了 WebDAV 密码、工具消息解析、暗色模式和 Copilot 请求指纹等方面的问题。
|
||||
|
||||
**发布日期**:2026-03-24
|
||||
|
||||
**更新规模**:36 commits | 107 files changed | +9,124 / -802 lines
|
||||
|
||||
---
|
||||
|
||||
## 重点内容
|
||||
|
||||
- **GitHub Copilot 反向代理**:新增 Copilot 反向代理支持,通过 Copilot Auth Center 管理 GitHub Token 认证,实现 Copilot 模型在 Claude Code 中的无缝使用([⚠️ 风险提示](#️-风险提示))
|
||||
- **macOS 代码签名与公证**:macOS 版本已通过 Apple 代码签名和公证,新增 DMG 安装格式,无需再手动绕过"未知开发者"警告
|
||||
- **Reasoning Effort 映射**:代理层自动映射 — 显式 `output_config.effort` 优先,回退到 `budget_tokens` 阈值(<4000→low, 4000–16000→medium, ≥16000→high),支持 o 系列和 GPT-5+ 模型
|
||||
- **Tool Search 环境变量开关**:利用 Claude 2.1.76+ 原生 `ENABLE_TOOL_SEARCH` 环境变量,在通用配置编辑器中一键启用 Tool Search
|
||||
- **Skill 备份/恢复生命周期**:卸载前自动备份 Skill 文件;新增备份列表、恢复和删除管理
|
||||
- **OpenCode SQLite 后端**:为 OpenCode 新增 SQLite 会话存储(与现有 JSON 后端并存),ID 冲突时 SQLite 优先的双后端扫描
|
||||
- **Codex 1M 上下文窗口开关**:配置编辑器中一键设置 `model_context_window = 1000000`,自动填充 `model_auto_compact_token_limit`
|
||||
- **禁用自动升级开关**:通用配置编辑器中新增 `DISABLE_AUTOUPDATER` 环境变量复选框,防止 Claude Code 自动升级
|
||||
- **代理 Gzip 压缩**:非流式代理请求自动协商 gzip 压缩,减少带宽消耗
|
||||
- **o 系列模型兼容性**:Chat Completions 代理正确使用 `max_completion_tokens` 处理 o1/o3/o4-mini 模型
|
||||
- **Skills 导入重构**:将基于文件系统的隐式应用推断替换为显式的 `ImportSkillSelection`,防止多应用错误激活
|
||||
|
||||
---
|
||||
|
||||
## 新功能
|
||||
|
||||
### GitHub Copilot 反向代理
|
||||
|
||||
新增完整的 GitHub Copilot 集成,作为 Claude Code 供应商使用。
|
||||
|
||||
- 通过 OAuth Device Code 流程进行 GitHub 认证
|
||||
- 支持多账号管理和自动 Token 刷新
|
||||
- Anthropic ↔ OpenAI 格式自动转换
|
||||
- 实时获取可用模型列表和用量统计 (#930,感谢 @Mason-mengze)
|
||||
|
||||
### Copilot Auth Center
|
||||
|
||||
在设置中新增认证中心面板,全局管理 GitHub 账号。
|
||||
|
||||
- 支持按供应商绑定账号(通过 `meta.authBinding`)
|
||||
- 统一的 Token 管理和刷新机制
|
||||
|
||||
### Tool Search 开关
|
||||
|
||||
利用 Claude 2.1.76+ 原生 `ENABLE_TOOL_SEARCH` 环境变量控制 Tool Search 功能。
|
||||
|
||||
- 在供应商通用配置编辑器中以复选框形式暴露
|
||||
- 替代了之前的二进制补丁方案,更简洁可靠 (#930,感谢 @Mason-mengze)
|
||||
|
||||
### Reasoning Effort 映射
|
||||
|
||||
新增代理层自动推理强度映射,支持 OpenAI o 系列和 GPT-5+ 模型。
|
||||
|
||||
- 两级解析:显式 `output_config.effort` 优先,回退到 `budget_tokens` 阈值(<4000→low, 4000–16000→medium, ≥16000→high)
|
||||
- 覆盖 Chat Completions 和 Responses API 两条路径,含 17 个单元测试
|
||||
|
||||
### OpenCode SQLite 后端
|
||||
|
||||
为 OpenCode 新增 SQLite 会话存储支持(与现有 JSON 后端并存)。
|
||||
|
||||
- 双后端扫描,ID 冲突时 SQLite 优先
|
||||
- 原子会话删除和路径校验
|
||||
- JSON 后端保持向后兼容
|
||||
|
||||
### Codex 1M 上下文窗口开关
|
||||
|
||||
在配置编辑器中新增 Codex 1M 上下文窗口一键开关。
|
||||
|
||||
- 复选框设置 `config.toml` 中的 `model_context_window = 1000000`
|
||||
- 启用时自动填充 `model_auto_compact_token_limit = 900000`
|
||||
- 关闭时干净移除两个字段
|
||||
|
||||
### 禁用自动升级开关
|
||||
|
||||
在 Claude 通用配置编辑器中新增禁用自动升级的复选框。
|
||||
|
||||
- 勾选后设置 `DISABLE_AUTOUPDATER=1` 环境变量,阻止 Claude Code 自动升级
|
||||
- 与 Teammates 模式、Tool Search、高强度思考等开关同一排显示
|
||||
|
||||
### Skill 卸载自动备份
|
||||
|
||||
卸载 Skill 前自动备份文件,防止数据意外丢失。
|
||||
|
||||
- 备份存储在 `~/.cc-switch/skill-backups/`,包含所有 skill 文件和记录原始元数据的 `meta.json`
|
||||
- 旧备份自动清理,最多保留 20 个
|
||||
- 备份路径返回前端并在成功提示中显示
|
||||
|
||||
### Skill 备份恢复与删除
|
||||
|
||||
新增卸载时创建的 Skill 备份的管理功能。
|
||||
|
||||
- 列出所有可用的 skill 备份及元数据
|
||||
- 恢复操作将文件拷回 SSOT,保存数据库记录,并同步到当前应用,失败时自动回滚
|
||||
- 删除操作在确认对话框后移除备份目录
|
||||
|
||||
### macOS 代码签名与 Apple 公证
|
||||
|
||||
CI 流程新增完整的 macOS 代码签名和 Apple 公证支持。
|
||||
|
||||
- 导入 Apple Developer ID 证书,签名 Universal Binary
|
||||
- 提交 Apple 公证并将票据装订到 `.app` 和 `.dmg`
|
||||
- 硬性验证步骤(`codesign --verify` + `spctl -a` + `stapler validate`)把关发布
|
||||
|
||||
---
|
||||
|
||||
## 变更
|
||||
|
||||
### Skills 缓存策略优化
|
||||
|
||||
- 将 `invalidateQueries` 替换为直接 `setQueryData` 更新,用于 skill 安装/卸载/导入操作
|
||||
- 新增 `staleTime: Infinity` 和 `keepPreviousData`,消除加载闪烁 (#1573,感谢 @TangZhiZzz)
|
||||
|
||||
### 代理 Gzip 压缩
|
||||
|
||||
- 非流式请求允许 reqwest 自动协商 gzip 并透明解压响应
|
||||
- 流式请求保守地保持 `Accept-Encoding: identity`,避免中断的 SSE 流解压出错
|
||||
|
||||
### o1/o3 模型兼容性
|
||||
|
||||
- Chat Completions 路径对 o1/o3/o4-mini 模型使用 `max_completion_tokens` 替代 `max_tokens` (#1451,感谢 @Hemilt0n)
|
||||
- Responses API 路径保持使用正确的 `max_output_tokens` 字段
|
||||
|
||||
### OpenCode 模型变体
|
||||
|
||||
- 将 OpenCode 的模型变体放在预设顶层而非嵌套在 options 内部,提升可发现性 (#1317)
|
||||
|
||||
### Skills 导入流程
|
||||
|
||||
- 将基于文件系统的隐式应用推断替换为显式的 `ImportSkillSelection`,防止同一 skill 目录存在于多个应用路径下时错误激活多个应用
|
||||
- 为 `sync_to_app` 增加协调逻辑,移除已禁用/孤立的符号链接
|
||||
- MCP `sync_all_enabled` 现在会从 live 配置中移除已禁用的服务器
|
||||
|
||||
### Claude 4.6 上下文窗口
|
||||
|
||||
- Claude Opus 4.6 和 Sonnet 4.6 上下文窗口从 200K 更新至 1M(GA 发布)
|
||||
|
||||
### MiniMax 模型升级
|
||||
|
||||
- MiniMax 预设从 M2.5 升级至 M2.7,更新三语合作伙伴描述
|
||||
|
||||
### 小米 MiMo 模型升级
|
||||
|
||||
- MiMo 预设从 mimo-v2-flash 升级至 mimo-v2-pro
|
||||
|
||||
### 添加供应商对话框简化
|
||||
|
||||
- 移除冗余的 OAuth 标签页,对话框从 3 个标签页减少到 2 个(应用专属 + 通用)
|
||||
|
||||
### 供应商表单高级选项折叠
|
||||
|
||||
- Claude 供应商表单中的模型映射、API 格式等高级字段在未填写时默认折叠
|
||||
- 预设填充值后自动展开,手动清空不会自动折叠
|
||||
|
||||
---
|
||||
|
||||
## Bug 修复
|
||||
|
||||
### WebDAV 密码被静默清除
|
||||
|
||||
- 修复 ProviderList 或 UsageScriptModal 保存设置时 WebDAV 密码被静默清除的问题
|
||||
- 前端 payload 中剥离 `webdavSync`,后端 `merge_settings_for_save()` 增加回填逻辑保护现有密码
|
||||
|
||||
### 工具消息解析
|
||||
|
||||
- 修复 Claude(tool_result content blocks)、Codex(function_call/function_call_output payloads)和 Gemini(array content + toolCalls extraction)的 tool_use/tool_result 消息分类 (#1401,感谢 @BlueOcean223)
|
||||
|
||||
### 暗色模式选择器
|
||||
|
||||
- 将 Tailwind `darkMode` 从 `["selector", "class"]` 改为 `["selector", ".dark"]`,确保暗色模式正确激活 (#1596,感谢 @qinxiandiqi)
|
||||
|
||||
### Copilot 请求指纹
|
||||
|
||||
- 统一所有 Copilot API 调用点的请求指纹头,防止 User-Agent 泄漏和 Stream Check 不匹配
|
||||
|
||||
### 供应商表单防重复提交
|
||||
|
||||
- 修复快速连续点击按钮时供应商添加/编辑表单重复提交的问题 (#1352,感谢 @Hexi1997)
|
||||
|
||||
### Ghostty 终端会话恢复
|
||||
|
||||
- 修复在 Ghostty 终端中恢复 Claude 会话失败的问题 (#1506,感谢 @canyonsehun)
|
||||
|
||||
### Skill ZIP 导入扩展名
|
||||
|
||||
- ZIP 导入对话框现在支持 `.skill` 文件扩展名 (#1240, #1455,感谢 @yovinchen)
|
||||
|
||||
### Skill ZIP 安装目标应用
|
||||
|
||||
- ZIP 方式安装的 skill 现在使用当前活跃应用,而非始终默认为 Claude
|
||||
|
||||
### OpenClaw 活跃供应商高亮
|
||||
|
||||
- 修复 OpenClaw 当前激活的供应商卡片未高亮显示的问题 (#1419,感谢 @funnytime75)
|
||||
|
||||
### 响应式布局与 TOC
|
||||
|
||||
- 改善存在 TOC 标题时的响应式布局 (#1491,感谢 @West-Pavilion)
|
||||
|
||||
### Skills 导入对话框白屏
|
||||
|
||||
- 在 ImportSkillsDialog 中补充缺失的 TooltipProvider,修复打开对话框时的运行时崩溃
|
||||
|
||||
### 面板底部空白区域
|
||||
|
||||
- 将所有内容面板的硬编码 `h-[calc(100vh-8rem)]` 替换为 `flex-1 min-h-0`,消除因不同平台偏移量不匹配导致的底部空白
|
||||
|
||||
---
|
||||
|
||||
## 文档
|
||||
|
||||
### 定价模型 ID 归一化
|
||||
|
||||
- 在中英日三语用户手册中新增模型 ID 归一化规则说明(前缀剥离、后缀修剪、`@`→`-` 替换)(#1591,感谢 @makoMakoGo)
|
||||
|
||||
### macOS 签名与公证说明
|
||||
|
||||
- 移除 README、安装指南和 FAQ 中所有 `xattr` 变通方案和"未知开发者"警告
|
||||
- 替换为"已通过 Apple 代码签名和公证"的说明
|
||||
|
||||
---
|
||||
|
||||
## ⚠️ 风险提示
|
||||
|
||||
**GitHub Copilot 反向代理免责声明**
|
||||
|
||||
本版本新增的 Copilot 反向代理功能通过逆向工程的非官方 API 访问 GitHub Copilot 服务。启用此功能前,请注意以下风险:
|
||||
|
||||
1. **违反服务条款**:此功能可能违反 [GitHub 可接受使用政策](https://docs.github.com/en/site-policy/acceptable-use-policies/github-acceptable-use-policies)和[附加产品条款](https://docs.github.com/en/site-policy/github-terms/github-terms-for-additional-products-and-features),其中禁止过度自动化批量活动、未经授权的服务复制以及通过自动化手段对服务器施加不当负担。
|
||||
2. **账号风险**:已有类似工具的用户收到 GitHub 官方警告邮件,指出其存在"脚本化交互或其他刻意的异常或高强度使用"行为。收到警告后继续使用可能导致 Copilot 访问权限被暂停甚至永久封禁。
|
||||
3. **无法保证长期可用**:GitHub 可能随时更新其检测机制,当前可用的使用方式未来可能被标记。
|
||||
|
||||
用户启用此功能即表示**自行承担所有风险**。CC Switch 不对因使用此功能而导致的任何账号限制、警告或服务暂停承担责任。
|
||||
|
||||
---
|
||||
|
||||
## 下载与安装
|
||||
|
||||
访问 [Releases](https://github.com/farion1231/cc-switch/releases/latest) 下载对应版本。
|
||||
|
||||
### 系统要求
|
||||
|
||||
| 系统 | 最低版本 | 架构 |
|
||||
| ------- | ----------------------------- | ----------------------------------- |
|
||||
| Windows | Windows 10 及以上 | x64 |
|
||||
| macOS | macOS 12 (Monterey) 及以上 | Intel (x64) / Apple Silicon (arm64) |
|
||||
| Linux | 见下表 | x64 |
|
||||
|
||||
### Windows
|
||||
|
||||
| 文件 | 说明 |
|
||||
| ------------------------------------------ | ----------------------------------- |
|
||||
| `CC-Switch-v3.12.3-Windows.msi` | **推荐** - MSI 安装包,支持自动更新 |
|
||||
| `CC-Switch-v3.12.3-Windows-Portable.zip` | 便携版,解压即用,不写入注册表 |
|
||||
|
||||
### macOS
|
||||
|
||||
| 文件 | 说明 |
|
||||
| ---------------------------------- | --------------------------------------------------------- |
|
||||
| `CC-Switch-v3.12.3-macOS.dmg` | **推荐** - DMG 安装包,拖入 Applications 即可 |
|
||||
| `CC-Switch-v3.12.3-macOS.zip` | 解压后拖入 Applications,Universal Binary |
|
||||
| `CC-Switch-v3.12.3-macOS.tar.gz` | 用于 Homebrew 安装和自动更新 |
|
||||
|
||||
> macOS 版本已通过 Apple 代码签名和公证,可直接安装使用。
|
||||
|
||||
### Homebrew(macOS)
|
||||
|
||||
```bash
|
||||
brew tap farion1231/ccswitch
|
||||
brew install --cask cc-switch
|
||||
```
|
||||
|
||||
更新:
|
||||
|
||||
```bash
|
||||
brew upgrade --cask cc-switch
|
||||
```
|
||||
|
||||
### Linux
|
||||
|
||||
| 发行版 | 推荐格式 | 安装方式 |
|
||||
| --------------------------------------- | ----------- | ---------------------------------------------------------------------- |
|
||||
| Ubuntu / Debian / Linux Mint / Pop!\_OS | `.deb` | `sudo dpkg -i CC-Switch-*.deb` 或 `sudo apt install ./CC-Switch-*.deb` |
|
||||
| Fedora / RHEL / CentOS / Rocky Linux | `.rpm` | `sudo rpm -i CC-Switch-*.rpm` 或 `sudo dnf install ./CC-Switch-*.rpm` |
|
||||
| openSUSE | `.rpm` | `sudo zypper install ./CC-Switch-*.rpm` |
|
||||
| Arch Linux / Manjaro | `.AppImage` | 添加执行权限后直接运行,或使用 AUR |
|
||||
| 其他发行版 / 不确定 | `.AppImage` | `chmod +x CC-Switch-*.AppImage && ./CC-Switch-*.AppImage` |
|
||||
@@ -1,353 +0,0 @@
|
||||
# CC Switch v3.13.0
|
||||
|
||||
> Lightweight Mode, Quota & Balance Visibility, Provider Model Auto-Fetch, Codex OAuth Reverse Proxy, and Tray Per-App Submenus
|
||||
|
||||
**[中文版 →](v3.13.0-zh.md) | [日本語版 →](v3.13.0-ja.md)**
|
||||
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
CC Switch v3.13.0 is a major feature release centered on observability, provider workflow ergonomics, and proxy compatibility. It adds inline **quota and balance displays** across official Claude / Codex / Gemini providers plus Token Plan, Copilot, and third-party balance APIs; introduces a **Lightweight Mode** that keeps CC Switch running from the system tray without a main window; delivers **automatic model discovery** via OpenAI-compatible `/v1/models` across all five supported applications; ships a **Codex OAuth reverse proxy** for ChatGPT Plus / Pro subscribers; reorganizes the tray menu into **per-app submenus**; rebuilds the proxy forwarding stack on a **Hyper-based client**; and overhauls the **Skills workflow** with discovery, batch updates, and storage-location toggling. Additional improvements include full URL endpoint mode, session-log usage tracking without proxy interception, the Copilot interaction optimizer, a UTF-8 streaming chunk boundary fix for multi-byte output, and a Linux startup UI responsiveness fix.
|
||||
|
||||
**Release Date**: 2026-04-08
|
||||
|
||||
**Update Scale**: 98 commits | 229 files changed | +23,891 / -2,305 lines
|
||||
|
||||
---
|
||||
|
||||
## Highlights
|
||||
|
||||
- **Lightweight Mode**: Tray-only operating mode that destroys the main window on exit to tray and recreates it on demand, reducing CC Switch's desktop footprint to near zero when idle
|
||||
- **Quota & Balance Visibility**: Inline quota or balance readout across provider cards — official Claude / Codex / Gemini subscriptions, GitHub Copilot premium interactions, Codex OAuth, Token Plan providers (Kimi / Zhipu GLM / MiniMax), plus official balance queries for DeepSeek, StepFun, SiliconFlow, OpenRouter, and Novita AI
|
||||
- **Provider Model Auto-Fetch**: OpenAI-compatible `/v1/models` discovery across Claude, Codex, Gemini, OpenCode, and OpenClaw provider forms, with grouped dropdown selection and failure-specific error messages
|
||||
- **Codex OAuth Reverse Proxy**: ChatGPT Plus / Pro Codex reverse proxy exposed as a new Claude provider card with managed OAuth login and inline subscription quota display ([⚠️ Risk Notice](#️-risk-notice))
|
||||
- **Tray Per-App Submenus**: Reworked the tray menu into per-application submenus so it never overflows the screen and background provider switching scales to dozens of providers per app
|
||||
- **Skills Discovery & Batch Updates**: SHA-256-based skill update detection, per-skill and "Update All" batch actions, public `skills.sh` search integration, and a storage-location toggle between CC Switch storage and `~/.agents/skills`
|
||||
- **Session Workflow Upgrades**: Batch session deletion, a directory picker before launching Claude terminal restore, usage import from Claude / Codex / Gemini session logs without proxy interception, precise Codex JSONL parsing, and per-app usage filtering
|
||||
- **OpenCode / OpenClaw Stream Check Coverage**: OpenCode detection via npm package mapping, OpenClaw `openai-completions` support, and the remaining OpenClaw protocol variants — with custom-header passthrough and auth-header detection fixes
|
||||
- **Full URL Endpoint Mode**: Provider option that treats `base_url` as a complete upstream endpoint, unblocking vendors that require nonstandard URL layouts
|
||||
- **Hyper-based Proxy Forwarding Stack**: Refactored proxy forwarding onto a Hyper-based client with transparent header forwarding, improved endpoint rewriting, and better support for dynamic upstream endpoints
|
||||
- **Copilot Interaction Optimizer**: Request classification and routing logic that reduces unnecessary GitHub Copilot premium interaction consumption
|
||||
- **UTF-8 Stream Chunk Boundary Fix**: All four SSE streaming paths now preserve incomplete multi-byte UTF-8 sequences across TCP chunks, eliminating intermittent U+FFFD garbled output via the Copilot reverse proxy
|
||||
- **Linux Startup UI Fix**: Fixed the long-standing issue where the window UI couldn't receive clicks on Linux until the user manually maximized and restored the window
|
||||
|
||||
---
|
||||
|
||||
## New Features
|
||||
|
||||
### Lightweight Mode
|
||||
|
||||
A tray-only operating mode that dramatically reduces CC Switch's desktop footprint when idle.
|
||||
|
||||
- Destroys the main window on exit-to-tray instead of hiding it, freeing UI resources and memory
|
||||
- Recreates the window on demand when the user reopens CC Switch from the tray, a deeplink, or single-instance activation
|
||||
- Integrated into every window-re-show path: normal startup, deeplink, single_instance, tray `show_main`, and the lightweight-exit round-trip
|
||||
|
||||
### Quota & Balance Visibility
|
||||
|
||||
Added inline quota and balance readouts to provider cards so users can see remaining capacity without leaving the card.
|
||||
|
||||
- **Official subscriptions**: Inline quota display for Claude, Codex, and Gemini official providers
|
||||
- **GitHub Copilot**: Premium interactions quota display on the Copilot provider card
|
||||
- **Codex OAuth**: ChatGPT Plus / Pro subscription quota inline with the Codex OAuth provider card
|
||||
- **Token Plan providers**: Kimi, Zhipu GLM, and MiniMax with corrected quota math and consistent 0% → 100% usage progression
|
||||
- **Third-party balances**: Official balance queries for DeepSeek, StepFun, SiliconFlow, OpenRouter, and Novita AI
|
||||
- Health-check and usage-config buttons are hidden for official providers to keep the card clean
|
||||
|
||||
### Provider Model Auto-Fetch
|
||||
|
||||
Added OpenAI-compatible model discovery to every provider form, removing the manual copy-paste loop for model IDs.
|
||||
|
||||
- Queries the configured provider endpoint's `/v1/models`
|
||||
- Groups models in the dropdown by category for easier selection
|
||||
- Failure-specific error messages distinguish network / authentication / endpoint issues
|
||||
- Supported across all five applications: Claude, Codex, Gemini, OpenCode, and OpenClaw
|
||||
|
||||
### Codex OAuth Reverse Proxy
|
||||
|
||||
Added a reverse proxy path for ChatGPT Plus / Pro subscribers who want to route their Codex OAuth session through CC Switch.
|
||||
|
||||
- Managed OAuth login flow with ChatGPT Plus / Pro authentication
|
||||
- Surfaces as a new Claude provider card type alongside API-key providers
|
||||
- Inline subscription quota display
|
||||
- Integrated into the Auth Center with tightened copy, layout, and icon presentation
|
||||
- Bumped the Codex OAuth preset to the GPT-5.4 model family
|
||||
- See the [⚠️ Risk Notice](#️-risk-notice) below before enabling
|
||||
|
||||
### Tray Per-App Submenus
|
||||
|
||||
Reorganized the tray menu so providers are grouped under each application instead of living in a flat list.
|
||||
|
||||
- Per-application submenus for Claude, Codex, Gemini, OpenCode, and OpenClaw
|
||||
- Prevents the tray menu from overflowing the screen when users have many providers
|
||||
- Background provider switching scales cleanly to long provider lists
|
||||
|
||||
### Skills Discovery & Batch Updates
|
||||
|
||||
Upgraded the Skills management panel into a complete discovery plus maintenance workflow.
|
||||
|
||||
- **SHA-256 update detection**: Skills are content-hashed so the UI knows exactly which ones have upstream changes
|
||||
- **Per-skill and batch updates**: Individual "Update" buttons plus an animated "Update All" batch action
|
||||
- **Storage-location toggle**: Switch between CC Switch storage and `~/.agents/skills` without losing skill state
|
||||
- **Public registry search**: `skills.sh` search integrated directly into the dialog for discovering community skills
|
||||
|
||||
### Session Workflow Upgrades
|
||||
|
||||
Multiple session management improvements that reduce friction when working with Claude / Codex / Gemini sessions.
|
||||
|
||||
- **Batch session deletion**: Select and delete multiple sessions at once from Session Manager (#1693, thanks @Alexlangl)
|
||||
- **Directory picker before restore**: Claude terminal restore now prompts for the working directory up front (#1752, thanks @yovinchen)
|
||||
- **Usage from session logs without proxy**: Usage data imported directly from Claude / Codex / Gemini session logs — no proxy interception required
|
||||
- **Precise Codex JSONL parsing**: Replaced estimated Codex usage with precise JSONL session-log parsing plus Codex model name normalization for consistent pricing lookup
|
||||
- **Gemini CLI session log integration**: Gemini usage now syncs accurately from Gemini CLI session logs
|
||||
- **Per-app usage filtering**: Filter the usage dashboard by Claude, Codex, or Gemini independently
|
||||
|
||||
### OpenCode / OpenClaw Stream Check Coverage
|
||||
|
||||
Extended the Stream Check panel to cover the full OpenCode and OpenClaw surface area.
|
||||
|
||||
- OpenCode detection via npm package mapping
|
||||
- Support for the OpenClaw `openai-completions` protocol
|
||||
- Support for the remaining three OpenClaw protocol variants
|
||||
- Edge-case handling for custom-header passthrough, OpenClaw custom auth-header detection, Bedrock error messaging, and OpenCode default `baseURL` fallback
|
||||
|
||||
### Full URL Endpoint Mode
|
||||
|
||||
Added a provider option that treats `base_url` as a complete upstream endpoint instead of a base URL with path appending (#1561, thanks @yovinchen).
|
||||
|
||||
- Proxy forwarding and Stream Check both honor the full-URL mode
|
||||
- Unblocks vendors that require nonstandard URL layouts
|
||||
- Configurable per-provider on the provider form
|
||||
|
||||
### OpenCode StepFun Step Plan Preset
|
||||
|
||||
- Added a StepFun Step Plan provider preset for OpenCode with sensible defaults (#1668, thanks @sky-wang-salvation)
|
||||
|
||||
### Copilot Interaction Optimizer
|
||||
|
||||
Added request classification and routing logic that reduces unnecessary GitHub Copilot premium interaction consumption.
|
||||
|
||||
- Classifies incoming requests by intent and weight
|
||||
- Routes low-value requests away from premium interaction consumption paths
|
||||
- Designed to extend the usable lifetime of a Copilot subscription
|
||||
|
||||
---
|
||||
|
||||
## Changes
|
||||
|
||||
### Tray Menu Organization
|
||||
|
||||
- Reworked the tray menu into per-application submenus (Claude / Codex / Gemini / OpenCode / OpenClaw)
|
||||
- Prevents overflow and scales to long provider lists
|
||||
|
||||
### Proxy Forwarding Stack
|
||||
|
||||
Rebuilt the proxy forwarding layer on a Hyper-based HTTP client (#1714, thanks @yovinchen).
|
||||
|
||||
- Transparent header forwarding: headers are forwarded without aggressive filtering
|
||||
- Improved endpoint rewriting logic
|
||||
- Better support for dynamic upstream endpoints
|
||||
- Paired with the new Full URL Endpoint Mode to unblock vendors with nonstandard URL layouts
|
||||
|
||||
### OAuth Auth Center UI Polish
|
||||
|
||||
- Tightened the Auth Center copy, layout, and icon presentation so the Codex OAuth login flow feels cleaner and less cluttered
|
||||
|
||||
### Provider Key Lifecycle & Live Sync
|
||||
|
||||
Reworked the additive provider create / rename / duplicate flows so live config writes, cleanup, and rollback stay consistent across OpenCode / OpenClaw and takeover scenarios (#1724, thanks @yovinchen).
|
||||
|
||||
- Additive-mode highlight behavior made persistent across refreshes (#1747, thanks @yovinchen)
|
||||
- Consistent live config writes across OpenCode / OpenClaw
|
||||
- Rollback behavior preserved when operations fail
|
||||
|
||||
### Codex OAuth Defaults
|
||||
|
||||
- Updated the Codex OAuth preset to the GPT-5.4 model family
|
||||
|
||||
---
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
### Copilot Authentication & Proxy Compatibility
|
||||
|
||||
- Fixed GitHub Copilot authentication regressions (#1854, thanks @Mason-mengze)
|
||||
- Corrected enterprise and dynamic endpoint handling
|
||||
- Repaired clipboard verification-code copying on macOS and Linux
|
||||
- Fixed Responses routing when Copilot-backed Claude providers target OpenAI models (#1735, thanks @Mason-mengze)
|
||||
|
||||
### UTF-8 Stream Chunk Boundaries
|
||||
|
||||
Fixed intermittent garbled output (U+FFFD replacement characters) in Claude Code when multi-byte UTF-8 sequences such as Chinese characters and emoji were split across TCP stream chunks via the Copilot reverse proxy (#1923, thanks @Cod1ng).
|
||||
|
||||
- Replaced `String::from_utf8_lossy` with a new `append_utf8_safe` helper across all four SSE streaming paths
|
||||
- Preserves incomplete trailing bytes in a remainder buffer and merges them with the next chunk before decoding
|
||||
- Not reproducible with direct Copilot connections that pass through raw bytes without format conversion
|
||||
|
||||
### Fragmented System Prompt Normalization
|
||||
|
||||
Fixed strict OpenAI-compatible chat backends (Nvidia, Qwen-style) rejecting requests when converted Claude payloads contained multiple system messages (#1942, thanks @yovinchen).
|
||||
|
||||
- Normalized system content into a single leading system message during the Anthropic → OpenAI chat transformation
|
||||
- Leaves the rest of the message stream unchanged
|
||||
|
||||
### Streaming Parser Compatibility
|
||||
|
||||
- Fixed SSE parsing to accept fields with optional spaces, improving compatibility with non-strict streaming implementations (#1664, thanks @Alexlangl)
|
||||
|
||||
### Provider Switch State Corruption
|
||||
|
||||
- Serialized per-app provider switches to prevent concurrent failover or hot-switch operations from leaving `is_current`, settings state, and live backup state out of sync
|
||||
|
||||
### Claude Takeover Live Config Drift
|
||||
|
||||
- Fixed provider edits while Claude takeover is active so live settings remain aligned with the latest provider state without breaking takeover restore behavior (#1828, thanks @geekdada)
|
||||
|
||||
### WebDAV Password Retention & Validation
|
||||
|
||||
- Fixed the WebDAV password field so saved credentials remain visible after refresh
|
||||
- Treated `MKCOL 405` responses correctly during connection validation (#1685, thanks @Alexlangl)
|
||||
|
||||
### Provider Card Action States
|
||||
|
||||
- Fixed additive-mode highlight behavior (#1747, thanks @yovinchen)
|
||||
- Aligned usage display layout across provider cards by always rendering action buttons
|
||||
- Replaced hard proxy-switch blocking with a warning path
|
||||
- Disabled unsupported test and usage actions for Copilot and Codex OAuth cards
|
||||
- Hid usage-config and health-check buttons for official providers
|
||||
- Removed the hover-push animation from provider cards
|
||||
|
||||
### Usage Accuracy & Pricing
|
||||
|
||||
- Fixed MiniMax quota math and 0% → 100% progression
|
||||
- Corrected CNY → USD pricing plus missing model definitions
|
||||
- Improved Gemini session-log syncing accuracy
|
||||
- Resolved session-based usage entries being shown as unknown providers
|
||||
|
||||
### Usage Editor & Skills UI Regressions
|
||||
|
||||
- Fixed usage query fields being reset while editing extractor code (#1771, thanks @if-nil)
|
||||
- Corrected broken `skills.sh` links and empty descriptions
|
||||
- Fixed auto-query default interval (5 min) and number-input clearing in usage configuration
|
||||
|
||||
### Chinese Skills Terminology
|
||||
|
||||
- Unified Skills-related labels across settings panels in the `zh` locale so storage and sync options use consistent wording
|
||||
|
||||
### Environment & Preset Compatibility
|
||||
|
||||
- Added Bun global bin detection in CLI scan (#1742, thanks @makoMakoGo)
|
||||
- Adapted to the oh-my-openagent rename with backward compatibility (#1746, thanks @yovinchen)
|
||||
- Corrected the OpenCode `kimi-for-coding` preset (#1738, thanks @makoMakoGo)
|
||||
- Gated Gemini keychain parsing to macOS only
|
||||
- Fixed an OpenClaw serializer panic on empty collections (#1724, thanks @yovinchen)
|
||||
|
||||
### Linux UI Unresponsive on Startup
|
||||
|
||||
Fixed a long-standing Linux bug where the window UI (including native title bar buttons) couldn't receive clicks until the user manually maximized and restored the window.
|
||||
|
||||
- **Root causes**: (1) Tauri webview did not acquire keyboard focus after `show()` on Linux, so the first click was consumed by X11/Wayland click-to-activate (Tauri #10746, wry #637); (2) GTK surface's input region failed to renegotiate on the `visible:false → show()` path under some WebKitGTK/compositor combinations, leaving the entire window unresponsive
|
||||
- **Mitigations**: Set `WEBKIT_DISABLE_COMPOSITING_MODE=1` at startup, and added a new `linux_fix::nudge_main_window` helper that performs `set_focus` + a ±1px no-op resize ~200ms after show, equivalent to a visually invisible "maximize-and-restore"
|
||||
- **Coverage**: Wired into all window-re-show paths — normal startup, deeplink, single_instance, tray `show_main`, and lightweight-mode exit
|
||||
|
||||
### Linux Drag Region on Header
|
||||
|
||||
- Removed `data-tauri-drag-region` from the top header bar on Linux to avoid triggering `gtk_window_begin_move_drag` paths affected by Tauri #13440 under Wayland
|
||||
- macOS drag behavior is preserved
|
||||
|
||||
### OpenCode / OpenClaw Stream Check Edge Cases
|
||||
|
||||
- Fixed custom-header passthrough
|
||||
- OpenClaw custom auth-header detection
|
||||
- Bedrock error messaging
|
||||
- OpenCode default `baseURL` fallback handling
|
||||
|
||||
---
|
||||
|
||||
## Documentation
|
||||
|
||||
### User Manual Refresh
|
||||
|
||||
- Updated the EN / ZH / JA user manuals to cover tray submenus, lightweight mode, provider model fetching, session management, workspace files, WebDAV v2 behavior, OpenCode / OpenClaw activation, and other provider workflow improvements
|
||||
|
||||
### Community & Contribution Docs
|
||||
|
||||
- Added `CONTRIBUTING.md`, `SECURITY.md`, and `CODE_OF_CONDUCT.md`
|
||||
- Added bilingual GitHub issue and PR templates
|
||||
- Added Dependabot configuration (#1829, thanks @bengbengbalabalabeng) and a stale-bot workflow for inactive issues
|
||||
- Added a PR / push quality-checks CI workflow
|
||||
|
||||
### Release Notes Risk Notice Backport
|
||||
|
||||
- Added a Copilot reverse proxy risk notice and anchored highlight links in the v3.12.3 release notes across all three languages
|
||||
|
||||
---
|
||||
|
||||
## ⚠️ Risk Notice
|
||||
|
||||
**Codex OAuth Reverse Proxy Disclaimer**
|
||||
|
||||
The Codex OAuth reverse proxy introduced in this release accesses ChatGPT Plus / Pro Codex services through reverse-engineered OAuth flows. Please be aware of the following risks before enabling this feature:
|
||||
|
||||
1. **Terms of Service**: Using reverse-engineered OAuth flows to access OpenAI services may violate OpenAI's terms of service, which prohibit unauthorized automated access, service reproduction, and circumventing intended access paths.
|
||||
2. **Account Risk**: OpenAI may flag unusual usage patterns as suspicious automated activity, potentially resulting in temporary or permanent restrictions on ChatGPT Plus / Pro access.
|
||||
3. **No Guarantee**: OpenAI may update its authentication and detection mechanisms at any time, and usage patterns that work today may be flagged in the future.
|
||||
|
||||
The **GitHub Copilot reverse proxy** introduced in v3.12.3 also remains subject to its existing risk notice — see the [v3.12.3 release notes](v3.12.3-en.md#️-risk-notice) for the full disclosure.
|
||||
|
||||
Users enable these features **at their own risk**. CC Switch is not responsible for any account restrictions, warnings, or service suspensions resulting from the use of these features.
|
||||
|
||||
---
|
||||
|
||||
## Download & Installation
|
||||
|
||||
Visit [Releases](https://github.com/farion1231/cc-switch/releases/latest) to download the appropriate version.
|
||||
|
||||
### System Requirements
|
||||
|
||||
| System | Minimum Version | Architecture |
|
||||
| ------- | ------------------------------- | ----------------------------------- |
|
||||
| Windows | Windows 10 or later | x64 |
|
||||
| macOS | macOS 12 (Monterey) or later | Intel (x64) / Apple Silicon (arm64) |
|
||||
| Linux | See table below | x64 |
|
||||
|
||||
### Windows
|
||||
|
||||
| File | Description |
|
||||
| ------------------------------------------ | ---------------------------------------------------- |
|
||||
| `CC-Switch-v3.13.0-Windows.msi` | **Recommended** - MSI installer with auto-update |
|
||||
| `CC-Switch-v3.13.0-Windows-Portable.zip` | Portable version, extract and run, no registry write |
|
||||
|
||||
### macOS
|
||||
|
||||
| File | Description |
|
||||
| ---------------------------------- | -------------------------------------------------------------------- |
|
||||
| `CC-Switch-v3.13.0-macOS.dmg` | **Recommended** - DMG installer, drag to Applications, Universal Binary |
|
||||
| `CC-Switch-v3.13.0-macOS.zip` | ZIP archive, extract and drag to Applications, Universal Binary |
|
||||
| `CC-Switch-v3.13.0-macOS.tar.gz` | For Homebrew installation and auto-update |
|
||||
|
||||
> macOS builds are code-signed and notarized by Apple for a seamless install experience.
|
||||
|
||||
### Homebrew (macOS)
|
||||
|
||||
```bash
|
||||
brew tap farion1231/ccswitch
|
||||
brew install --cask cc-switch
|
||||
```
|
||||
|
||||
Update:
|
||||
|
||||
```bash
|
||||
brew upgrade --cask cc-switch
|
||||
```
|
||||
|
||||
### Linux
|
||||
|
||||
| Distribution | Recommended Format | Installation Method |
|
||||
| --------------------------------------- | ------------------ | ---------------------------------------------------------------------- |
|
||||
| Ubuntu / Debian / Linux Mint / Pop!\_OS | `.deb` | `sudo dpkg -i CC-Switch-*.deb` or `sudo apt install ./CC-Switch-*.deb` |
|
||||
| Fedora / RHEL / CentOS / Rocky Linux | `.rpm` | `sudo rpm -i CC-Switch-*.rpm` or `sudo dnf install ./CC-Switch-*.rpm` |
|
||||
| openSUSE | `.rpm` | `sudo zypper install ./CC-Switch-*.rpm` |
|
||||
| Arch Linux / Manjaro | `.AppImage` | Add execute permission and run directly, or use AUR |
|
||||
| Other distributions / Unsure | `.AppImage` | `chmod +x CC-Switch-*.AppImage && ./CC-Switch-*.AppImage` |
|
||||
@@ -1,353 +0,0 @@
|
||||
# CC Switch v3.13.0
|
||||
|
||||
> 軽量モード、クォータ・残高の可視化、プロバイダーモデル自動取得、Codex OAuth リバースプロキシ、トレイのアプリ別サブメニュー
|
||||
|
||||
**[中文版 →](v3.13.0-zh.md) | [English →](v3.13.0-en.md)**
|
||||
|
||||
---
|
||||
|
||||
## 概要
|
||||
|
||||
CC Switch v3.13.0 は、可観測性、プロバイダーワークフローの使いやすさ、プロキシ互換性を中心とした大型機能リリースです。Claude / Codex / Gemini の公式プロバイダー、Token Plan、Copilot、サードパーティ残高 API にわたる**クォータと残高のインライン表示**を追加し、メインウィンドウなしでシステムトレイから CC Switch を動作させる**軽量モード**を導入しました。OpenAI 互換の `/v1/models` による**自動モデル発見**を 5 つのサポート対象アプリケーションすべてに提供し、ChatGPT Plus / Pro サブスクライバー向けの **Codex OAuth リバースプロキシ**を同梱しています。トレイメニューを**アプリ別サブメニュー**に再編成し、プロキシ転送スタックを **Hyper ベースのクライアント**に再構築し、**Skills ワークフロー**を発見、バッチ更新、ストレージ位置切り替えで刷新しました。さらに、フル URL エンドポイントモード、プロキシ傍受なしのセッションログ用量追跡、Copilot インタラクション最適化、マルチバイト UTF-8 ストリームチャンク境界修正、Linux 起動時の UI 応答性修正なども含まれます。
|
||||
|
||||
**リリース日**: 2026-04-08
|
||||
|
||||
**更新規模**: 98 commits | 229 files changed | +23,891 / -2,305 lines
|
||||
|
||||
---
|
||||
|
||||
## ハイライト
|
||||
|
||||
- **軽量モード**: トレイ専用の動作モード。トレイへの終了時にメインウィンドウを破棄し、必要時に再作成することで、アイドル時の CC Switch のデスクトップフットプリントを最小化
|
||||
- **クォータと残高の可視化**: プロバイダーカードでのインラインクォータ/残高表示 — Claude / Codex / Gemini 公式サブスクリプション、GitHub Copilot premium interactions、Codex OAuth、Token Plan プロバイダー(Kimi / Zhipu GLM / MiniMax)、および DeepSeek / StepFun / SiliconFlow / OpenRouter / Novita AI の公式残高クエリをカバー
|
||||
- **プロバイダーモデル自動取得**: Claude / Codex / Gemini / OpenCode / OpenClaw のプロバイダーフォームに OpenAI 互換の `/v1/models` 発見機能を追加。グループ化ドロップダウンと失敗時の具体的なエラーメッセージ付き
|
||||
- **Codex OAuth リバースプロキシ**: ChatGPT Plus / Pro の Codex リバースプロキシを新しい Claude プロバイダーカードタイプとして追加。マネージド OAuth ログインとサブスクリプションクォータのインライン表示を提供([⚠️ リスクに関する注意事項](#️-リスクに関する注意事項))
|
||||
- **トレイのアプリ別サブメニュー**: トレイメニューをアプリ別サブメニューに再編成し、プロバイダー数が多くてもメニューがオーバーフローせず、バックグラウンドのプロバイダー切り替えが長いリストでもスケール
|
||||
- **Skills 発見とバッチ更新**: SHA-256 ベースの skill 更新検出、各 skill および「すべて更新」のバッチ更新、公開 `skills.sh` 検索統合、CC Switch ストレージと `~/.agents/skills` の間のストレージ位置切り替え
|
||||
- **セッションワークフローの改善**: Session Manager でのバッチ削除、Claude ターミナル復元前のディレクトリピッカー、プロキシ傍受なしでの Claude / Codex / Gemini セッションログからの用量インポート、正確な Codex JSONL 解析、アプリ別の用量フィルタリング
|
||||
- **OpenCode / OpenClaw Stream Check カバレッジ**: OpenCode の npm パッケージマッピング検出、OpenClaw `openai-completions` サポート、および残りの OpenClaw プロトコルバリアント
|
||||
- **フル URL エンドポイントモード**: `base_url` を完全な上流エンドポイントとして扱うプロバイダーオプションを追加し、非標準 URL レイアウトを要求するベンダーに対応
|
||||
- **Hyper ベースのプロキシ転送スタック**: プロキシ転送層を Hyper ベースのクライアントに再構築し、透過的なヘッダー転送、改善されたエンドポイントリライト、および動的上流エンドポイントのサポートを強化
|
||||
- **Copilot インタラクション最適化**: GitHub Copilot premium interaction の不要な消費を削減するリクエスト分類とルーティングロジックを追加
|
||||
- **UTF-8 ストリームチャンク境界修正**: マルチバイト UTF-8 シーケンスが TCP チャンクを跨いで分割された際の Copilot リバースプロキシ経由での文字化け(U+FFFD 置換文字)を解消するため、すべての 4 つの SSE ストリーミングパスを修正
|
||||
- **Linux 起動時 UI 修正**: ユーザーが手動でウィンドウを最大化・復元するまでウィンドウ UI がクリックを受け付けない長年の問題を修正
|
||||
|
||||
---
|
||||
|
||||
## 新機能
|
||||
|
||||
### 軽量モード
|
||||
|
||||
CC Switch のアイドル時のデスクトップフットプリントを大幅に削減するトレイ専用動作モード。
|
||||
|
||||
- トレイへの終了時にメインウィンドウを隠すのではなく破棄し、UI リソースとメモリを解放
|
||||
- トレイ、ディープリンク、またはシングルインスタンスアクティベーションからユーザーが CC Switch を再オープンしたときにウィンドウを再作成
|
||||
- 通常起動、ディープリンク、シングルインスタンス、トレイ `show_main`、軽量モード終了など、すべてのウィンドウ再表示パスに統合
|
||||
|
||||
### クォータと残高の可視化
|
||||
|
||||
プロバイダーカードにクォータと残高の表示を追加し、カードから離れずに残容量を確認できるようにしました。
|
||||
|
||||
- **公式サブスクリプション**: Claude / Codex / Gemini 公式プロバイダーのサブスクリプションクォータ表示
|
||||
- **GitHub Copilot**: Copilot プロバイダーカードに premium interactions 残量を表示
|
||||
- **Codex OAuth**: Codex OAuth カードに ChatGPT Plus / Pro サブスクリプションクォータをインライン表示
|
||||
- **Token Plan プロバイダー**: Kimi、Zhipu GLM、MiniMax。クォータ計算と 0% → 100% 使用量進行を修正
|
||||
- **サードパーティ残高**: DeepSeek、StepFun、SiliconFlow、OpenRouter、Novita AI に公式残高クエリを追加
|
||||
- 公式プロバイダーではヘルスチェックと用量設定ボタンを非表示にし、カードをクリーンに保つ
|
||||
|
||||
### プロバイダーモデル自動取得
|
||||
|
||||
すべてのプロバイダーフォームに OpenAI 互換のモデル発見機能を追加し、モデル ID の手動コピー&ペーストを不要に。
|
||||
|
||||
- 設定された API キーを使ってプロバイダーの `/v1/models` エンドポイントをクエリ
|
||||
- ドロップダウンでモデルをカテゴリ別にグループ化
|
||||
- ネットワーク / 認証 / エンドポイント未検出 / パース失敗を区別する具体的なエラーメッセージを提供
|
||||
- 5 つのアプリケーション(Claude / Codex / Gemini / OpenCode / OpenClaw)すべてをサポート
|
||||
|
||||
### Codex OAuth リバースプロキシ
|
||||
|
||||
ChatGPT Plus / Pro のサブスクライバーが Codex OAuth セッションを CC Switch 経由で利用できるリバースプロキシパスを追加。
|
||||
|
||||
- ChatGPT Plus / Pro 認証を使ったマネージド OAuth ログインフロー
|
||||
- API キー型プロバイダーと並ぶ新しい Claude プロバイダーカードタイプとして表示
|
||||
- サブスクリプションクォータのインライン表示
|
||||
- Auth Center との緊密な統合と、コピー・レイアウト・アイコンの調整
|
||||
- Codex OAuth プリセットを GPT-5.4 モデルファミリーに更新
|
||||
- 有効化前に下記の [⚠️ リスクに関する注意事項](#️-リスクに関する注意事項) をご確認ください
|
||||
|
||||
### トレイのアプリ別サブメニュー
|
||||
|
||||
トレイメニューを、フラットリストの代わりにアプリケーション別にプロバイダーをグループ化する構造に再編成しました。
|
||||
|
||||
- Claude / Codex / Gemini / OpenCode / OpenClaw のアプリ別サブメニュー
|
||||
- プロバイダーが多い場合にトレイメニューが画面からはみ出すことを防止
|
||||
- バックグラウンドのプロバイダー切り替えが長いリストでもクリーンにスケール
|
||||
|
||||
### Skills 発見とバッチ更新
|
||||
|
||||
Skills 管理パネルを、発見と保守を備えた完全なワークフローにアップグレード。
|
||||
|
||||
- **SHA-256 更新検出**: Skill をコンテンツハッシュ化することで、どれが上流で変更されたかを UI が正確に把握
|
||||
- **各 skill およびバッチ更新**: 個別の「更新」ボタンと、スライドインアニメーション付きの「すべて更新」バッチアクション
|
||||
- **ストレージ位置切り替え**: CC Switch ストレージと `~/.agents/skills` の間を skill 状態を失わずに切り替え
|
||||
- **公開レジストリ検索**: `skills.sh` 検索をダイアログに直接統合し、コミュニティ skill を発見しやすく
|
||||
|
||||
### セッションワークフローの改善
|
||||
|
||||
Claude / Codex / Gemini セッションでの作業を効率化する複数のセッション管理改善。
|
||||
|
||||
- **セッションのバッチ削除**: Session Manager で複数のセッションを選択し、1 つのアクションで削除 (#1693, @Alexlangl に感謝)
|
||||
- **復元前のディレクトリピッカー**: Claude ターミナルの復元時、事前に作業ディレクトリを選択 (#1752, @yovinchen に感謝)
|
||||
- **プロキシなしのセッションログ用量**: Claude / Codex / Gemini セッションログから直接用量データをインポート — プロキシ傍受は不要
|
||||
- **正確な Codex JSONL 解析**: Codex の推定用量を、JSONL セッションログの正確な解析に置き換え。Codex モデル名の正規化により料金ルックアップが一貫
|
||||
- **Gemini CLI セッションログ統合**: Gemini 用量が Gemini CLI セッションログから正確に同期
|
||||
- **アプリ別の用量フィルタリング**: 用量ダッシュボードを Claude / Codex / Gemini ごとに独立してフィルタリング可能
|
||||
|
||||
### OpenCode / OpenClaw Stream Check カバレッジ
|
||||
|
||||
Stream Check パネルのカバレッジを OpenCode と OpenClaw のサーフェス全体に拡張。
|
||||
|
||||
- npm パッケージマッピングによる OpenCode 検出
|
||||
- OpenClaw `openai-completions` プロトコルのサポート
|
||||
- 残りの 3 つの OpenClaw プロトコルバリアントのサポート
|
||||
- カスタムヘッダー透過、OpenClaw カスタム auth-header 検出、Bedrock エラーメッセージ、OpenCode デフォルト `baseURL` フォールバックのエッジケース処理
|
||||
|
||||
### フル URL エンドポイントモード
|
||||
|
||||
`base_url` をパス付加を伴わない完全な上流エンドポイントとして扱うプロバイダーオプションを追加 (#1561, @yovinchen に感謝)。
|
||||
|
||||
- プロキシ転送と Stream Check の両方がフル URL モードに対応
|
||||
- 非標準 URL レイアウトを要求するベンダーをアンブロック
|
||||
- プロバイダーフォームでプロバイダー単位で設定可能
|
||||
|
||||
### OpenCode StepFun Step Plan プリセット
|
||||
|
||||
- OpenCode 向けに StepFun Step Plan プロバイダープリセットと適切なデフォルト値を追加 (#1668, @sky-wang-salvation に感謝)
|
||||
|
||||
### Copilot インタラクション最適化
|
||||
|
||||
GitHub Copilot premium interaction の不要な消費を削減するリクエスト分類とルーティングロジックを追加。
|
||||
|
||||
- 受信リクエストを意図と重要度で分類
|
||||
- 価値の低いリクエストを premium interaction 消費パスから迂回
|
||||
- Copilot サブスクリプションの使用可能期間を延長することを目的
|
||||
|
||||
---
|
||||
|
||||
## 変更
|
||||
|
||||
### トレイメニュー構成
|
||||
|
||||
- トレイメニューをアプリ別サブメニュー(Claude / Codex / Gemini / OpenCode / OpenClaw)に再編成
|
||||
- オーバーフローを防ぎ、長いプロバイダーリストでもスケール
|
||||
|
||||
### プロキシ転送スタック
|
||||
|
||||
プロキシ転送層を Hyper ベースの HTTP クライアント上に再構築 (#1714, @yovinchen に感謝)。
|
||||
|
||||
- 透過的なヘッダー転送: ヘッダーをアグレッシブにフィルタせずに転送
|
||||
- 改善されたエンドポイントリライトロジック
|
||||
- 動的上流エンドポイントへのより良いサポート
|
||||
- 新しいフル URL エンドポイントモードと組み合わせ、非標準 URL レイアウトのベンダーをアンブロック
|
||||
|
||||
### OAuth Auth Center UI 調整
|
||||
|
||||
- Auth Center のコピー、レイアウト、アイコンの表現を調整し、Codex OAuth ログインフローをよりクリーンに
|
||||
|
||||
### プロバイダーキーライフサイクルと Live 同期
|
||||
|
||||
アディティブプロバイダーの作成/名前変更/複製フローを再構築し、OpenCode / OpenClaw およびテイクオーバーシナリオで Live 設定の書き込み、クリーンアップ、ロールバックが一貫するように (#1724, @yovinchen に感謝)。
|
||||
|
||||
- アディティブモードのハイライト動作がリフレッシュ後も保持 (#1747, @yovinchen に感謝)
|
||||
- OpenCode / OpenClaw 全体で Live 設定の書き込みが一貫
|
||||
- 操作失敗時のロールバック動作を保持
|
||||
|
||||
### Codex OAuth デフォルト
|
||||
|
||||
- Codex OAuth プリセットを GPT-5.4 モデルファミリーに更新
|
||||
|
||||
---
|
||||
|
||||
## バグ修正
|
||||
|
||||
### Copilot 認証とプロキシ互換性
|
||||
|
||||
- GitHub Copilot 認証の回帰を修正 (#1854, @Mason-mengze に感謝)
|
||||
- エンタープライズおよび動的エンドポイントの処理を修正
|
||||
- macOS と Linux でのクリップボード検証コードコピーを修復
|
||||
- Copilot バックの Claude プロバイダーが OpenAI モデルをターゲットとする場合の Responses ルーティングを修正 (#1735, @Mason-mengze に感謝)
|
||||
|
||||
### UTF-8 ストリームチャンク境界
|
||||
|
||||
Claude Code で Copilot リバースプロキシ経由時、中国語文字や絵文字などのマルチバイト UTF-8 シーケンスが TCP ストリームチャンクを跨いで分割される際の文字化け(U+FFFD 置換文字)を修正 (#1923, @Cod1ng に感謝)。
|
||||
|
||||
- すべての 4 つの SSE ストリーミングパスで `String::from_utf8_lossy` を新しい `append_utf8_safe` ヘルパーに置き換え
|
||||
- 不完全な末尾バイトを残余バッファで保持し、次のチャンクとマージしてからデコード
|
||||
- 直接の Copilot 接続では再現しない(フォーマット変換なしで生バイトを通すため)
|
||||
|
||||
### フラグメント System Prompt の正規化
|
||||
|
||||
厳格な OpenAI 互換 chat バックエンド(Nvidia、Qwen 系)が変換後の Claude ペイロードに複数の system メッセージを含む場合にリクエストを拒否する問題を修正 (#1942, @yovinchen に感謝)。
|
||||
|
||||
- Anthropic → OpenAI chat 変換時に、system コンテンツを単一の先頭 system メッセージに正規化
|
||||
- メッセージストリームの残りは変更なし
|
||||
|
||||
### ストリーミングパーサー互換性
|
||||
|
||||
- オプションのスペースを含むフィールドを受け入れるよう SSE パースを修正し、非厳格なストリーミング実装との互換性を向上 (#1664, @Alexlangl に感謝)
|
||||
|
||||
### プロバイダー切り替え状態の破損
|
||||
|
||||
- アプリごとのプロバイダー切り替えを直列化し、並行フェイルオーバーやホットスイッチ操作が `is_current`、設定状態、Live バックアップ状態を不整合状態のままにすることを防止
|
||||
|
||||
### Claude テイクオーバー Live 設定のドリフト
|
||||
|
||||
- Claude テイクオーバーが有効な間のプロバイダー編集で、Live 設定が最新のプロバイダー状態と整合を保つようにし、テイクオーバー復元動作を壊さない (#1828, @geekdada に感謝)
|
||||
|
||||
### WebDAV パスワード保持と検証
|
||||
|
||||
- 保存済みの WebDAV パスワードがリフレッシュ後も表示されるように修正
|
||||
- 接続検証時に `MKCOL 405` レスポンスを正しく処理 (#1685, @Alexlangl に感謝)
|
||||
|
||||
### プロバイダーカードのアクション状態
|
||||
|
||||
- アディティブモードのハイライト動作を修正 (#1747, @yovinchen に感謝)
|
||||
- アクションボタンを常にレンダリングすることでプロバイダーカード全体の用量表示レイアウトを整列
|
||||
- ハードなプロキシ切り替えブロッキングを警告パスに置き換え
|
||||
- Copilot および Codex OAuth カードでサポートされていないテスト/用量アクションを無効化
|
||||
- 公式プロバイダーでは用量設定とヘルスチェックのボタンを非表示
|
||||
- プロバイダーカードのホバープッシュアニメーションを削除
|
||||
|
||||
### 用量精度と料金
|
||||
|
||||
- MiniMax クォータの計算と 0% → 100% 進行を修正
|
||||
- CNY → USD の料金を修正し、不足モデルを追加
|
||||
- Gemini セッションログ同期の精度を改善
|
||||
- セッションベースの用量エントリが「不明なプロバイダー」として表示される問題を解決
|
||||
|
||||
### 用量エディタと Skills UI の回帰
|
||||
|
||||
- エクストラクタコード編集時に用量クエリフィールドがリセットされる問題を修正 (#1771, @if-nil に感謝)
|
||||
- 壊れた `skills.sh` リンクと空の説明を修正
|
||||
- 用量設定の auto-query デフォルト間隔(5 分)と数値入力のクリア問題を修正
|
||||
|
||||
### 中国語 Skills 用語
|
||||
|
||||
- zh ロケールの設定パネルで Skills 関連ラベルを統一し、ストレージと同期オプションで一貫した表現を使用
|
||||
|
||||
### 環境とプリセット互換性
|
||||
|
||||
- CLI スキャンで Bun グローバル bin 検出を追加 (#1742, @makoMakoGo に感謝)
|
||||
- oh-my-openagent のリネームに後方互換性を持って対応 (#1746, @yovinchen に感謝)
|
||||
- OpenCode `kimi-for-coding` プリセットを修正 (#1738, @makoMakoGo に感謝)
|
||||
- Gemini キーチェーン解析を macOS のみに制限
|
||||
- 空コレクションで発生する OpenClaw シリアライザのパニックを修正 (#1724, @yovinchen に感謝)
|
||||
|
||||
### Linux 起動時の UI 応答性
|
||||
|
||||
ユーザーが手動でウィンドウを最大化・復元するまで、ウィンドウ UI(ネイティブタイトルバーボタンを含む)がクリックを受け付けないという長年の Linux 固有のバグを修正。
|
||||
|
||||
- **根本原因**: (1) Tauri webview が Linux の `show()` 後にキーボードフォーカスを取得せず、最初のクリックが X11/Wayland の click-to-activate によって消費される(Tauri #10746、wry #637); (2) GTK surface の入力領域が、一部の WebKitGTK/コンポジター組み合わせで `visible:false → show()` パスの再交渉に失敗し、ウィンドウ全体が応答しなくなる
|
||||
- **緩和策**: 起動時に `WEBKIT_DISABLE_COMPOSITING_MODE=1` を設定し、新しい `linux_fix::nudge_main_window` ヘルパーを追加。show から ~200ms 後に `set_focus` + ±1px のノーオペレーションリサイズを実行し、視覚的に見えない「最大化と復元」と同等の動作を実現
|
||||
- **カバレッジ**: すべてのウィンドウ再表示パス(通常起動、ディープリンク、シングルインスタンス、トレイ `show_main`、軽量モード終了)に統合
|
||||
|
||||
### Linux ヘッダーのドラッグ領域
|
||||
|
||||
- Wayland 下で Tauri #13440 の影響を受ける `gtk_window_begin_move_drag` パスのトリガーを回避するため、Linux ではトップヘッダーバーから `data-tauri-drag-region` を削除
|
||||
- macOS のドラッグ動作は保持
|
||||
|
||||
### OpenCode / OpenClaw Stream Check のエッジケース
|
||||
|
||||
- カスタムヘッダー透過を修正
|
||||
- OpenClaw カスタム auth-header 検出を修正
|
||||
- Bedrock エラーメッセージを修正
|
||||
- OpenCode デフォルト `baseURL` のフォールバック処理を修正
|
||||
|
||||
---
|
||||
|
||||
## ドキュメント
|
||||
|
||||
### ユーザーマニュアルの刷新
|
||||
|
||||
- EN / ZH / JA ユーザーマニュアルで、トレイサブメニュー、軽量モード、プロバイダーモデル取得、セッション管理、ワークスペースファイル、WebDAV v2 の動作、OpenCode / OpenClaw の有効化、その他のプロバイダーワークフロー改善を更新
|
||||
|
||||
### コミュニティと貢献ドキュメント
|
||||
|
||||
- `CONTRIBUTING.md`、`SECURITY.md`、`CODE_OF_CONDUCT.md` を追加
|
||||
- バイリンガル GitHub issue および PR テンプレートを追加
|
||||
- Dependabot 設定 (#1829, @bengbengbalabalabeng に感謝) と、非アクティブな issue を自動クローズする stale-bot ワークフローを追加
|
||||
- PR / push 品質チェック CI ワークフローを追加
|
||||
|
||||
### Release Notes のリスク通知バックポート
|
||||
|
||||
- v3.12.3 の release notes に Copilot リバースプロキシのリスク通知とハイライトリンクのアンカーを 3 言語すべてに追加
|
||||
|
||||
---
|
||||
|
||||
## ⚠️ リスクに関する注意事項
|
||||
|
||||
**Codex OAuth リバースプロキシに関する免責事項**
|
||||
|
||||
本リリースで追加された Codex OAuth リバースプロキシ機能は、リバースエンジニアリングによる OAuth フローを通じて ChatGPT Plus / Pro の Codex サービスにアクセスします。この機能を有効にする前に、以下のリスクをご確認ください:
|
||||
|
||||
1. **利用規約違反の可能性**: リバースエンジニアリングされた OAuth フローを使用して OpenAI サービスにアクセスすることは、OpenAI の利用規約に違反する可能性があります。これらの規約では、未承認の自動アクセス、サービス複製、および意図されたアクセスパスの回避が禁止されています。
|
||||
2. **アカウントリスク**: OpenAI は異常な使用パターンを疑わしい自動化活動としてフラグ付けし、ChatGPT Plus / Pro へのアクセスに一時的または永久的な制限を科す可能性があります。
|
||||
3. **将来の利用保証なし**: OpenAI は認証および検出メカニズムをいつでも更新する可能性があり、現在動作する使用パターンが将来的にフラグ付けされる可能性があります。
|
||||
|
||||
v3.12.3 で導入された **GitHub Copilot リバースプロキシ**も、既存のリスク通知の対象となります — 詳細は [v3.12.3 リリースノート](v3.12.3-ja.md#️-リスクに関する注意事項) を参照してください。
|
||||
|
||||
これらの機能を有効にすることで、ユーザーは**すべてのリスクを自己責任で負う**ものとします。CC Switch は、これらの機能の使用に起因するアカウント制限、警告、またはサービス停止について一切の責任を負いません。
|
||||
|
||||
---
|
||||
|
||||
## ダウンロードとインストール
|
||||
|
||||
[Releases](https://github.com/farion1231/cc-switch/releases/latest) から適切なバージョンをダウンロードしてください。
|
||||
|
||||
### システム要件
|
||||
|
||||
| システム | 最小バージョン | アーキテクチャ |
|
||||
| -------- | -------------------------------- | ----------------------------------- |
|
||||
| Windows | Windows 10 以降 | x64 |
|
||||
| macOS | macOS 12 (Monterey) 以降 | Intel (x64) / Apple Silicon (arm64) |
|
||||
| Linux | 下表参照 | x64 |
|
||||
|
||||
### Windows
|
||||
|
||||
| ファイル | 説明 |
|
||||
| ------------------------------------------ | ---------------------------------------------------- |
|
||||
| `CC-Switch-v3.13.0-Windows.msi` | **推奨** - MSI インストーラー、自動更新対応 |
|
||||
| `CC-Switch-v3.13.0-Windows-Portable.zip` | ポータブル版、解凍して実行、レジストリ書き込みなし |
|
||||
|
||||
### macOS
|
||||
|
||||
| ファイル | 説明 |
|
||||
| ---------------------------------- | ----------------------------------------------------------------- |
|
||||
| `CC-Switch-v3.13.0-macOS.dmg` | **推奨** - DMG インストーラー、ドラッグ&ドロップでインストール |
|
||||
| `CC-Switch-v3.13.0-macOS.zip` | 解凍して Applications にドラッグ、Universal Binary |
|
||||
| `CC-Switch-v3.13.0-macOS.tar.gz` | Homebrew インストールと自動更新用 |
|
||||
|
||||
> macOS 版は Apple のコード署名と公証済みで、そのままインストールしてご利用いただけます。
|
||||
|
||||
### Homebrew (macOS)
|
||||
|
||||
```bash
|
||||
brew tap farion1231/ccswitch
|
||||
brew install --cask cc-switch
|
||||
```
|
||||
|
||||
更新:
|
||||
|
||||
```bash
|
||||
brew upgrade --cask cc-switch
|
||||
```
|
||||
|
||||
### Linux
|
||||
|
||||
| ディストリビューション | 推奨形式 | インストール方法 |
|
||||
| --------------------------------------- | ----------- | ---------------------------------------------------------------------- |
|
||||
| Ubuntu / Debian / Linux Mint / Pop!\_OS | `.deb` | `sudo dpkg -i CC-Switch-*.deb` または `sudo apt install ./CC-Switch-*.deb` |
|
||||
| Fedora / RHEL / CentOS / Rocky Linux | `.rpm` | `sudo rpm -i CC-Switch-*.rpm` または `sudo dnf install ./CC-Switch-*.rpm` |
|
||||
| openSUSE | `.rpm` | `sudo zypper install ./CC-Switch-*.rpm` |
|
||||
| Arch Linux / Manjaro | `.AppImage` | 実行権限を追加して直接実行、または AUR を使用 |
|
||||
| その他のディストリビューション / 不明 | `.AppImage` | `chmod +x CC-Switch-*.AppImage && ./CC-Switch-*.AppImage` |
|
||||
@@ -1,354 +0,0 @@
|
||||
# CC Switch v3.13.0
|
||||
|
||||
> 轻量模式、配额与余额展示、供应商模型自动获取、Codex OAuth 反向代理、托盘按应用分级菜单
|
||||
|
||||
**[English →](v3.13.0-en.md) | [日本語版 →](v3.13.0-ja.md)**
|
||||
|
||||
---
|
||||
|
||||
## 概览
|
||||
|
||||
CC Switch v3.13.0 是一次重要的功能版本,聚焦于可观测性、供应商工作流与代理兼容性。本版本在各主要供应商卡片上新增了**配额与余额展示**,覆盖 Claude / Codex / Gemini 官方订阅、Token Plan(Kimi / Zhipu GLM / MiniMax)、Copilot premium interactions 以及 DeepSeek / StepFun / SiliconFlow / OpenRouter / Novita AI 等第三方余额查询;引入了**轻量模式**,让 CC Switch 可以仅驻留在系统托盘中运行;通过 OpenAI 兼容的 `/v1/models` 端点在 Claude / Codex / Gemini / OpenCode / OpenClaw 五个应用的供应商表单中实现了**模型自动发现**;为 ChatGPT Plus / Pro 订阅者提供了 **Codex OAuth 反向代理**;将托盘菜单重构为**按应用分级的子菜单**;将代理转发层重建在 **Hyper 客户端**之上;并完成了 **Skills 工作流**的发现、批量更新和存储位置切换改造。其他改进还包括完整 URL 端点模式、无需代理拦截的会话日志用量追踪、Copilot 调用优化器、多字节 UTF-8 流式分片边界修复以及 Linux 启动时 UI 无响应修复等。
|
||||
|
||||
**发布日期**:2026-04-08
|
||||
|
||||
**更新规模**:98 commits | 229 files changed | +23,891 / -2,305 lines
|
||||
|
||||
---
|
||||
|
||||
## 重点内容
|
||||
|
||||
- **轻量模式**:新增仅托盘运行模式,退出到托盘时销毁主窗口、按需重建,空闲时资源占用接近零
|
||||
- **配额与余额展示**:供应商卡片上直接展示配额或余额 —— 覆盖 Claude / Codex / Gemini 官方订阅、GitHub Copilot premium interactions、Codex OAuth、Token Plan(Kimi / Zhipu GLM / MiniMax),以及 DeepSeek / StepFun / SiliconFlow / OpenRouter / Novita AI 的官方余额查询
|
||||
- **供应商模型自动获取**:为 Claude / Codex / Gemini / OpenCode / OpenClaw 的供应商表单新增 OpenAI 兼容的 `/v1/models` 发现能力,按分组下拉展示并提供针对性错误提示
|
||||
- **Codex OAuth 反向代理**:新增 ChatGPT Plus / Pro 的 Codex 反向代理,作为新的 Claude 供应商卡片类型,包含受管 OAuth 登录流程和订阅配额展示([⚠️ 风险提示](#️-风险提示))
|
||||
- **托盘按应用分级菜单**:将托盘菜单重构为按应用分组的子菜单,防止供应商多时菜单溢出,让后台切换供应商在大量供应商场景下仍可用
|
||||
- **Skills 发现与批量更新**:基于 SHA-256 内容哈希的更新检测、单项和"全部更新"批量操作、`skills.sh` 公共注册表搜索集成,以及 CC Switch 与 `~/.agents/skills` 的存储位置切换
|
||||
- **会话工作流升级**:会话管理器批量删除、Claude 终端恢复前的目录选择器、无需代理拦截即可导入 Claude / Codex / Gemini 会话日志用量、精确的 Codex JSONL 解析、按应用筛选用量面板
|
||||
- **OpenCode / OpenClaw 流式检测覆盖**:新增 OpenCode 的 npm 包映射检测、OpenClaw `openai-completions` 支持,以及其余所有 OpenClaw 协议变体
|
||||
- **完整 URL 端点模式**:新增将 `base_url` 视作完整上游端点的供应商选项,支持非标准 URL 布局的厂商
|
||||
- **Hyper 代理转发栈**:将代理转发层重构到 Hyper 客户端之上,实现透明头部转发、改进的端点重写以及对动态上游端点的更好支持
|
||||
- **Copilot 调用优化器**:新增请求分类和路由逻辑,降低 GitHub Copilot premium interaction 的不必要消耗
|
||||
- **UTF-8 流式分片边界修复**:所有 4 条 SSE 流式路径改为跨分片保留残留多字节序列,消除 Copilot 反代下中文/emoji 乱码
|
||||
- **Linux 启动 UI 修复**:修复长期存在的 Linux 窗口初次无法响应点击、需用户手动最大化再还原才能操作的问题
|
||||
|
||||
---
|
||||
|
||||
## 新功能
|
||||
|
||||
### 轻量模式
|
||||
|
||||
新增仅托盘运行模式,显著降低 CC Switch 空闲时的桌面占用。
|
||||
|
||||
- 退出到托盘时销毁主窗口而非隐藏,释放 UI 资源和内存
|
||||
- 用户从托盘、深链接或单例激活时按需重建窗口
|
||||
- 覆盖所有窗口重新显示路径:正常启动、深链接、单例、托盘 `show_main` 以及轻量模式退出返程
|
||||
|
||||
### 配额与余额展示
|
||||
|
||||
在供应商卡片上新增配额和余额读数,用户无需离开卡片即可查看剩余容量。
|
||||
|
||||
- **官方订阅**:Claude / Codex / Gemini 官方供应商的订阅配额展示
|
||||
- **GitHub Copilot**:在 Copilot 供应商卡片上显示 premium interactions 剩余量
|
||||
- **Codex OAuth**:在 Codex OAuth 卡片上内联展示 ChatGPT Plus / Pro 订阅配额
|
||||
- **Token Plan 供应商**:Kimi、Zhipu GLM、MiniMax,修正配额数学与 0% → 100% 用量进度
|
||||
- **第三方余额**:为 DeepSeek、StepFun、SiliconFlow、OpenRouter、Novita AI 提供官方余额查询
|
||||
- 官方供应商的健康检查和用量配置按钮自动隐藏,保持卡片简洁
|
||||
|
||||
### 供应商模型自动获取
|
||||
|
||||
为所有供应商表单新增 OpenAI 兼容的模型发现能力,消除手动复制粘贴模型 ID 的繁琐流程。
|
||||
|
||||
- 使用配置的 API key 向供应商的 `/v1/models` 端点发起请求
|
||||
- 在下拉菜单中按类别分组展示模型
|
||||
- 对网络 / 认证 / 端点不存在 / 解析失败等场景提供具体错误消息
|
||||
- 支持全部五个应用(Claude / Codex / Gemini / OpenCode / OpenClaw)
|
||||
|
||||
### Codex OAuth 反向代理
|
||||
|
||||
新增 ChatGPT Plus / Pro 订阅者的 Codex OAuth 反向代理路径,让 ChatGPT 订阅者可以在 Claude Code 中使用自己的订阅。
|
||||
|
||||
- 受管 OAuth 登录流程,通过 ChatGPT Plus / Pro 认证
|
||||
- 作为新的 Claude 供应商卡片类型出现在列表中,与 API-key 型供应商并列
|
||||
- 订阅配额内联展示
|
||||
- 与 Auth Center UI 紧密集成,统一管理 Token
|
||||
- Codex OAuth 预设升级到 GPT-5.4 系列
|
||||
- 启用前请参见下文的 [⚠️ 风险提示](#️-风险提示)
|
||||
|
||||
### 托盘按应用分级菜单
|
||||
|
||||
将托盘菜单重构为按应用分组的子菜单,取代原来的扁平列表。
|
||||
|
||||
- 为 Claude / Codex / Gemini / OpenCode / OpenClaw 分别建立独立的子菜单
|
||||
- 防止用户有大量供应商时托盘菜单溢出屏幕
|
||||
- 后台切换供应商的可扩展性更好
|
||||
|
||||
### Skills 发现与批量更新
|
||||
|
||||
将 Skills 管理面板升级为完整的发现 + 维护工作流。
|
||||
|
||||
- **SHA-256 更新检测**:通过内容哈希判断哪些 skill 在远端有更新
|
||||
- **单项与批量更新**:单项"更新"按钮 + 带滑入动画的"全部更新"批量操作
|
||||
- **存储位置切换**:在 CC Switch 存储和 `~/.agents/skills` 之间切换而不丢失 skill 状态
|
||||
- **公共注册表搜索**:将 `skills.sh` 搜索直接集成到对话框中,方便发现社区 skill
|
||||
|
||||
### 会话工作流升级
|
||||
|
||||
多项会话管理改进,降低使用 Claude / Codex / Gemini 会话时的摩擦。
|
||||
|
||||
- **批量删除会话**:在会话管理器中选择并一次删除多个会话 (#1693, 感谢 @Alexlangl)
|
||||
- **恢复前目录选择器**:Claude 终端恢复前先选择工作目录 (#1752, 感谢 @yovinchen)
|
||||
- **无需代理的会话日志用量**:直接从 Claude / Codex / Gemini 会话日志导入用量数据,无需代理拦截
|
||||
- **精确的 Codex JSONL 解析**:替换 Codex 的估算用量为基于 JSONL 会话日志的精确解析,同时对模型名称做归一化以保证定价查询一致性
|
||||
- **Gemini CLI 会话日志集成**:Gemini 用量现在从 Gemini CLI 会话日志精确同步
|
||||
- **按应用筛选用量**:用量面板可按 Claude / Codex / Gemini 独立筛选
|
||||
|
||||
### OpenCode / OpenClaw 流式检测覆盖
|
||||
|
||||
将 Stream Check 面板的覆盖范围扩展到 OpenCode 和所有 OpenClaw 协议变体。
|
||||
|
||||
- 通过 npm 包映射检测 OpenCode 供应商
|
||||
- 支持 OpenClaw `openai-completions` 协议
|
||||
- 支持剩余的三个 OpenClaw 协议变体
|
||||
- 针对自定义头透传、OpenClaw 自定义 auth-header 检测、Bedrock 错误消息、OpenCode 默认 `baseURL` 回退等边界情况进行了处理
|
||||
|
||||
### 完整 URL 端点模式
|
||||
|
||||
新增将 `base_url` 视作完整上游端点的供应商选项,取代原有的 base-URL 加路径拼接模式 (#1561, 感谢 @yovinchen)。
|
||||
|
||||
- 代理转发和 Stream Check 都会遵循完整 URL 模式
|
||||
- 解锁需要非标准 URL 布局的厂商
|
||||
- 可在供应商表单中按供应商配置
|
||||
|
||||
### OpenCode StepFun Step Plan 预设
|
||||
|
||||
- 为 OpenCode 新增 StepFun Step Plan 供应商预设及合理默认值 (#1668, 感谢 @sky-wang-salvation)
|
||||
|
||||
### Copilot 调用优化器
|
||||
|
||||
新增请求分类和路由逻辑,降低 GitHub Copilot premium interaction 的不必要消耗。
|
||||
|
||||
- 根据请求意图和权重进行分类
|
||||
- 将低价值请求路由到非 premium 通道
|
||||
- 旨在延长 Copilot 订阅的可用时长
|
||||
|
||||
---
|
||||
|
||||
## 变更
|
||||
|
||||
### 托盘菜单组织
|
||||
|
||||
- 将托盘菜单重构为按应用分级的子菜单(Claude / Codex / Gemini / OpenCode / OpenClaw)
|
||||
- 防止菜单溢出,支持大量供应商的场景
|
||||
|
||||
### 代理转发栈
|
||||
|
||||
将代理转发层重建在 Hyper HTTP 客户端之上 (#1714, 感谢 @yovinchen)。
|
||||
|
||||
- 透明头部转发:头部透传,不做激进过滤
|
||||
- 改进的端点重写逻辑
|
||||
- 更好地支持动态上游端点
|
||||
- 与新的"完整 URL 端点模式"配合,解锁非标准 URL 布局的厂商
|
||||
|
||||
### OAuth Auth Center UI 精修
|
||||
|
||||
- 精修 Auth Center 的文案、布局和图标呈现,让 Codex OAuth 登录流程更清爽
|
||||
|
||||
### 供应商键生命周期与 Live 同步
|
||||
|
||||
重做了新增模式供应商的创建/重命名/复制流程,让 Live 配置写入、清理和回滚在 OpenCode / OpenClaw 与接管场景下保持一致 (#1724, 感谢 @yovinchen)。
|
||||
|
||||
- 新增模式高亮行为在刷新后依旧保持 (#1747, 感谢 @yovinchen)
|
||||
- OpenCode / OpenClaw 的 Live 配置写入保持一致
|
||||
- 失败时正确回滚,避免半提交状态
|
||||
|
||||
### Codex OAuth 默认值
|
||||
|
||||
- Codex OAuth 预设升级到 GPT-5.4 系列
|
||||
|
||||
---
|
||||
|
||||
## Bug 修复
|
||||
|
||||
### Copilot 认证与代理兼容性
|
||||
|
||||
- 修复 GitHub Copilot 认证回归问题 (#1854, 感谢 @Mason-mengze)
|
||||
- 修正企业版和动态端点处理
|
||||
- 修复 macOS 和 Linux 上的剪贴板验证码复制问题
|
||||
- 修复 Copilot 作为 Claude 供应商时 OpenAI 模型的 Responses 分流 (#1735, 感谢 @Mason-mengze)
|
||||
|
||||
### UTF-8 流式分片边界
|
||||
|
||||
修复 Claude Code 在 Copilot 反代下,当中文字符或 emoji 等多字节 UTF-8 序列跨 TCP 分片传输时出现的间歇性乱码(U+FFFD 替换字符)问题 (#1923, 感谢 @Cod1ng)。
|
||||
|
||||
- 将所有 4 条 SSE 流式路径中的 `String::from_utf8_lossy` 替换为新的 `append_utf8_safe` 辅助函数
|
||||
- 通过残留缓冲区保留不完整的尾部字节,并在下一个分片合并后再解码
|
||||
- 直连 Copilot 的场景不可复现,因为直连模式透传原始字节而不做格式转换
|
||||
|
||||
### 碎片 System Prompt 规范化
|
||||
|
||||
修复严格的 OpenAI 兼容 chat 后端(Nvidia、Qwen 风格)在转换后 Claude 负载包含多条 system 消息时拒绝请求的问题 (#1942, 感谢 @yovinchen)。
|
||||
|
||||
- 在 Anthropic → OpenAI chat 转换时将 system 内容合并为单条前置 system 消息
|
||||
- 其余消息流保持不变
|
||||
|
||||
### 流式解析兼容性
|
||||
|
||||
- 修复 SSE 解析以接受包含可选空格的字段,提升对非严格流式实现的兼容性 (#1664, 感谢 @Alexlangl)
|
||||
|
||||
### 供应商切换状态损坏
|
||||
|
||||
- 将按应用的供应商切换串行化,防止并发故障转移或热切换操作导致 `is_current`、设置状态和 Live 备份状态不一致
|
||||
|
||||
### Claude 接管 Live 配置漂移
|
||||
|
||||
- 修复 Claude 接管启用时供应商编辑导致 Live 设置与供应商状态失步,同时保持接管恢复行为不被破坏 (#1828, 感谢 @geekdada)
|
||||
|
||||
### WebDAV 密码保留与校验
|
||||
|
||||
- 修复 WebDAV 密码字段在刷新后不可见的问题
|
||||
- 连接校验时正确处理 `MKCOL 405` 响应 (#1685, 感谢 @Alexlangl)
|
||||
|
||||
### 供应商卡片动作状态
|
||||
|
||||
- 修复新增模式高亮行为 (#1747, 感谢 @yovinchen)
|
||||
- 始终渲染动作按钮,对齐各卡片的用量显示布局
|
||||
- 用警告路径替换硬阻塞的代理切换
|
||||
- 禁用 Copilot 和 Codex OAuth 卡片上不受支持的测试/用量动作
|
||||
- 隐藏官方供应商的用量配置和健康检查按钮
|
||||
- 移除供应商卡片上的 hover 推送动画
|
||||
|
||||
### 用量精确性与定价
|
||||
|
||||
- 修复 MiniMax 配额数学和 0% → 100% 进度
|
||||
- 修正 CNY → USD 定价并补齐缺失模型
|
||||
- 改进 Gemini 会话日志同步的精度
|
||||
- 修复基于会话的用量条目显示为"未知供应商"的问题
|
||||
|
||||
### 用量编辑器与 Skills UI 回归
|
||||
|
||||
- 修复编辑提取器代码时用量查询字段被重置的问题 (#1771, 感谢 @if-nil)
|
||||
- 修正 `skills.sh` 链接失效和空描述问题
|
||||
- 修复用量配置中的 auto-query 默认间隔(5 分钟)和 number-input 清空问题
|
||||
|
||||
### 中文 Skills 术语
|
||||
|
||||
- 统一 zh locale 下设置面板中的 Skills 相关标签,保持存储与同步选项用词一致
|
||||
|
||||
### 环境与预设兼容性
|
||||
|
||||
- 在 CLI 扫描中新增 Bun 全局 bin 检测 (#1742, 感谢 @makoMakoGo)
|
||||
- 适配 oh-my-openagent 重命名并保持向后兼容 (#1746, 感谢 @yovinchen)
|
||||
- 修正 OpenCode `kimi-for-coding` 预设 (#1738, 感谢 @makoMakoGo)
|
||||
- 将 Gemini keychain 解析限制为仅 macOS
|
||||
- 修复空集合时 OpenClaw 序列化器 panic (#1724, 感谢 @yovinchen)
|
||||
|
||||
### Linux 启动时 UI 无响应
|
||||
|
||||
修复长期存在的 Linux 专属 bug:窗口 UI(包括原生标题栏按钮)在用户手动最大化再还原之前无法接收点击。
|
||||
|
||||
- **根因 1**:Tauri webview 在 Linux 上 `show()` 之后未获得键盘焦点,首次点击被 X11 / Wayland 的 click-to-activate 消费掉(Tauri #10746、wry #637)
|
||||
- **根因 2**:在某些 WebKitGTK / 合成器组合下,GTK surface 的输入区域在 `visible:false → show()` 路径上未能重协商,导致整个窗口无响应
|
||||
- **缓解措施**:启动时设置 `WEBKIT_DISABLE_COMPOSITING_MODE=1`,并新增 `linux_fix::nudge_main_window` 辅助函数,在 show 之后 ~200ms 执行 `set_focus` + ±1px 无操作尺寸调整,等效于一次视觉上不可见的"最大化再还原"
|
||||
- **覆盖范围**:接入所有窗口重新显示路径 —— 正常启动、深链接、单例、托盘 `show_main` 以及轻量模式退出返程
|
||||
|
||||
### Linux 标题栏拖动区域
|
||||
|
||||
- 在 Linux 上从顶部标题栏移除 `data-tauri-drag-region`,避免触发 Wayland 下受 Tauri #13440 影响的 `gtk_window_begin_move_drag` 路径
|
||||
- macOS 拖动行为保持不变
|
||||
|
||||
### OpenCode / OpenClaw 流式检测边界情况
|
||||
|
||||
- 修复自定义头透传
|
||||
- 修复 OpenClaw 自定义 auth-header 检测
|
||||
- 修复 Bedrock 错误消息
|
||||
- 修复 OpenCode 默认 `baseURL` 回退处理
|
||||
|
||||
---
|
||||
|
||||
## 文档
|
||||
|
||||
### 用户手册刷新
|
||||
|
||||
- 在 EN / ZH / JA 用户手册中覆盖托盘子菜单、轻量模式、供应商模型获取、会话管理、工作区文件、WebDAV v2 行为、OpenCode / OpenClaw 启用等供应商工作流改进
|
||||
|
||||
### 社区与贡献文档
|
||||
|
||||
- 新增 `CONTRIBUTING.md`、`SECURITY.md`、`CODE_OF_CONDUCT.md`
|
||||
- 新增双语 GitHub issue 和 PR 模板
|
||||
- 新增 Dependabot 配置 (#1829, 感谢 @bengbengbalabalabeng) 和 stale-bot 工作流以自动关闭不活跃的 issue
|
||||
- 新增 PR / push 质量检查 CI 工作流
|
||||
|
||||
### Release Notes 风险提示回填
|
||||
|
||||
- 在三语 v3.12.3 release notes 中新增 Copilot 反代风险提示,并为重点内容添加锚点链接
|
||||
|
||||
---
|
||||
|
||||
## ⚠️ 风险提示
|
||||
|
||||
**Codex OAuth 反向代理免责声明**
|
||||
|
||||
本版本新增的 Codex OAuth 反向代理功能通过逆向工程的 OAuth 流程访问 ChatGPT Plus / Pro 的 Codex 服务。启用此功能前,请注意以下风险:
|
||||
|
||||
1. **违反服务条款**:使用逆向 OAuth 流程访问 OpenAI 服务可能违反 OpenAI 的服务条款,其中禁止未经授权的自动化访问、服务复制以及绕过既定的访问路径。
|
||||
2. **账号风险**:OpenAI 可能将异常使用模式标记为可疑的自动化行为,从而对 ChatGPT Plus / Pro 访问施加临时或永久限制。
|
||||
3. **无法保证长期可用**:OpenAI 可能随时更新其认证和检测机制,当前可用的使用方式未来可能被标记。
|
||||
|
||||
v3.12.3 引入的 **GitHub Copilot 反向代理**同样适用原有风险提示 —— 详见 [v3.12.3 release notes](v3.12.3-zh.md#️-风险提示)。
|
||||
|
||||
用户启用上述功能即表示**自行承担所有风险**。CC Switch 不对因使用这些功能而导致的任何账号限制、警告或服务暂停承担责任。
|
||||
|
||||
---
|
||||
|
||||
## 下载与安装
|
||||
|
||||
访问 [Releases](https://github.com/farion1231/cc-switch/releases/latest) 下载对应版本。
|
||||
|
||||
### 系统要求
|
||||
|
||||
| 系统 | 最低版本 | 架构 |
|
||||
| ------- | ----------------------------- | ----------------------------------- |
|
||||
| Windows | Windows 10 及以上 | x64 |
|
||||
| macOS | macOS 12 (Monterey) 及以上 | Intel (x64) / Apple Silicon (arm64) |
|
||||
| Linux | 见下表 | x64 |
|
||||
|
||||
### Windows
|
||||
|
||||
| 文件 | 说明 |
|
||||
| ------------------------------------------ | ----------------------------------- |
|
||||
| `CC-Switch-v3.13.0-Windows.msi` | **推荐** - MSI 安装包,支持自动更新 |
|
||||
| `CC-Switch-v3.13.0-Windows-Portable.zip` | 便携版,解压即用,不写入注册表 |
|
||||
|
||||
### macOS
|
||||
|
||||
| 文件 | 说明 |
|
||||
| ---------------------------------- | --------------------------------------------------------- |
|
||||
| `CC-Switch-v3.13.0-macOS.dmg` | **推荐** - DMG 安装包,拖入 Applications 即可 |
|
||||
| `CC-Switch-v3.13.0-macOS.zip` | 解压后拖入 Applications,Universal Binary |
|
||||
| `CC-Switch-v3.13.0-macOS.tar.gz` | 用于 Homebrew 安装和自动更新 |
|
||||
|
||||
> macOS 版本已通过 Apple 代码签名和公证,可直接安装使用。
|
||||
|
||||
### Homebrew(macOS)
|
||||
|
||||
```bash
|
||||
brew tap farion1231/ccswitch
|
||||
brew install --cask cc-switch
|
||||
```
|
||||
|
||||
更新:
|
||||
|
||||
```bash
|
||||
brew upgrade --cask cc-switch
|
||||
```
|
||||
|
||||
### Linux
|
||||
|
||||
| 发行版 | 推荐格式 | 安装方式 |
|
||||
| --------------------------------------- | ----------- | ---------------------------------------------------------------------- |
|
||||
| Ubuntu / Debian / Linux Mint / Pop!\_OS | `.deb` | `sudo dpkg -i CC-Switch-*.deb` 或 `sudo apt install ./CC-Switch-*.deb` |
|
||||
| Fedora / RHEL / CentOS / Rocky Linux | `.rpm` | `sudo rpm -i CC-Switch-*.rpm` 或 `sudo dnf install ./CC-Switch-*.rpm` |
|
||||
| openSUSE | `.rpm` | `sudo zypper install ./CC-Switch-*.rpm` |
|
||||
| Arch Linux / Manjaro | `.AppImage` | 添加执行权限后直接运行,或使用 AUR |
|
||||
| 其他发行版 / 不确定 | `.AppImage` | `chmod +x CC-Switch-*.AppImage && ./CC-Switch-*.AppImage` |
|
||||
@@ -12,9 +12,9 @@
|
||||
|
||||
## Version / 版本 / バージョン
|
||||
|
||||
- Documentation version: v3.13.0
|
||||
- Last updated: 2026-04-08
|
||||
- Compatible with CC Switch v3.13.0+
|
||||
- Documentation version: v3.12.0
|
||||
- Last updated: 2026-03-09
|
||||
- Compatible with CC Switch v3.12.0+
|
||||
|
||||
## Links
|
||||
|
||||
|
||||
@@ -131,9 +131,21 @@ brew upgrade --cask cc-switch
|
||||
2. Extract to get `CC Switch.app`
|
||||
3. Drag it to the Applications folder
|
||||
|
||||
### Signed and Notarized
|
||||
### First Launch Warning
|
||||
|
||||
CC Switch for macOS is signed and notarized by Apple. You can install and open it directly — no extra steps needed.
|
||||
Since the developer does not have an Apple Developer account, a "developer cannot be verified" warning may appear on first launch:
|
||||
|
||||
**Recommended solution**:
|
||||
Open Terminal and run the following command:
|
||||
```bash
|
||||
sudo xattr -dr com.apple.quarantine /Applications/CC\ Switch.app/
|
||||
```
|
||||
|
||||
**Alternative solution (via System Settings)**:
|
||||
1. Close the warning dialog
|
||||
2. Open "System Settings" > "Privacy & Security"
|
||||
3. Find the CC Switch prompt and click "Open Anyway"
|
||||
4. Reopen the app to use it normally
|
||||
|
||||
## Linux
|
||||
|
||||
|
||||
@@ -100,13 +100,10 @@ CC Switch displays an icon in the system tray, providing quick access to operati
|
||||
| Menu Item | Function |
|
||||
|-----------|----------|
|
||||
| Open Main Window | Show and focus the main window |
|
||||
| App Submenus | Collapsible submenus grouped by Claude/Codex/Gemini (e.g., "Claude · PackyCode") |
|
||||
| Provider List | Inside each submenu, click to switch; currently active shows a checkmark |
|
||||
| Lightweight Mode | Toggle checkbox to enter/exit tray-only mode |
|
||||
| App Groups | Providers grouped by Claude/Codex/Gemini/OpenCode/OpenClaw |
|
||||
| Provider List | Click to switch; currently active one shows a checkmark |
|
||||
| Quit | Fully exit the application |
|
||||
|
||||
> **Note**: Each app submenu title shows the current provider name (e.g., "Claude · PackyCode"). Apps with no configured providers show a disabled "(no providers)" entry. App visibility is controlled by the App Visibility setting.
|
||||
|
||||
### Multi-language Support
|
||||
|
||||
The tray menu supports three languages, automatically switching based on settings:
|
||||
@@ -117,17 +114,6 @@ The tray menu supports three languages, automatically switching based on setting
|
||||
| English | Open main window | Quit |
|
||||
| Japanese | Open main window | Quit |
|
||||
|
||||
### Lightweight Mode
|
||||
|
||||
The tray menu includes a **Lightweight Mode** toggle (checkbox). When enabled:
|
||||
|
||||
- The main window is closed to free up resources
|
||||
- The app continues running in the system tray only
|
||||
- You can still switch providers via the tray submenus
|
||||
- On macOS, the Dock icon is also hidden
|
||||
|
||||
To exit Lightweight Mode, uncheck the toggle or click "Open main window" — the main window will be rebuilt and shown.
|
||||
|
||||
### Use Cases
|
||||
|
||||
Switching providers via the tray menu doesn't require opening the main window, suitable for:
|
||||
@@ -135,7 +121,6 @@ Switching providers via the tray menu doesn't require opening the main window, s
|
||||
- Frequently switching providers
|
||||
- Quick operations when the main window is minimized
|
||||
- Managing configurations while running in the background
|
||||
- Running in Lightweight Mode for minimal resource usage
|
||||
|
||||
## Settings Page
|
||||
|
||||
|
||||
@@ -35,8 +35,6 @@ After switching providers, each CLI tool activates differently:
|
||||
| Claude Code | Instant effect (supports hot reload) |
|
||||
| Codex | Requires closing and reopening the terminal |
|
||||
| Gemini | Instant effect (re-reads config on each request) |
|
||||
| OpenCode | Requires closing and reopening the terminal |
|
||||
| OpenClaw | Requires closing and reopening the terminal |
|
||||
|
||||
### Claude Code First Launch Prompt
|
||||
|
||||
@@ -66,14 +64,6 @@ codex
|
||||
# Gemini - enter a test question after launching
|
||||
gemini
|
||||
> Hello, please briefly introduce yourself
|
||||
|
||||
# OpenCode - enter a test question after launching
|
||||
opencode
|
||||
> Hello, please briefly introduce yourself
|
||||
|
||||
# OpenClaw - enter a test question after launching
|
||||
openclaw
|
||||
> Hello, please briefly introduce yourself
|
||||
```
|
||||
|
||||
If the AI responds normally, the configuration is successful.
|
||||
|
||||
@@ -46,26 +46,6 @@ When enabled, CC Switch automatically runs when the system starts.
|
||||
|
||||
"Minimize to tray" is recommended for convenient provider switching via the tray.
|
||||
|
||||
### Lightweight Mode
|
||||
|
||||
Starting from v3.13.0, CC Switch adds **Lightweight Mode** — a **tray-only** running state that minimizes desktop footprint when idle.
|
||||
|
||||
**How to enter**: Right-click the tray icon → click **Lightweight Mode**. The main window is **destroyed** (not just hidden), freeing UI resources and memory.
|
||||
|
||||
**How to exit**: Click **Open Main Window** from the tray menu, or trigger CC Switch via deep link / relaunch. The window is **rebuilt on demand**, with state preserved.
|
||||
|
||||
| Aspect | Minimize to Tray | Lightweight Mode |
|
||||
|--------|------------------|------------------|
|
||||
| UI process | Kept in memory | Fully destroyed |
|
||||
| Idle resource footprint | Same as normal run | Near zero |
|
||||
| Reopen speed | Instant (direct show) | Slightly slower (window rebuild) |
|
||||
| Tray switching | Available | Available |
|
||||
| Deep link wake | Available | Available (on-demand rebuild) |
|
||||
|
||||
> **Use case**: If CC Switch runs in the background for long periods and you mainly switch providers via the tray menu, enabling Lightweight Mode significantly reduces memory usage.
|
||||
|
||||
> **Note**: Lightweight Mode state is not persistent — the next normal launch returns to normal mode. Combine with Launch on Startup for long-term use.
|
||||
|
||||
### Claude Plugin Integration
|
||||
|
||||
When enabled, CC Switch automatically syncs the configuration to the VS Code Claude Code extension (writes `primaryApiKey` to `~/.claude/config.json`) when switching providers.
|
||||
@@ -187,74 +167,37 @@ Import/export configuration backups. See the "Data Management" section above for
|
||||
|
||||
### Backup & Restore
|
||||
|
||||
The Backup Management panel provides full control over database backups.
|
||||
Manage automatic backups:
|
||||
|
||||
#### Auto-Backup Settings
|
||||
| Setting | Description |
|
||||
|---------|-------------|
|
||||
| Backup Interval | Time interval for automatic backups (hours) |
|
||||
| Retention Count | Number of backups to retain |
|
||||
|
||||
| Setting | Options | Default |
|
||||
|---------|---------|---------|
|
||||
| Backup Interval | Disabled, 6h, 12h, 24h, 48h, 7d | 24 hours |
|
||||
| Retention Count | 3, 5, 10, 15, 20, 30, 50 | 10 backups |
|
||||
|
||||
When an interval is set, CC Switch automatically backs up the database on schedule. Older backups beyond the retention count are automatically removed.
|
||||
|
||||
#### Backup List
|
||||
|
||||
The panel displays all existing backups with:
|
||||
- **Display name** (auto-generated from timestamp, e.g., `db_backup_20260315_143000`)
|
||||
- **Creation time**
|
||||
- **File size** (e.g., "1.5 MB")
|
||||
|
||||
#### Backup Operations
|
||||
|
||||
| Action | Description |
|
||||
|--------|-------------|
|
||||
| **Backup Now** | Create a backup immediately |
|
||||
| **Restore** | Restore the database from a selected backup. A safety backup of the current database is created automatically before restoring |
|
||||
| **Rename** | Change the backup's display name |
|
||||
| **Delete** | Permanently remove a backup (with confirmation) |
|
||||
|
||||
> **Important**: Restoring a backup overwrites the current database. A safety backup is always created before the restore operation, so you can recover if needed.
|
||||
Supports viewing the backup list and restoring from backups.
|
||||
|
||||
### Cloud Sync (WebDAV)
|
||||
|
||||
Sync configurations across multiple devices via the WebDAV protocol. Uses **v2 protocol** with dual-layer versioning for improved reliability.
|
||||
Sync configurations across multiple devices via the WebDAV protocol.
|
||||
|
||||
| Setting | Description |
|
||||
|---------|-------------|
|
||||
| Service Preset | Jianguoyun / Nextcloud / Synology / Custom |
|
||||
| Server URL | WebDAV server URL |
|
||||
| Username | Login username |
|
||||
| Password | Login password (app-specific password; saved credentials are preserved if left unchanged) |
|
||||
| Password | Login password (app-specific password) |
|
||||
| Remote Directory | Remote storage path (default: `cc-switch-sync`) |
|
||||
| Profile Name | Device profile name (default: `default`) |
|
||||
| Auto Sync | Enable automatic synchronization on a configurable interval |
|
||||
| Auto Sync | Automatically upload changes when enabled |
|
||||
|
||||
#### Operations
|
||||
Operations:
|
||||
|
||||
| Action | Description |
|
||||
|--------|-------------|
|
||||
| **Test Connection** | Verify WebDAV URL, username, and password are valid |
|
||||
| **Upload** | Upload local database to remote. Shows progress spinner |
|
||||
| **Download** | Download remote database. Shows remote snapshot info (protocol version, DB version, timestamp, size) before confirming. A safety backup of the local database is created automatically before overwriting |
|
||||
- **Test Connection**: Verify WebDAV configuration is correct
|
||||
- **Save**: Save configuration and auto-test
|
||||
- **Upload**: Upload local data to the remote server
|
||||
- **Download**: Download data from the remote server to local
|
||||
|
||||
#### Auto-Sync
|
||||
|
||||
When **Auto Sync** is enabled:
|
||||
- A confirmation dialog is shown on first activation
|
||||
- CC Switch automatically syncs the database to WebDAV at the configured interval
|
||||
- Sync status is displayed in the panel
|
||||
|
||||
#### Remote Snapshot Info
|
||||
|
||||
Before downloading, CC Switch displays details about the remote snapshot:
|
||||
- Protocol version (v2)
|
||||
- Database compatibility version
|
||||
- Timestamp of the remote backup
|
||||
- File size
|
||||
- Compatibility status (warning if incompatible)
|
||||
|
||||
> **Note**: Upload overwrites remote data, and download overwrites local data. A safety backup is always created before downloading.
|
||||
> **Note**: Upload will overwrite remote data, and download will overwrite local data. Please confirm before proceeding.
|
||||
|
||||
### Log Configuration
|
||||
|
||||
@@ -271,26 +214,6 @@ Log level descriptions:
|
||||
- **debug** - Detailed debugging information
|
||||
- **trace** - All verbose information
|
||||
|
||||
## OAuth Auth Center (Beta)
|
||||
|
||||
Settings > **OAuth Auth Center** Tab
|
||||
|
||||
Added in v3.13.0, the **OAuth Auth Center** (Beta) provides unified management for third-party OAuth credentials. It currently supports two account types:
|
||||
|
||||
| Account Type | Purpose |
|
||||
| ------------------------- | ---------------------------------------------------------- |
|
||||
| **GitHub Copilot** | Used with the Copilot reverse proxy |
|
||||
| **ChatGPT (Codex OAuth)** | Used with the Codex OAuth reverse proxy; manage ChatGPT accounts |
|
||||
|
||||
**What you can do here**:
|
||||
|
||||
- Log in to ChatGPT / GitHub accounts via the Device Code flow
|
||||
- View the list of logged-in accounts and authentication status
|
||||
- Set a default account when managing multiple accounts
|
||||
- Remove individual accounts or log out all accounts at once
|
||||
|
||||
> **Note**: Both features use reverse-engineered OAuth flows and carry account risk and Terms of Service risk. Before using, please read the full risk notice in [2.1 Add Provider → Codex OAuth Reverse Proxy](../2-providers/2.1-add.md#codex-oauth-reverse-proxy-claude-provider).
|
||||
|
||||
## About Page
|
||||
|
||||
Settings > About Tab
|
||||
|
||||
@@ -152,23 +152,6 @@ Presets are pre-configured provider templates that only require an API Key to us
|
||||
| AWS Bedrock | AWS Bedrock service |
|
||||
| OpenAI Compatible | OpenAI-compatible interface |
|
||||
|
||||
## Auto-Fetch Models
|
||||
|
||||
When adding or editing a provider, you can automatically discover available models from the provider's endpoint — eliminating the tedious copy-and-paste of model IDs.
|
||||
|
||||
1. Ensure the **API Key** and **Endpoint URL** are filled in
|
||||
2. Click the **Fetch Models** button (download icon) next to the model input field
|
||||
3. CC Switch uses the configured API Key to call the OpenAI-compatible `/v1/models` endpoint
|
||||
4. Select a model from the dropdown, grouped by category
|
||||
|
||||
This feature covers **all five apps** — **Claude / Codex / Gemini / OpenCode / OpenClaw** — and works for any provider that supports the `/v1/models` endpoint.
|
||||
|
||||
**Common errors:**
|
||||
- **Authentication failed (401/403)**: Check your API Key
|
||||
- **Endpoint not supported (404/405)**: The provider does not expose a `/v1/models` endpoint; fall back to manual model ID entry
|
||||
- **Parse failure**: The response does not match the OpenAI-compatible format
|
||||
- **Timeout**: The endpoint is slow to respond; try again later or check your network
|
||||
|
||||
## Custom Configuration
|
||||
|
||||
After selecting the "Custom" preset, you need to manually edit the JSON configuration.
|
||||
@@ -331,200 +314,8 @@ Batch import from SQL backup files:
|
||||
|
||||
> **Note**: Importing will overwrite the existing database. It is recommended to export your current configuration as a backup first. The exported file name format is `cc-switch-export-{timestamp}.sql`.
|
||||
|
||||
## Codex OAuth Reverse Proxy (Claude Provider)
|
||||
|
||||
Starting from v3.13.0, CC Switch adds a **Codex OAuth reverse proxy** path that lets you reuse your ChatGPT account's Codex service inside Claude Code.
|
||||
|
||||
> **Location hint**: This feature appears as a **new Claude provider card type**, not as a Codex-side preset. Once added, it sits alongside regular API-Key providers in the Claude provider list.
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- A **ChatGPT account** you can log in to
|
||||
- Network access to `auth.openai.com` and `chatgpt.com`
|
||||
- **Before using, please read the [⚠️ Risk Notice](#️-risk-notice-important) at the end of this section**
|
||||
|
||||
### Two Entry Points
|
||||
|
||||
You can start from either entry point:
|
||||
|
||||
#### Entry A: From the Add Provider panel (recommended for new users)
|
||||
|
||||
1. Switch to the **Claude** app
|
||||
2. Click the **+** button in the top-right to open the Add Provider panel
|
||||
3. Under the third-party category, select the **Codex (ChatGPT Plus/Pro)** preset (use the name as shown in the UI)
|
||||
4. If no ChatGPT account is logged in yet, the panel **automatically guides** you into the login flow (see "Login Flow" below)
|
||||
5. After login succeeds, the provider form shows the logged-in account — click **Save** to finish
|
||||
|
||||
#### Entry B: From the OAuth Auth Center (better for multi-account management)
|
||||
|
||||
1. Open **Settings → OAuth Auth Center** (tab marked with a **Beta** label)
|
||||
2. In the **ChatGPT (Codex OAuth)** section, click **Log in with ChatGPT**
|
||||
3. Complete the login flow (see below)
|
||||
4. Once logged in, return to the **Claude** app → **Add Provider** → select the same Codex (ChatGPT Plus/Pro) preset
|
||||
5. In the form's **Select Account** dropdown, choose the account you just logged in and save
|
||||
|
||||
### Login Flow (Device Code)
|
||||
|
||||
No matter which entry point you use, the login flow is the same:
|
||||
|
||||
1. **Get the verification code**: CC Switch invokes OpenAI's Device Code flow and displays:
|
||||
- An **8-character verification code** (e.g., `ABCD-1234`)
|
||||
- A **Copy** button next to the code
|
||||
- The authorization URL `https://auth.openai.com/codex/device`
|
||||
- An "Waiting for authorization..." animation
|
||||
2. **Browser authorization**: Click the link (or manually visit the URL) and in the browser:
|
||||
- Log in to your ChatGPT account
|
||||
- Enter the verification code you copied
|
||||
- Confirm authorization
|
||||
3. **Automatic polling**: CC Switch keeps polling the OpenAI server in the background and closes the waiting UI once authorization succeeds
|
||||
4. **Account appears in the list**: The logged-in ChatGPT account (login email) shows up in **OAuth Auth Center → Logged-in Accounts**
|
||||
|
||||
> ⏱️ **Verification codes are valid for about 15 minutes**. If it expires, the UI shows "Device Code has expired" — click **Retry** to get a new one.
|
||||
|
||||
### Enable and Use
|
||||
|
||||
After adding and saving a Codex OAuth provider:
|
||||
|
||||
1. Find it in the Claude provider list
|
||||
2. Click the **Enable** button on the card — same as any regular provider
|
||||
3. Claude Code CLI then uses the reverse proxy to access the Codex service
|
||||
4. The provider also appears in the tray menu's **Claude** submenu for quick switching
|
||||
|
||||
> **Under the hood**: CC Switch routes requests to `https://chatgpt.com/backend-api/codex`, with the base URL forcibly rewritten — you **do not** need to manually fill in the endpoint. The API format is fixed to `openai_responses`.
|
||||
|
||||
### Default Models
|
||||
|
||||
The Codex OAuth preset's default model mapping:
|
||||
|
||||
| Role | Default Model |
|
||||
| -------------- | ------------- |
|
||||
| Main model | `gpt-5.4` |
|
||||
| Sonnet role | `gpt-5.4` |
|
||||
| Opus role | `gpt-5.4` |
|
||||
| Haiku role | `gpt-5.4-mini` |
|
||||
|
||||
You can override the `ANTHROPIC_MODEL` and related environment variables in the provider's JSON editor to customize.
|
||||
|
||||
### Multi-Account Management (OAuth Auth Center)
|
||||
|
||||
The **OAuth Auth Center** supports managing multiple ChatGPT accounts at the same time:
|
||||
|
||||
| Action | Description |
|
||||
| ---------------------- | ----------------------------------------------------------------- |
|
||||
| Add another account | Click **Add Another Account** to repeat the login flow |
|
||||
| Set as default | Click **Set as Default** on an account row — new providers use it |
|
||||
| Choose for a provider | In the provider form, use the **Select Account** dropdown |
|
||||
| Remove account | Click the red × next to an account (the token is cleared) |
|
||||
| Log out all accounts | The **Log Out All Accounts** button at the bottom clears all |
|
||||
|
||||
> **Use case**: If you share a dev machine with teammates, create one provider per member's ChatGPT account and switch between them via the tray menu.
|
||||
|
||||
### Token Auto-Refresh
|
||||
|
||||
- Tokens are **automatically refreshed 60 seconds before expiry**, fully in the background — no manual action required
|
||||
- Refresh tokens are stored in the local data directory and are never uploaded anywhere
|
||||
- **Token export is not supported** (to prevent leaks)
|
||||
|
||||
### Quota Display
|
||||
|
||||
After login and enabling the provider, the **bottom of the provider card** automatically shows the account quota:
|
||||
|
||||
| Display Element | Example | Color Rules |
|
||||
| ------------------- | ---------------- | -------------------------------------------- |
|
||||
| Usage percentage | `45%` | < 70% green, 70–89% orange, ≥ 90% red |
|
||||
| Reset countdown | `7d12h until reset` | ChatGPT account's sliding window or daily limit |
|
||||
| Refresh button | Circular arrow | Manually re-query quota |
|
||||
|
||||
> ⚠️ **Session Expired**: If the token fails to refresh, the card displays a yellow "Session Expired" warning. Go to the **OAuth Auth Center**, remove the account, and log in again.
|
||||
|
||||
### Common Failures
|
||||
|
||||
| Scenario | Symptom | Resolution |
|
||||
| --------------------------- | -------------------------------- | ------------------------------------------- |
|
||||
| Verification code timeout | "Device Code has expired" shown | Click **Retry** to get a new code |
|
||||
| Authorization denied | "User denied authorization" | Retry and click "Authorize" in the browser |
|
||||
| Network error | Specific error details shown | Check network, confirm access to OpenAI domains |
|
||||
| Not logged in before adding | "Please log in to ChatGPT first" | Complete login in OAuth Auth Center first |
|
||||
| Token refresh failed | "Session Expired" in quota box | Remove the account and log in again |
|
||||
| Quota query failed | "Query failed" in quota box | Click the **Refresh** button to retry |
|
||||
|
||||
### ⚠️ Risk Notice (Important)
|
||||
|
||||
The Codex OAuth reverse proxy accesses your ChatGPT account's Codex service through a **reverse-engineered OAuth flow**. Before enabling, please make sure you understand the following risks:
|
||||
|
||||
1. **Terms of Service violations**: May violate OpenAI's Terms of Service, which prohibit unauthorized automated access, service replication, and bypassing established access paths
|
||||
2. **Account risk**: OpenAI may flag unusual usage patterns as suspicious automation and impose temporary or permanent restrictions on your ChatGPT account
|
||||
3. **No guarantee of long-term availability**: OpenAI may update its authentication and detection mechanisms at any time, and currently available methods may be blocked in the future
|
||||
|
||||
**By enabling this feature, you assume all risks**. CC Switch is not responsible for any account restrictions, warnings, or service suspensions resulting from its use.
|
||||
|
||||
> 📖 See the full disclaimer and background in the [v3.13.0 Release Notes](../../../release-notes/v3.13.0-en.md#️-risk-notice).
|
||||
|
||||
## Advanced Options
|
||||
|
||||
### API Format (Claude Only)
|
||||
|
||||
When adding a Claude provider that uses a third-party API, you may need to select the correct **API Format** in the Advanced Options section:
|
||||
|
||||
| Format | Description | When to Use |
|
||||
|--------|-------------|-------------|
|
||||
| **Anthropic Messages** | Native Anthropic API format (default) | Direct Anthropic API or compatible proxies |
|
||||
| **OpenAI Chat Completions** | OpenAI Chat API format, auto-converted by proxy | Provider only supports OpenAI Chat format |
|
||||
| **OpenAI Responses API** | OpenAI Responses API format, auto-converted by proxy | Provider only supports OpenAI Responses format |
|
||||
|
||||
> **Note**: API format conversion is handled by the proxy service. When using non-Anthropic formats, the proxy must be running with takeover enabled for correct request/response conversion. See [4.1 Proxy Service](../4-proxy/4.1-service.md) for details.
|
||||
|
||||
The Advanced Options section auto-expands when a non-default API format is configured.
|
||||
|
||||
### Full URL Endpoint Mode
|
||||
|
||||
Added in v3.13.0. By default, CC Switch treats the configured `base_url` as a **prefix** and appends fixed paths like `/v1/chat/completions`. For some vendors (such as third-party services with non-standard URL layouts), this path concatenation causes requests to fail.
|
||||
|
||||
**How to enable**:
|
||||
|
||||
1. Edit the provider and expand **Advanced Options**
|
||||
2. Check the **Full URL Mode** checkbox
|
||||
3. Fill in the **complete upstream endpoint** (not a prefix) as `base_url`
|
||||
|
||||
**Example comparison**:
|
||||
|
||||
| Mode | `base_url` value | Actual request target |
|
||||
| ------------------------- | ------------------------------------------------ | ------------------------------------------------ |
|
||||
| Default (prefix concat) | `https://api.example.com` | `https://api.example.com/v1/chat/completions` |
|
||||
| **Full URL Mode** | `https://api.example.com/custom/path/messages` | `https://api.example.com/custom/path/messages` |
|
||||
|
||||
**When to use**:
|
||||
- The vendor requires a non-standard path (not `/v1/chat/completions`)
|
||||
- The vendor has a multi-level path structure
|
||||
- Vendor-specific API gateway paths
|
||||
|
||||
> **Note**: Both proxy forwarding and Stream Check respect the Full URL Mode setting, so no extra adjustments are needed after enabling. Disabling this option restores default path concatenation.
|
||||
|
||||
### Claude Common Config Toggles
|
||||
|
||||
When editing Claude providers, a set of **quick toggles** is available above the JSON editor:
|
||||
|
||||
| Toggle | Effect | Config Change |
|
||||
|--------|--------|---------------|
|
||||
| **Hide Attribution** | Clears commit/PR attribution metadata | Sets `attribution: {commit: "", pr: ""}` |
|
||||
| **Enable Teammates** | Enables the agent teams feature | Sets `env.CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS = "1"` |
|
||||
| **Enable Tool Search** | Enables tool search functionality | Sets `env.ENABLE_TOOL_SEARCH = "true"` |
|
||||
| **High Effort** | Sets effort level to high | Sets `effortLevel = "high"` |
|
||||
| **Disable Auto Upgrade** | Prevents Claude Code auto-updates | Sets `env.DISABLE_AUTOUPDATER = "1"` |
|
||||
|
||||
When a toggle is unchecked, its corresponding config entry is removed entirely. Changes are reflected in the JSON editor in real-time.
|
||||
|
||||
Additionally, the **Write Common Config** checkbox enables merging a global config snippet into the provider. Click **Edit Common Config** to customize the shared snippet.
|
||||
|
||||
### Codex 1M Context Window
|
||||
|
||||
When adding a Codex provider, an **Enable 1M Context Window** toggle is available:
|
||||
|
||||
- **When enabled**: Sets `model_context_window = 1000000` and auto-fills `model_auto_compact_token_limit = 900000` in config.toml
|
||||
- **When disabled**: Removes both fields
|
||||
|
||||
The auto-compact limit can be customized in the text field that appears when the toggle is on.
|
||||
|
||||
### Custom Icon
|
||||
|
||||
Click the icon area to the left of the name to:
|
||||
|
||||
@@ -26,30 +26,12 @@ Quickly switch providers via the system tray without opening the main interface.
|
||||
### Steps
|
||||
|
||||
1. Right-click the CC Switch icon in the system tray
|
||||
2. Hover over the corresponding app submenu (e.g., "Claude · CurrentProvider")
|
||||
2. Find the corresponding app (Claude/Codex/Gemini/OpenCode) in the menu
|
||||
3. Click the provider name you want to switch to
|
||||
4. Switching completes with a brief tray notification
|
||||
|
||||
### Tray Menu Structure
|
||||
|
||||
Starting from v3.13.0, the tray menu is refactored from a flat list into **per-app submenus**, with a dedicated submenu for each app:
|
||||
|
||||
| Submenu | Description |
|
||||
| ---------- | -------------------------------------------------------------- |
|
||||
| Claude | All Claude providers (including Codex OAuth reverse proxy) |
|
||||
| Codex | All Codex providers |
|
||||
| Gemini | All Gemini providers |
|
||||
| OpenCode | All OpenCode providers |
|
||||
| OpenClaw | All OpenClaw providers |
|
||||
|
||||
**Benefits of the refactor**:
|
||||
|
||||
- **Prevents menu overflow**: With many providers, a flat list would exceed screen height; per-app submenus scale naturally
|
||||
- **Submenu title shows the currently active provider**: You know at a glance which provider each app is using, without opening the submenu
|
||||
- **Per-app isolation**: Switching Claude's provider doesn't disturb the Codex view
|
||||
|
||||
> **Tip**: The combination of background residency + Lightweight Mode + per-app submenus is especially suited for heavy users who frequently switch among multiple apps. See [1.5 Personalization → Lightweight Mode](../1-getting-started/1.5-settings.md).
|
||||
|
||||

|
||||
|
||||
## Activation Methods
|
||||
|
||||
@@ -52,20 +52,6 @@ When editing the currently active provider, a special "backfill" mechanism appli
|
||||
|
||||
This ensures CC Switch and CLI tool configurations stay in sync.
|
||||
|
||||
## Auto-Fetch Models
|
||||
|
||||
When editing a provider, you can auto-fetch the available model list from the provider's endpoint:
|
||||
|
||||
1. Ensure the API Key and endpoint URL are filled in
|
||||
2. Click the **Fetch Models** button (download icon) next to the model input field
|
||||
3. Select a model from the grouped dropdown
|
||||
|
||||
See [2.1 Add Provider — Auto-Fetch Models](./2.1-add.md#auto-fetch-models) for full details.
|
||||
|
||||
## Common Config Toggles (Claude)
|
||||
|
||||
When editing a Claude provider, quick toggle switches are available above the JSON editor for common settings like Tool Search, Disable Auto Upgrade, Teammates, and High Effort. See [2.1 Add Provider — Claude Common Config Toggles](./2.1-add.md#claude-common-config-toggles) for details.
|
||||
|
||||
## Modify API Key
|
||||
|
||||
When editing a provider, you can modify the key directly in the **API Key** input field:
|
||||
|
||||
@@ -1,72 +1,8 @@
|
||||
# 2.5 Usage Query
|
||||
|
||||
CC Switch's quota / balance display is split into two categories: **Auto Query** (official subscription types, works out of the box) and **Manual Enable** (built-in templates + custom scripts, requires user configuration before showing).
|
||||
## Overview
|
||||
|
||||
| Category | Scope | User Enable Required |
|
||||
| ------------------------------ | -------------------------------------------------------------------------- | -------------------- |
|
||||
| **Auto Query** | Claude / Codex / Gemini official subscriptions, GitHub Copilot, Codex OAuth reverse proxy | No (enabled by default) |
|
||||
| **Manual Enable (built-in templates)** | Token Plan, third-party balance query | Yes (see below) |
|
||||
| **Manual Enable (custom script)** | Proxies, private deployments, special APIs not covered by built-in templates | Yes (see below) |
|
||||
|
||||
## Auto Query (Official Subscription Types)
|
||||
|
||||
Starting from v3.13.0, the following three categories automatically display the quota at the bottom of the provider card after the provider is enabled — no additional configuration required:
|
||||
|
||||
| Category | Covered Providers | Displayed Content |
|
||||
| ---------------- | ----------------------------------------------------- | ----------------------------------------- |
|
||||
| Official subscriptions | Claude / Codex / Gemini official login | Official subscription quota |
|
||||
| GitHub Copilot | Copilot provider card | Premium interactions remaining |
|
||||
| Codex OAuth | Codex OAuth reverse proxy card (Claude provider) | ChatGPT account Codex quota |
|
||||
|
||||
These three share the common trait that **their data source is unique and semantically unambiguous** (the usage rate of an official subscription), so CC Switch directly calls the corresponding official or OAuth query endpoint.
|
||||
|
||||
### Auto Query Interactions
|
||||
|
||||
- **Card footer display**: Usage percentage + reset countdown, colored by usage (< 70% green / 70–89% orange / ≥ 90% red)
|
||||
- **Manual refresh**: Click the refresh icon on the card to re-query
|
||||
- **Simplified card**: For these three types, the **Health Check** and **Usage Query Config** buttons are hidden to avoid interfering with the built-in display
|
||||
- **Session expired notice**: If a token fails to refresh, the card shows a yellow "Session Expired" warning (Copilot / Codex OAuth)
|
||||
|
||||
---
|
||||
|
||||
## Manual Enable (Built-in Templates + Custom Scripts)
|
||||
|
||||
Besides the three auto-query types above, **all other providers** (including Token Plan, third-party balance queries, and various proxy services) need to have the **Usage Query** switch manually turned on in the provider card before any quota is displayed.
|
||||
|
||||
### Why do these need manual enabling?
|
||||
|
||||
One important reason: **the same request URL (same vendor) may expose multiple query modes** — for example, both plan-based quota queries and account-level balance queries. CC Switch cannot automatically infer which one you want, so the built-in query for such providers is **disabled by default**, leaving you to pick the right template.
|
||||
|
||||
### Built-in Template Coverage
|
||||
|
||||
v3.13.0 provides **ready-to-use built-in templates** for the following categories — no script writing required:
|
||||
|
||||
| Category | Covered Providers | Template Type |
|
||||
| ------------------ | --------------------------------------------------------- | ------------------------------- |
|
||||
| Token Plan | Kimi / Zhipu GLM / MiniMax | Plan quota (with usage progress) |
|
||||
| Third-party balance| DeepSeek / StepFun / SiliconFlow / OpenRouter / Novita AI | Official balance query |
|
||||
|
||||
> **Tip**: Beyond these built-in templates, for uncovered providers you can use the **custom script** approach (see below) to write your own query logic.
|
||||
|
||||
### Enable Steps
|
||||
|
||||
1. Hover over the provider card to reveal action buttons
|
||||
2. Click the **Usage Query** button (chart icon)
|
||||
3. At the top of the configuration panel, toggle on **Enable Usage Query**
|
||||
4. Select the right built-in template (e.g., Token Plan, third-party balance) or choose "Custom"
|
||||
5. Fill in API Key / Base URL / Access Token as needed (most cases can be left blank, reusing the provider's own credentials)
|
||||
6. Click **Test Script** to verify the query returns successfully
|
||||
7. Save — next time the provider is activated, the quota will show up at the bottom of the card
|
||||
|
||||
> ⚠️ **Note**: The auto-refresh interval after enabling is controlled by the "Auto Query Interval" field (set to `0` to disable auto-refresh). Background queries only trigger when the provider is in "Currently Active" state.
|
||||
|
||||
---
|
||||
|
||||
## Custom Script Query (Advanced)
|
||||
|
||||
### Overview
|
||||
|
||||
When a provider **is not covered by the built-in templates**, you can write a custom JavaScript query script. Suitable for proxy services, private deployments, special API formats, etc.
|
||||
The usage query feature allows you to configure custom scripts to query a provider's remaining balance, used amount, and other information in real time.
|
||||
|
||||
**Use cases**:
|
||||
- Check API account remaining balance
|
||||
@@ -219,24 +155,6 @@ The following placeholders can be used in scripts and are automatically replaced
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
### Auto Query Not Displayed (Official Subscription Types)
|
||||
|
||||
**Check**:
|
||||
1. Confirm the provider is an official subscription type — Claude / Codex / Gemini official login, GitHub Copilot, or Codex OAuth reverse proxy
|
||||
2. The provider is in "Currently Active" state (inactive providers do not trigger queries)
|
||||
3. For OAuth types (Copilot / Codex OAuth), check whether the token is still valid; if the card shows "Session Expired", log in again in the **OAuth Auth Center**
|
||||
4. Network access to the official quota endpoint
|
||||
|
||||
### Manual Enable Still Not Showing Quota
|
||||
|
||||
**Check**:
|
||||
1. Whether the **Enable Usage Query** toggle at the top of the "Usage Query" panel is on
|
||||
2. Whether a suitable built-in template (Token Plan / third-party balance / custom) is selected
|
||||
3. Click **Test Script** to see the specific error
|
||||
4. Required fields such as API Key / Base URL are filled correctly
|
||||
5. Network access to the provider's quota endpoint
|
||||
6. Background auto-refresh only triggers when the provider is in "Currently Active" state
|
||||
|
||||
### Query Failed
|
||||
|
||||
**Check**:
|
||||
|
||||
@@ -118,27 +118,8 @@ Installation copies the skill folder to your local machine:
|
||||
|
||||
### Uninstall Effect
|
||||
|
||||
- **Automatic backup**: Before deletion, the skill is backed up to `~/.cc-switch/skill-backups/`
|
||||
- Removes the skill from all app directories (Claude, Codex, Gemini, OpenCode)
|
||||
- Removes the skill from the SSOT directory (`~/.cc-switch/skills/`)
|
||||
- Deletes the skill record from the database
|
||||
|
||||
### Restore from Backup
|
||||
|
||||
If you need to restore a previously uninstalled skill:
|
||||
|
||||
1. Open the Skills page
|
||||
2. Click the **Restore from Backup** button
|
||||
3. Select the backup you want to restore from the list (shows skill name and backup date)
|
||||
4. The skill is restored and enabled for the current app
|
||||
|
||||
### Delete Backups
|
||||
|
||||
To remove old skill backups:
|
||||
|
||||
1. In the restore dialog, find the backup you want to remove
|
||||
2. Click the **Delete** button next to the backup entry
|
||||
3. Confirm deletion — this cannot be undone
|
||||
- Deletes the local skill folder
|
||||
- Updates installation status
|
||||
|
||||
## Repository Management
|
||||
|
||||
@@ -192,59 +173,11 @@ Each skill card displays:
|
||||
|
||||
## Skill Updates
|
||||
|
||||
Starting from v3.13.0, Skills support **automatic update detection** and **batch updates** — no more uninstall-and-reinstall.
|
||||
Automatic updates are not currently supported. To update a skill:
|
||||
|
||||
### Update Detection Mechanism
|
||||
|
||||
CC Switch compares installed skills with the remote repository version using **SHA-256 content hashes**. Whenever the remote has any content changes, the corresponding local skill card automatically shows an "Update available" indicator.
|
||||
|
||||
### Single Update
|
||||
|
||||
For a skill with an available update:
|
||||
|
||||
1. Find the skill card with the update indicator in the Skills panel
|
||||
2. Click the **Update** button on the card
|
||||
3. Wait for the download to finish — status refreshes automatically
|
||||
|
||||
### Update All
|
||||
|
||||
When multiple skills need updating:
|
||||
|
||||
1. Click the **Update All** button at the top of the Skills panel (appears with a slide-in animation)
|
||||
2. CC Switch batch-downloads all skills with pending updates
|
||||
3. The panel refreshes automatically when done, and the update indicators disappear
|
||||
|
||||
> **Tip**: Regularly click the **Refresh** button to trigger a remote scan so update detection stays current.
|
||||
|
||||
## Storage Location Switch
|
||||
|
||||
Starting from v3.13.0, the **source storage location** for skills can be switched between two locations:
|
||||
|
||||
| Location | Description |
|
||||
| ------------------------ | --------------------------------------------------------------------- |
|
||||
| **CC Switch built-in** | Default location `~/.cc-switch/skills/`, managed by CC Switch |
|
||||
| **`~/.agents/skills`** | A shared directory conforming to community agent tool conventions, better for cross-tool collaboration |
|
||||
|
||||
### How to Switch
|
||||
|
||||
Select the target storage location from the settings or management menu in the Skills panel. The switch **does not lose skill state** — CC Switch smoothly migrates existing skills to the new location.
|
||||
|
||||
> ⚠️ **Distinction**: The "Storage Location Switch" here manages the **source storage** of skills. In contrast, [1.5 Personalization → Skill Sync Method](../1-getting-started/1.5-settings.md) controls how skills are **distributed to each app's directory** (symlink vs. copy). The two settings work together.
|
||||
|
||||
## Public Registry Search (skills.sh)
|
||||
|
||||
v3.13.0 integrates **skills.sh** public registry search so you can discover community skills directly inside CC Switch.
|
||||
|
||||
### How to Use
|
||||
|
||||
1. Click the **Repository Management** button to open the dialog
|
||||
2. Use the **skills.sh Search** input inside the dialog
|
||||
3. Type keywords to filter results in real time
|
||||
4. Click a target skill to quickly add it to your repository list
|
||||
|
||||
v3.13.0 also fixes broken link and empty description handling for skills.sh, so community skill metadata is displayed more reliably.
|
||||
|
||||
## Troubleshooting
|
||||
1. Uninstall the existing skill
|
||||
2. Refresh the list
|
||||
3. Reinstall
|
||||
|
||||
### Empty Skill List
|
||||
|
||||
@@ -272,15 +205,3 @@ Solutions:
|
||||
- Check network connection
|
||||
- Check disk space
|
||||
- Check directory permissions
|
||||
|
||||
### Update Button Not Showing
|
||||
|
||||
Possible causes:
|
||||
|
||||
- The remote repository has no new content
|
||||
- CC Switch has not finished the latest scan
|
||||
|
||||
Solutions:
|
||||
|
||||
- Click **Refresh** to rescan
|
||||
- Confirm the repository configuration points to the right branch and path
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
# 3.4 Session Manager
|
||||
|
||||
The Session Manager lets you browse, search, and manage conversation sessions from all supported CLI tools in one place.
|
||||
|
||||
## Supported Applications
|
||||
|
||||
| Application | Session Storage Location |
|
||||
|-------------|--------------------------|
|
||||
| Claude Code | `~/.cache/claude/projects/*.jsonl` |
|
||||
| Codex | Codex config sessions directory |
|
||||
| OpenCode | `~/.local/share/opencode/` (JSON or SQLite) |
|
||||
| OpenClaw | `~/.openclaw/agents/<agent>/sessions/*.jsonl` |
|
||||
| Gemini CLI | `~/.cache/gemini/tmp/<project_hash>/chats/` |
|
||||
|
||||
## Opening the Session Manager
|
||||
|
||||
Click the **Sessions** button in the main navigation bar toolbar.
|
||||
|
||||
> **Note**: The Sessions button is visible for all five supported applications.
|
||||
|
||||
## Interface Layout
|
||||
|
||||
The Session Manager uses a **two-column layout**:
|
||||
|
||||
- **Left panel**: Session list with search and filter toolbar
|
||||
- **Right panel**: Selected session details with conversation history
|
||||
|
||||
### Session List (Left Panel)
|
||||
|
||||
Each session entry displays:
|
||||
- Provider icon
|
||||
- Session title
|
||||
- Last active time (relative format, e.g., "5 min ago")
|
||||
|
||||
### Session Details (Right Panel)
|
||||
|
||||
When a session is selected, the right panel shows:
|
||||
- **Title**: Derived from session title, project directory name, or session ID
|
||||
- **Last active date/time**: Full timestamp
|
||||
- **Project directory**: Clickable to copy full path (shows basename with tooltip for full path)
|
||||
- **Resume command**: Displayed in monospace style when available
|
||||
- **Conversation history**: Full message transcript
|
||||
|
||||
## Search & Filtering
|
||||
|
||||
### Full-Text Search
|
||||
|
||||
Use the search box at the top of the left panel to search across:
|
||||
- Session ID
|
||||
- Title
|
||||
- Summary
|
||||
- Project directory
|
||||
- Source file path
|
||||
|
||||
The search supports prefix matching and filters results in real-time. Press **Esc** to clear the search.
|
||||
|
||||
### Provider Filtering
|
||||
|
||||
Click the provider filter dropdown (top-right of left panel) to filter by application:
|
||||
- **All** — Show sessions from all providers
|
||||
- **Claude Code**
|
||||
- **Codex**
|
||||
- **OpenCode**
|
||||
- **OpenClaw**
|
||||
- **Gemini CLI**
|
||||
|
||||
The filter can be combined with search.
|
||||
|
||||
### Refresh
|
||||
|
||||
Click the refresh button (circular arrow icon) to re-scan all provider directories for new or deleted sessions.
|
||||
|
||||
## Session Actions
|
||||
|
||||
### Resume Session
|
||||
|
||||
Click the **Resume** button (play icon) on a selected session to continue the conversation.
|
||||
|
||||
**On macOS:**
|
||||
- CC Switch launches your preferred terminal with the resume command
|
||||
- The terminal opens in the session's project directory
|
||||
- If terminal launch fails, the command is copied to your clipboard instead
|
||||
|
||||
**Supported terminals (macOS):** Terminal.app, iTerm2, Ghostty, Kitty, WezTerm, Alacritty
|
||||
|
||||
**On other platforms:**
|
||||
- The resume command is copied to your clipboard
|
||||
- Paste it into your terminal to resume
|
||||
|
||||
> The Resume button is disabled if the session has no resume command available.
|
||||
|
||||
#### Directory Picker (Claude Terminal Resume)
|
||||
|
||||
Starting from v3.13.0, **Claude sessions** show a **directory picker** before resume, allowing you to override the default project directory. Useful when:
|
||||
|
||||
- **Project was moved**: The original project directory was moved or renamed
|
||||
- **Broken symlink**: The original path is no longer accessible
|
||||
- **Temporary directory change**: You want to continue the conversation in a different working directory
|
||||
|
||||
**How to use**:
|
||||
|
||||
1. Click the **Resume** button on a Claude session
|
||||
2. In the popup directory picker, confirm the default directory or choose a new one
|
||||
3. CC Switch launches the Claude terminal session in the selected directory
|
||||
|
||||
> **Note**: Codex / Gemini / OpenCode / OpenClaw session resume flows do not yet include the directory picker and still use the session's original project directory.
|
||||
|
||||
### Delete Session
|
||||
|
||||
Click the **Delete** button (trash icon) to permanently remove a session file. A confirmation dialog is shown before deletion.
|
||||
|
||||
> Sessions without a local source path (e.g., immutable sessions) cannot be deleted.
|
||||
|
||||
### Batch Operations
|
||||
|
||||
For managing multiple sessions at once:
|
||||
|
||||
1. Click the **Batch Mode** button (checkbox icon) in the left panel toolbar
|
||||
2. Select sessions using the checkboxes that appear
|
||||
3. Use **Select All** to select all filtered results, or **Clear** to deselect
|
||||
4. Click **Batch Delete** (red trash icon) to delete all selected sessions
|
||||
|
||||
A confirmation dialog shows the count before deletion. Results report the number of successful deletions and any failures.
|
||||
|
||||
## Conversation History
|
||||
|
||||
### Message Display
|
||||
|
||||
Messages are color-coded by role:
|
||||
- **User** messages: Green, left-aligned
|
||||
- **AI** (Assistant) messages: Blue, right-aligned
|
||||
- **System** messages: Amber
|
||||
- **Tool** messages: Purple
|
||||
|
||||
### Table of Contents
|
||||
|
||||
For longer conversations, a Table of Contents is available:
|
||||
- **Desktop (XL+ screens)**: Sidebar on the right showing user message previews
|
||||
- **Smaller screens**: Floating button (list icon) at bottom-right that opens a dialog
|
||||
|
||||
Click any entry to scroll to that message, which is briefly highlighted.
|
||||
|
||||
## Tips
|
||||
|
||||
- Sessions are sorted by last activity time (newest first)
|
||||
- The session count badge updates as you search and filter
|
||||
- OpenCode sessions may come from both JSON files and SQLite database — duplicates are automatically deduplicated
|
||||
@@ -1,85 +0,0 @@
|
||||
# 3.5 Workspace Files & Daily Memory
|
||||
|
||||
## Overview
|
||||
|
||||
The Workspace panel provides file management and daily memory features for **OpenClaw**. It allows you to edit workspace configuration files and maintain a daily memory journal.
|
||||
|
||||
> This feature is specific to OpenClaw. The Workspace button appears in the navigation bar when OpenClaw is the selected application.
|
||||
|
||||
## Workspace Files
|
||||
|
||||
### File Location
|
||||
|
||||
All workspace files are stored in `~/.openclaw/workspace/`.
|
||||
|
||||
Click the directory path at the top of the panel to open it in your file manager.
|
||||
|
||||
### Available Files
|
||||
|
||||
CC Switch manages 9 workspace files, each serving a specific purpose:
|
||||
|
||||
| File | Description |
|
||||
|------|-------------|
|
||||
| **AGENTS.md** | Agents definition and configuration |
|
||||
| **SOUL.md** | System soul/personality settings |
|
||||
| **USER.md** | User profile information |
|
||||
| **IDENTITY.md** | Identity and role definition |
|
||||
| **TOOLS.md** | Available tools configuration |
|
||||
| **MEMORY.md** | System memory |
|
||||
| **HEARTBEAT.md** | Heartbeat configuration |
|
||||
| **BOOTSTRAP.md** | Bootstrap sequence |
|
||||
| **BOOT.md** | Boot configuration |
|
||||
|
||||
### File Status
|
||||
|
||||
Each file shows a status indicator:
|
||||
- **Green checkmark**: File exists on disk
|
||||
- **Empty circle**: File does not exist yet (will be created on first save)
|
||||
|
||||
### Editing Files
|
||||
|
||||
1. Click any file card to open the Markdown editor
|
||||
2. Edit the content
|
||||
3. Click **Save** to write changes to disk
|
||||
|
||||
If the file doesn't exist yet, it will be created on first save.
|
||||
|
||||
## Daily Memory
|
||||
|
||||
The Daily Memory feature provides a date-organized journal system stored in `~/.openclaw/workspace/memory/`.
|
||||
|
||||
### Accessing Daily Memory
|
||||
|
||||
Click the **Daily Memory** card in the Workspace Files grid to open the memory panel.
|
||||
|
||||
### File List
|
||||
|
||||
The panel displays all daily memory files sorted by date (newest first). Each entry shows:
|
||||
- **Date** (formatted from filename, e.g., `2026-04-01.md`)
|
||||
- **File size**
|
||||
- **Preview** (first 2 lines of content)
|
||||
|
||||
### Create Today's Note
|
||||
|
||||
Click the **Create Today** button to:
|
||||
- Open a new note with today's date (`YYYY-MM-DD.md`)
|
||||
- If today's note already exists, it opens for editing
|
||||
- The file is persisted only after you click Save
|
||||
|
||||
### Search
|
||||
|
||||
Search across all daily memory files:
|
||||
|
||||
1. Press **Cmd/Ctrl+F** or click the search icon
|
||||
2. Enter your search term
|
||||
3. Results show matching files with:
|
||||
- Match count per file
|
||||
- Snippet preview from the matching line
|
||||
- File date and size
|
||||
|
||||
Press **Esc** to close the search.
|
||||
|
||||
### Edit & Delete
|
||||
|
||||
- **Edit**: Click a file entry to open it in the Markdown editor
|
||||
- **Delete**: Hover over a file entry and click the delete icon. A confirmation dialog is shown — deletion cannot be undone.
|
||||
@@ -150,20 +150,6 @@ base_url = "http://127.0.0.1:15721/v1"
|
||||
GOOGLE_GEMINI_BASE_URL=http://127.0.0.1:15721
|
||||
```
|
||||
|
||||
## API Format Conversion
|
||||
|
||||
The proxy supports automatic API format conversion for providers configured with non-Anthropic formats. This allows you to use providers that only support OpenAI-compatible APIs with Claude Code.
|
||||
|
||||
| Provider API Format | Proxy Behavior |
|
||||
|---------------------|----------------|
|
||||
| **Anthropic Messages** | Pass-through (no conversion) |
|
||||
| **OpenAI Chat Completions** | Converts Anthropic requests to OpenAI Chat format and responses back |
|
||||
| **OpenAI Responses API** | Converts Anthropic requests to OpenAI Responses format and responses back |
|
||||
|
||||
The API format is configured per-provider in the [Advanced Options](../2-providers/2.1-add.md#api-format-claude-only) when adding or editing a Claude provider.
|
||||
|
||||
> **Note**: Format conversion requires the proxy to be running with app takeover enabled. The conversion handles both streaming and non-streaming requests.
|
||||
|
||||
## Stop the Proxy
|
||||
|
||||
### Option 1: Main Interface Toggle
|
||||
|
||||
@@ -9,34 +9,14 @@ The usage statistics feature records and analyzes API request data, helping you:
|
||||
- Analyze usage patterns
|
||||
- Troubleshoot issues
|
||||
|
||||
Starting from v3.13.0, usage data comes from two sources:
|
||||
|
||||
| Data Source | Coverage | Proxy Interception Required? |
|
||||
| ------------------------------- | ----------------------------------------- | ---------------------------- |
|
||||
| **Proxy request log** | All requests forwarded through the proxy | Yes |
|
||||
| **CLI session log** (new in v3.13) | Claude / Codex / Gemini session history | No |
|
||||
|
||||
- **Codex sessions**: Switched to **precise parsing** based on JSONL session logs, replacing the previous estimation; model names are normalized for consistent pricing lookup
|
||||
- **Gemini sessions**: Synced precisely from Gemini CLI session logs
|
||||
- **Claude sessions**: Also supports direct usage import from session logs
|
||||
- The usage panel supports **per-app filtering** (Claude / Codex / Gemini) so data from different apps does not mix
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Depending on which data source you use, the prerequisites differ:
|
||||
|
||||
**Proxy request log** (covers all apps and all proxy requests):
|
||||
Using the usage statistics feature requires:
|
||||
|
||||
1. Proxy service started
|
||||
2. App takeover enabled
|
||||
3. Log recording enabled
|
||||
|
||||
**CLI session log** (new in v3.13, no proxy required):
|
||||
|
||||
1. The corresponding app (Claude / Codex / Gemini) is enabled in CC Switch
|
||||
2. The corresponding CLI has session history files
|
||||
3. CC Switch periodically scans session directories and imports usage data
|
||||
|
||||
## Open Usage Statistics
|
||||
|
||||
Settings > Usage Tab
|
||||
@@ -206,22 +186,6 @@ Set prices for each model (per million tokens):
|
||||
| Cache Read Price | Price per million cache hit tokens |
|
||||
| Cache Creation Price | Price per million cache creation tokens |
|
||||
|
||||
### Model ID Normalization Rules
|
||||
|
||||
Before matching pricing, CC Switch normalizes the requested model ID:
|
||||
|
||||
- Remove everything before the last `/`
|
||||
- Remove everything after `:`
|
||||
- Replace `@` with `-`
|
||||
|
||||
When adding pricing entries, enter the normalized Model ID rather than the full raw model name from the request.
|
||||
|
||||
| Raw model name | Model ID to enter | Note |
|
||||
|-------|-------------------|------|
|
||||
| `stepfun-ai/step-3.5-flash` | `step-3.5-flash` | Removes the provider prefix |
|
||||
| `moonshotai/kimi-k2-0905:exa` | `kimi-k2-0905` | Removes the prefix and the `:` suffix |
|
||||
| `gpt-5.2-codex@low` | `gpt-5.2-codex-low` | Replaces `@` with `-` |
|
||||
|
||||
### Operations
|
||||
|
||||
- **Add**: Click the "Add" button to add model pricing
|
||||
@@ -232,7 +196,7 @@ When adding pricing entries, enter the normalized Model ID rather than the full
|
||||
|
||||
### Preset Prices
|
||||
|
||||
CC Switch includes preset official prices for common models (per million tokens). v3.13.0 corrects **CNY → USD pricing** for several models and adds previously missing model definitions; it also fixes **MiniMax plan quota math** and the **0% → 100% usage progress** display, making cost estimates and plan progress more accurate.
|
||||
CC Switch includes preset official prices for common models (per million tokens):
|
||||
|
||||
**Claude Series (USD)**:
|
||||
|
||||
|
||||
@@ -2,15 +2,12 @@
|
||||
|
||||
## Overview
|
||||
|
||||
The model test feature (also known as **Stream Check**) verifies whether a provider's configured model is available by sending actual API requests to test:
|
||||
The model test feature verifies whether a provider's configured model is available by sending actual API requests to test:
|
||||
|
||||
- Whether the model exists
|
||||
- Whether the API Key is valid
|
||||
- Whether the endpoint responds normally
|
||||
- Whether the response latency is acceptable
|
||||
- Time to first token (TTFB) for streaming responses
|
||||
|
||||
Starting from v3.13.0, Stream Check coverage is extended to **all five apps** (Claude / Codex / Gemini / OpenCode / OpenClaw), including all OpenClaw protocol variants (such as `openai-completions`). OpenCode is auto-detected via npm package mapping; OpenClaw supports custom `auth-header` detection and handles edge cases like Bedrock error messages and `baseURL` fallback.
|
||||
|
||||
## Open Configuration
|
||||
|
||||
@@ -20,13 +17,11 @@ Settings > Advanced > Model Test Config
|
||||
|
||||
Configure the model used for testing per application:
|
||||
|
||||
| Application | Setting | Default | Notes |
|
||||
| ----------- | -------------- | -------------- | ---------------------------------------------------- |
|
||||
| Claude | Claude Model | System default | Recommend using Haiku series (low cost, fast) |
|
||||
| Codex | Codex Model | System default | Recommend using mini series |
|
||||
| Gemini | Gemini Model | System default | Recommend using Flash series |
|
||||
| OpenCode | OpenCode Model | System default | Added in v3.13.0, auto-detected via npm package mapping |
|
||||
| OpenClaw | OpenClaw Model | System default | Added in v3.13.0, covers all protocol variants and custom auth-header |
|
||||
| Application | Setting | Default | Notes |
|
||||
|-------------|---------|---------|-------|
|
||||
| Claude | Claude Model | System default | Recommend using Haiku series (low cost, fast) |
|
||||
| Codex | Codex Model | System default | Recommend using mini series |
|
||||
| Gemini | Gemini Model | System default | Recommend using Flash series |
|
||||
|
||||
### Model Selection Tips
|
||||
|
||||
|
||||
@@ -12,11 +12,12 @@ Customizable location in settings (for cloud sync).
|
||||
|
||||
```
|
||||
~/.cc-switch/
|
||||
├── cc-switch.db # SQLite database (SSOT)
|
||||
├── cc-switch.db # SQLite database
|
||||
├── settings.json # Device-level settings
|
||||
├── skills/ # Skill SSOT directory
|
||||
├── skill-backups/ # Skill backups (created on uninstall)
|
||||
└── db_backup_*.db # Database backups
|
||||
└── backups/ # Automatic backups
|
||||
├── backup-20251230-120000.json
|
||||
├── backup-20251229-180000.json
|
||||
└── ...
|
||||
```
|
||||
|
||||
### Database Contents
|
||||
|
||||
@@ -2,9 +2,23 @@
|
||||
|
||||
## Installation Issues
|
||||
|
||||
### macOS Installation
|
||||
### macOS Shows "Unidentified Developer"
|
||||
|
||||
CC Switch for macOS is code-signed and notarized by Apple. You can download and install it directly without any additional steps. If you encounter issues, try downloading the latest version from the [Releases page](https://github.com/farion1231/cc-switch/releases).
|
||||
**Problem**: First launch shows "Cannot open because it is from an unidentified developer"
|
||||
|
||||
**Solution 1**: Via System Settings
|
||||
1. Close the warning dialog
|
||||
2. Open "System Settings" > "Privacy & Security"
|
||||
3. Find the CC Switch prompt
|
||||
4. Click "Open Anyway"
|
||||
5. Reopen the app
|
||||
|
||||
**Solution 2**: Via Terminal command (recommended)
|
||||
```bash
|
||||
sudo xattr -dr com.apple.quarantine /Applications/CC\ Switch.app/
|
||||
```
|
||||
|
||||
The app can be opened normally after running this command.
|
||||
|
||||
### Windows: App Doesn't Launch After Installation
|
||||
|
||||
@@ -156,51 +170,6 @@ chmod +x CC-Switch-*.AppImage
|
||||
- [ ] Is log recording enabled
|
||||
- [ ] Have requests been going through the proxy
|
||||
|
||||
## Quota & Balance
|
||||
|
||||
### Why do some providers show quota automatically while others need manual enabling?
|
||||
|
||||
Only **official subscription types** (Claude / Codex / Gemini official login, GitHub Copilot, Codex OAuth reverse proxy) automatically display the quota after enabling the provider. **All other providers** (including Token Plan and third-party balance queries) need the **Usage Query** switch to be manually turned on and a built-in template selected in the provider card — because the same request URL may expose both "plan" and "balance" query modes, requiring you to pick the right one. See [2.5 Usage Query → Manual Enable](../2-providers/2.5-usage-query.md#manual-enable-built-in-templates--custom-scripts).
|
||||
|
||||
### Official subscription provider shows no quota
|
||||
|
||||
**Check**:
|
||||
1. Confirm the provider is in "Currently Active" state (inactive providers do not trigger queries)
|
||||
2. For Copilot / Codex OAuth, check whether the OAuth token is still valid; if the card shows "Session Expired", log in again in the **OAuth Auth Center**
|
||||
3. Check network connectivity
|
||||
4. Click the refresh icon on the card to manually re-query
|
||||
|
||||
### Token Plan or third-party balance still not shown after enabling
|
||||
|
||||
**Check**:
|
||||
1. Confirm the **Enable Usage Query** toggle is on in the "Usage Query" panel
|
||||
2. A suitable built-in template is selected and saved
|
||||
3. Click **Test Script** to see the specific error
|
||||
4. The provider must be in "Currently Active" state for background auto-refresh
|
||||
|
||||
### Codex usage does not match the direct-connection numbers
|
||||
|
||||
v3.13.0 switched Codex usage from estimation to **precise parsing based on JSONL session logs**, with normalized model names for consistent pricing lookup. New data aligns with official bills. If you still see old estimated data, delete the historical entries or wait for new session data to overwrite them.
|
||||
|
||||
## Codex OAuth Reverse Proxy
|
||||
|
||||
### How do I log in to Codex OAuth?
|
||||
|
||||
See the complete Device Code login flow (verification code + browser authorization), both entry points (Add Provider panel / OAuth Auth Center), multi-account management, and common failure scenarios in [2.1 Add Provider → Codex OAuth Reverse Proxy (Claude Provider)](../2-providers/2.1-add.md#codex-oauth-reverse-proxy-claude-provider).
|
||||
|
||||
### What are the risks of enabling the Codex OAuth reverse proxy?
|
||||
|
||||
The Codex OAuth reverse proxy accesses your ChatGPT account's Codex service through a **reverse-engineered OAuth flow**. This may violate OpenAI's Terms of Service, carries the risk of account restrictions or suspensions, and provides no guarantee of long-term availability. **By enabling, you assume all risks**.
|
||||
|
||||
See the full disclaimer in the [v3.13.0 Release Notes → Risk Notice](../../../release-notes/v3.13.0-en.md#️-risk-notice) and in [2.1 Add Provider → Codex OAuth Reverse Proxy](../2-providers/2.1-add.md#codex-oauth-reverse-proxy-claude-provider).
|
||||
|
||||
### Codex OAuth logged in but no quota shown
|
||||
|
||||
**Solutions**:
|
||||
1. Confirm the OAuth login flow is completed in **OAuth Auth Center** (Settings → OAuth Auth Center, with the Beta label)
|
||||
2. Check whether the token is still valid — if the card shows "Session Expired", the token cannot be refreshed
|
||||
3. If expired, remove the account in the OAuth Auth Center and log in again
|
||||
|
||||
## Other Issues
|
||||
|
||||
### Tray Icon Not Showing
|
||||
@@ -228,20 +197,6 @@ See the full disclaimer in the [v3.13.0 Release Notes → Risk Notice](../../../
|
||||
2. Manually download and install the latest version
|
||||
3. If using Homebrew: `brew upgrade --cask cc-switch`
|
||||
|
||||
## Lightweight Mode
|
||||
|
||||
### How to Enter Lightweight Mode?
|
||||
|
||||
Toggle "Lightweight Mode" from the system tray menu. The main window closes, and CC Switch runs as a tray-only app. Toggle again or click "Open main window" to exit.
|
||||
|
||||
### App Uses Less Memory in Lightweight Mode?
|
||||
|
||||
Yes. Lightweight Mode destroys the main window and its web view, reducing memory usage significantly while keeping tray menu functionality available.
|
||||
|
||||
### Can deep links still wake the main window in Lightweight Mode?
|
||||
|
||||
Yes. Starting from v3.13.0, CC Switch covers all window re-show paths (normal launch, deep links, singleton activation, tray `show_main`, and Lightweight Mode return). Clicking a `ccswitch://` link **rebuilds the main window on demand** and displays the import confirmation dialog. The first open is slightly slower than normal state (window rebuild required), but subsequent switches return to normal speed.
|
||||
|
||||
## Getting Help
|
||||
|
||||
### Submit an Issue
|
||||
|
||||
@@ -24,9 +24,7 @@ CC Switch User Manual
|
||||
├── 3. Extensions
|
||||
│ ├── 3.1 MCP Server Management
|
||||
│ ├── 3.2 Prompts Management
|
||||
│ ├── 3.3 Skills Management
|
||||
│ ├── 3.4 Session Manager
|
||||
│ └── 3.5 Workspace & Memory
|
||||
│ └── 3.3 Skills Management
|
||||
│
|
||||
├── 4. Proxy & High Availability
|
||||
│ ├── 4.1 Proxy Service
|
||||
@@ -71,8 +69,6 @@ CC Switch User Manual
|
||||
| [3.1-mcp.md](./3-extensions/3.1-mcp.md) | MCP protocol, add servers, app binding |
|
||||
| [3.2-prompts.md](./3-extensions/3.2-prompts.md) | Create presets, activate/switch, smart backfill |
|
||||
| [3.3-skills.md](./3-extensions/3.3-skills.md) | Discover skills, install/uninstall, repository management |
|
||||
| [3.4-sessions.md](./3-extensions/3.4-sessions.md) | Session Manager: browse, search, resume, delete sessions |
|
||||
| [3.5-workspace.md](./3-extensions/3.5-workspace.md) | Workspace files and daily memory (OpenClaw) |
|
||||
|
||||
### 4. Proxy & High Availability
|
||||
|
||||
@@ -103,19 +99,9 @@ CC Switch User Manual
|
||||
|
||||
## Version Information
|
||||
|
||||
- Documentation version: v3.13.0
|
||||
- Last updated: 2026-04-08
|
||||
- Applicable to CC Switch v3.13.0+
|
||||
|
||||
### v3.13.0 Highlights
|
||||
|
||||
- **Lightweight Mode**: Destroys the main window when minimizing to tray — near-zero idle footprint. See [1.5 Personalization](./1-getting-started/1.5-settings.md)
|
||||
- **Quota & Balance Display**: Official subscriptions (Claude/Codex/Gemini/Copilot/Codex OAuth) auto-display quotas; Token Plan and third-party balances use built-in templates with one-click enable — see [2.5 Usage Query](./2-providers/2.5-usage-query.md)
|
||||
- **Codex OAuth Reverse Proxy**: Reuse your ChatGPT account's Codex service inside Claude Code — see [2.1 Add Provider](./2-providers/2.1-add.md)
|
||||
- **Per-App Tray Submenus**: Five independent app submenus to prevent tray overflow — see [2.2 Switch Provider](./2-providers/2.2-switch.md)
|
||||
- **Skills Discovery & Batch Updates**: SHA-256 update detection, batch updates, skills.sh public registry search — see [3.3 Skills Management](./3-extensions/3.3-skills.md)
|
||||
- **Full URL Endpoint Mode**: Advanced option to treat `base_url` as the full upstream endpoint — see [2.1 Add Provider](./2-providers/2.1-add.md)
|
||||
- **OpenCode / OpenClaw Stream Check Coverage**: Stream Check panel extended to all five apps — see [4.5 Model Test](./4-proxy/4.5-model-test.md)
|
||||
- Documentation version: v3.12.0
|
||||
- Last updated: 2026-03-09
|
||||
- Applicable to CC Switch v3.12.0+
|
||||
|
||||
## Contributing
|
||||
|
||||
|
||||
@@ -131,9 +131,21 @@ brew upgrade --cask cc-switch
|
||||
2. 展開して `CC Switch.app` を取得
|
||||
3. 「アプリケーション」フォルダにドラッグ
|
||||
|
||||
### 署名・公証済み
|
||||
### 初回起動時の警告
|
||||
|
||||
CC Switch の macOS 版は Apple のコード署名と公証を受けています。追加の操作なしで直接インストールして開くことができます。
|
||||
開発者が Apple 開発者アカウントを持っていないため、初回起動時に「不明な開発者」の警告が表示される場合があります:
|
||||
|
||||
**推奨される解決方法**:
|
||||
ターミナルで以下のコマンドを実行してください:
|
||||
```bash
|
||||
sudo xattr -dr com.apple.quarantine /Applications/CC\ Switch.app/
|
||||
```
|
||||
|
||||
**別の解決方法(システム設定から)**:
|
||||
1. 警告ダイアログを閉じる
|
||||
2. 「システム設定」→「プライバシーとセキュリティ」を開く
|
||||
3. CC Switch に関する表示を見つけ、「このまま開く」をクリック
|
||||
4. 再度アプリを開くと正常に使用可能
|
||||
|
||||
## Linux
|
||||
|
||||
|
||||
@@ -100,13 +100,10 @@ CC Switch はシステムトレイにアイコンを表示し、クイック操
|
||||
| メニュー項目 | 機能 |
|
||||
|--------|------|
|
||||
| メインウィンドウを開く | メインウィンドウを表示してフォーカス |
|
||||
| アプリサブメニュー | Claude/Codex/Gemini/OpenCode/OpenClaw ごとの折りたたみサブメニュー(例:「Claude · PackyCode」) |
|
||||
| プロバイダーリスト | 各サブメニュー内でクリックして切り替え、現在有効なものにはチェックマークを表示 |
|
||||
| ライトウェイトモード | トグルチェックボックスでトレイ専用モードの開始/終了 |
|
||||
| アプリグループ | Claude/Codex/Gemini/OpenCode/OpenClaw ごとにプロバイダーを表示 |
|
||||
| プロバイダーリスト | クリックで切り替え、現在有効なものにはチェックマークを表示 |
|
||||
| 終了 | アプリを完全に終了 |
|
||||
|
||||
> **注意**:各アプリのサブメニュータイトルには現在のプロバイダー名が表示されます(例:「Claude · PackyCode」)。プロバイダーが設定されていないアプリでは、無効化された「(プロバイダーなし)」エントリが表示されます。アプリの表示はアプリの表示設定で制御されます。
|
||||
|
||||
### 多言語対応
|
||||
|
||||
トレイメニューは 3 つの言語に対応し、設定に応じて自動的に切り替わります:
|
||||
@@ -117,17 +114,6 @@ CC Switch はシステムトレイにアイコンを表示し、クイック操
|
||||
| English | Open main window | Quit |
|
||||
| 日本語 | メインウィンドウを開く | 終了 |
|
||||
|
||||
### ライトウェイトモード
|
||||
|
||||
トレイメニューには **ライトウェイトモード** のトグル(チェックボックス)があります。有効にすると:
|
||||
|
||||
- メインウィンドウが閉じられ、リソースが解放される
|
||||
- アプリはシステムトレイのみで動作を継続
|
||||
- トレイのサブメニューからプロバイダーの切り替えが可能
|
||||
- macOS では Dock アイコンも非表示になる
|
||||
|
||||
ライトウェイトモードを終了するには、トグルのチェックを外すか「メインウィンドウを開く」をクリックします。メインウィンドウが再構築されて表示されます。
|
||||
|
||||
### 使用シーン
|
||||
|
||||
トレイからのプロバイダー切り替えはメイン画面を開く必要がなく、以下の場面に適しています:
|
||||
@@ -135,7 +121,6 @@ CC Switch はシステムトレイにアイコンを表示し、クイック操
|
||||
- 頻繁にプロバイダーを切り替える場合
|
||||
- メインウィンドウが最小化されているときの素早い操作
|
||||
- バックグラウンド実行中の設定管理
|
||||
- ライトウェイトモードでリソース使用量を最小化
|
||||
|
||||
## 設定ページ
|
||||
|
||||
|
||||
@@ -33,10 +33,8 @@
|
||||
| アプリ | 反映方法 |
|
||||
|------|----------|
|
||||
| Claude Code | 即時反映(ホットリロード対応) |
|
||||
| Codex | ターミナルの再起動が必要 |
|
||||
| Codex | ターミナルを閉じて再度開く必要あり |
|
||||
| Gemini | 即時反映(リクエストごとに設定を再読み込み) |
|
||||
| OpenCode | ターミナルの再起動が必要 |
|
||||
| OpenClaw | ターミナルの再起動が必要 |
|
||||
|
||||
### Claude Code の初回インストール時の注意
|
||||
|
||||
@@ -66,14 +64,6 @@ codex
|
||||
# Gemini - 起動後にテスト質問を入力
|
||||
gemini
|
||||
> こんにちは、簡単に自己紹介してください
|
||||
|
||||
# OpenCode - 起動後にテスト質問を入力
|
||||
opencode
|
||||
> こんにちは、簡単に自己紹介してください
|
||||
|
||||
# OpenClaw - 起動後にテスト質問を入力
|
||||
openclaw
|
||||
> こんにちは、簡単に自己紹介してください
|
||||
```
|
||||
|
||||
AI が正常に回答すれば、設定は成功です。
|
||||
|
||||
@@ -46,26 +46,6 @@ CC Switch は 3 つの言語に対応しています:
|
||||
|
||||
トレイからプロバイダーを素早く切り替えられるため、「トレイへ最小化」の使用を推奨します。
|
||||
|
||||
### 軽量モード
|
||||
|
||||
v3.13.0 より、CC Switch に **軽量モード** が追加されました — アイドル時のデスクトップ占有を最小限に抑える **トレイのみ実行状態** です。
|
||||
|
||||
**開始方法**:トレイアイコンを右クリック → **軽量モード** をクリック。メインウィンドウは **破棄**(単に非表示ではなく)され、UI リソースとメモリが解放されます。
|
||||
|
||||
**終了方法**:トレイメニューから **メインウィンドウを開く** をクリック、またはディープリンク / 再起動で CC Switch を呼び出します。ウィンドウは **必要に応じて再構築** され、状態は保持されます。
|
||||
|
||||
| 項目 | トレイへ最小化 | 軽量モード |
|
||||
| -------------------- | ---------------- | ---------------------- |
|
||||
| UI プロセス | メモリに保持 | 完全に破棄 |
|
||||
| アイドル時リソース | 通常実行と同じ | ほぼゼロ |
|
||||
| 再表示速度 | 瞬時(直接表示) | やや遅い(ウィンドウ再構築) |
|
||||
| トレイ切り替え | 利用可能 | 利用可能 |
|
||||
| ディープリンク起動 | 利用可能 | 利用可能(必要時再構築)|
|
||||
|
||||
> **使用シーン**:CC Switch を長時間バックグラウンドに常駐させ、主にトレイメニューからプロバイダーを切り替える場合、軽量モードを有効にするとメモリ使用量を大幅に削減できます。
|
||||
|
||||
> **注意**:軽量モードの状態は永続化されません — 次回の通常起動では通常モードに戻ります。長期的に使用する場合は「起動時に自動実行」と組み合わせてください。
|
||||
|
||||
### Claude プラグイン連携
|
||||
|
||||
有効にすると、CC Switch はプロバイダー切り替え時に VS Code の Claude Code 拡張に設定を自動同期します(`~/.claude/config.json` の `primaryApiKey` に書き込み)。
|
||||
@@ -187,74 +167,37 @@ CC Switch の送信 HTTP/HTTPS プロキシを設定します。外部 API に
|
||||
|
||||
### バックアップと復元
|
||||
|
||||
バックアップ管理パネルでは、データベースバックアップを完全に管理できます。
|
||||
自動バックアップの管理:
|
||||
|
||||
#### 自動バックアップ設定
|
||||
| 設定 | 説明 |
|
||||
| -------- | -------------------------- |
|
||||
| バックアップ間隔 | 自動バックアップの時間間隔(時間) |
|
||||
| 保持数量 | 保持するバックアップの数 |
|
||||
|
||||
| 設定 | オプション | デフォルト |
|
||||
|------|---------|---------|
|
||||
| バックアップ間隔 | 無効、6時間、12時間、24時間、48時間、7日 | 24時間 |
|
||||
| 保持数 | 3、5、10、15、20、30、50 | 10件 |
|
||||
|
||||
間隔を設定すると、CC Switch はスケジュールに従って自動的にデータベースをバックアップします。保持数を超えた古いバックアップは自動的に削除されます。
|
||||
|
||||
#### バックアップリスト
|
||||
|
||||
パネルには既存のすべてのバックアップが以下の情報とともに表示されます:
|
||||
- **表示名**(タイムスタンプから自動生成、例:`db_backup_20260315_143000`)
|
||||
- **作成日時**
|
||||
- **ファイルサイズ**(例:「1.5 MB」)
|
||||
|
||||
#### バックアップ操作
|
||||
|
||||
| 操作 | 説明 |
|
||||
|------|------|
|
||||
| **今すぐバックアップ** | 即座にバックアップを作成 |
|
||||
| **復元** | 選択したバックアップからデータベースを復元。復元前に現在のデータベースの安全バックアップが自動的に作成される |
|
||||
| **名前変更** | バックアップの表示名を変更 |
|
||||
| **削除** | バックアップを完全に削除(確認あり) |
|
||||
|
||||
> **重要**:バックアップの復元は現在のデータベースを上書きします。復元前に安全バックアップが自動作成されるため、必要に応じて元に戻すことができます。
|
||||
バックアップリストの表示とバックアップからの復元をサポートします。
|
||||
|
||||
### クラウド同期(WebDAV)
|
||||
|
||||
WebDAV プロトコルを使用して複数のデバイス間で設定を同期します。信頼性の向上のため、デュアルレイヤーバージョニングを備えた **v2 プロトコル** を使用しています。
|
||||
WebDAV プロトコルを使用して複数のデバイス間で設定を同期します。
|
||||
|
||||
| 設定項目 | 説明 |
|
||||
| -------- | ------------------------------------- |
|
||||
| サービスプリセット | 坚果云 / Nextcloud / Synology / カスタム |
|
||||
| サーバー URL | WebDAV サーバー URL |
|
||||
| ユーザー名 | ログインユーザー名 |
|
||||
| パスワード | ログインパスワード(アプリ専用パスワード、保存済みの場合は未変更で保持) |
|
||||
| パスワード | ログインパスワード(アプリ専用パスワード) |
|
||||
| リモートディレクトリ | リモート保存パス(デフォルト `cc-switch-sync`) |
|
||||
| プロファイル名 | デバイスプロファイル名(デフォルト `default`) |
|
||||
| 自動同期 | 設定可能な間隔で自動同期を有効化 |
|
||||
| 自動同期 | 有効にすると変更を自動アップロード |
|
||||
|
||||
#### 操作
|
||||
操作:
|
||||
|
||||
| 操作 | 説明 |
|
||||
|------|------|
|
||||
| **接続テスト** | WebDAV の URL、ユーザー名、パスワードが有効か確認 |
|
||||
| **アップロード** | ローカルデータベースをリモートにアップロード。進捗スピナーを表示 |
|
||||
| **ダウンロード** | リモートデータベースをダウンロード。確認前にリモートスナップショット情報(プロトコルバージョン、DB バージョン、タイムスタンプ、サイズ)を表示。上書き前にローカルデータベースの安全バックアップを自動作成 |
|
||||
- **接続テスト**:WebDAV 設定が正しいか確認
|
||||
- **保存**:設定を保存して自動テスト
|
||||
- **アップロード**:ローカルデータをリモートにアップロード
|
||||
- **ダウンロード**:リモートからローカルにデータをダウンロード
|
||||
|
||||
#### 自動同期
|
||||
|
||||
**自動同期** を有効にすると:
|
||||
- 初回有効化時に確認ダイアログが表示される
|
||||
- CC Switch は設定された間隔で自動的にデータベースを WebDAV に同期
|
||||
- 同期ステータスがパネルに表示される
|
||||
|
||||
#### リモートスナップショット情報
|
||||
|
||||
ダウンロード前に、CC Switch はリモートスナップショットの詳細を表示します:
|
||||
- プロトコルバージョン(v2)
|
||||
- データベース互換バージョン
|
||||
- リモートバックアップのタイムスタンプ
|
||||
- ファイルサイズ
|
||||
- 互換性ステータス(非互換の場合は警告)
|
||||
|
||||
> **注意**:アップロードはリモートデータを、ダウンロードはローカルデータを上書きします。ダウンロード前に安全バックアップが自動作成されます。
|
||||
> **注意**:アップロードはリモートデータを、ダウンロードはローカルデータを上書きします。操作前にご確認ください。
|
||||
|
||||
### ログ設定
|
||||
|
||||
@@ -271,26 +214,6 @@ WebDAV プロトコルを使用して複数のデバイス間で設定を同期
|
||||
- **debug** - デバッグ情報を記録
|
||||
- **trace** - すべての詳細情報を記録
|
||||
|
||||
## OAuth 認証センター(Beta)
|
||||
|
||||
設定 → **OAuth 認証センター** タブ
|
||||
|
||||
v3.13.0 で追加された **OAuth 認証センター**(Beta)は、サードパーティの OAuth 認証情報を一元管理します。現在、以下の 2 種類のアカウントタイプをサポートしています:
|
||||
|
||||
| アカウントタイプ | 用途 |
|
||||
| ----------------------------- | --------------------------------------------------------------- |
|
||||
| **GitHub Copilot** | Copilot リバースプロキシと組み合わせて使用 |
|
||||
| **ChatGPT (Codex OAuth)** | Codex OAuth リバースプロキシと組み合わせて使用、ChatGPT アカウントを管理 |
|
||||
|
||||
**ここでできること**:
|
||||
|
||||
- Device Code フローで ChatGPT / GitHub アカウントにログイン
|
||||
- ログイン済みアカウント一覧と認証状態の確認
|
||||
- マルチアカウント時のデフォルトアカウント設定
|
||||
- 個別アカウントの削除や全アカウントの一括ログアウト
|
||||
|
||||
> **注意**:これら 2 つの機能はリバースエンジニアリングされた OAuth フローを使用するため、アカウントリスクおよび利用規約リスクが存在します。ご利用前に [2.1 プロバイダーの追加 → Codex OAuth リバースプロキシ](../2-providers/2.1-add.md#codex-oauth-リバースプロキシclaude-プロバイダー) の完全なリスク通知をお読みください。
|
||||
|
||||
## バージョン情報ページ
|
||||
|
||||
設定 → バージョン情報 タブ
|
||||
|
||||
@@ -152,23 +152,6 @@
|
||||
| AWS Bedrock | AWS Bedrock サービス |
|
||||
| OpenAI Compatible | OpenAI 互換インターフェース |
|
||||
|
||||
## モデル自動取得
|
||||
|
||||
プロバイダーの追加や編集時に、プロバイダーのエンドポイントから利用可能なモデルを自動検出でき、モデル ID の手動コピー&ペーストの手間を省けます。
|
||||
|
||||
1. **API Key** と **エンドポイントアドレス** が入力されていることを確認
|
||||
2. モデル入力フィールドの横にある **モデル取得** ボタン(ダウンロードアイコン)をクリック
|
||||
3. CC Switch が設定された API Key で OpenAI 互換の `/v1/models` エンドポイントを呼び出し
|
||||
4. カテゴリ別にグループ化されたドロップダウンからモデルを選択
|
||||
|
||||
この機能は **5 つのアプリ全対応** —— **Claude / Codex / Gemini / OpenCode / OpenClaw** のプロバイダーで利用可能で、`/v1/models` エンドポイントをサポートするすべてのプロバイダーに対応します。
|
||||
|
||||
**よくあるエラー:**
|
||||
- **認証失敗(401/403)**:API Key が正しいか確認してください
|
||||
- **エンドポイント未対応(404/405)**:プロバイダーが `/v1/models` エンドポイントを公開していません。手動でモデル ID を入力してください
|
||||
- **解析失敗**:レスポンスが OpenAI 互換フォーマットに準拠していません
|
||||
- **タイムアウト**:エンドポイントの応答が遅いです。後ほど再試行するかネットワークを確認してください
|
||||
|
||||
## カスタム設定
|
||||
|
||||
「カスタム」プリセットを選択した場合、JSON 設定を手動で編集する必要があります。
|
||||
@@ -331,200 +314,8 @@ SQL バックアップファイルから一括インポート:
|
||||
|
||||
> **注意**:インポートは既存のデータベースを上書きするため、事前に現在の設定をエクスポートしてバックアップすることをお勧めします。エクスポートファイル名の形式は `cc-switch-export-{タイムスタンプ}.sql` です。
|
||||
|
||||
## Codex OAuth リバースプロキシ(Claude プロバイダー)
|
||||
|
||||
v3.13.0 より、CC Switch は **Codex OAuth リバースプロキシ** 経路を追加しました。**ChatGPT アカウント** を使って Claude Code 内から Codex サービスを再利用できます。
|
||||
|
||||
> **位置ヒント**:この機能は **新しい Claude プロバイダーカードタイプ** として表示され、Codex 側のプリセットではありません。追加後は通常の API Key プロバイダーと並んで Claude のプロバイダーリストに表示されます。
|
||||
|
||||
### 前提条件
|
||||
|
||||
- ログイン可能な **ChatGPT アカウント**
|
||||
- `auth.openai.com` および `chatgpt.com` にアクセスできる
|
||||
- **利用前に必ず本節末尾の [⚠️ リスク通知](#️-リスク通知重要) をお読みください**
|
||||
|
||||
### 2 つの入口
|
||||
|
||||
以下のどちらの入口からでも開始できます:
|
||||
|
||||
#### 入口 A:プロバイダー追加パネルから(新規ユーザー推奨)
|
||||
|
||||
1. **Claude** アプリに切り替える
|
||||
2. 右上の **+** ボタンをクリックしてプロバイダー追加パネルを開く
|
||||
3. プリセットリストの第三者カテゴリから **Codex (ChatGPT Plus/Pro)** プリセットを選択(UI に表示される名称を優先)
|
||||
4. まだ ChatGPT アカウントにログインしていない場合、パネルが **自動的に** ログインフローへ誘導します(下記「ログインフロー」を参照)
|
||||
5. ログイン成功後、プロバイダーフォームにログイン済みアカウントが表示されるので「保存」をクリックして完了
|
||||
|
||||
#### 入口 B:OAuth 認証センターから(マルチアカウント管理に適する)
|
||||
|
||||
1. **設定 → OAuth 認証センター** を開く(タブに **Beta** マーク)
|
||||
2. **ChatGPT (Codex OAuth)** セクションで **ChatGPT でログイン** ボタンをクリック
|
||||
3. ログインフローを完了(下記参照)
|
||||
4. ログイン完了後、**Claude** アプリに戻る → **プロバイダーの追加** → 同じ Codex (ChatGPT Plus/Pro) プリセットを選択
|
||||
5. フォーム内の「アカウント選択」ドロップダウンから、先ほどログインしたアカウントを選択して保存
|
||||
|
||||
### ログインフロー(Device Code)
|
||||
|
||||
どちらの入口から入っても、ログインフローは同一です:
|
||||
|
||||
1. **認証コードを取得**:CC Switch が OpenAI Device Code フローを呼び出し、以下を表示:
|
||||
- **認証コード**(約 8 文字、例:`ABCD-1234`)
|
||||
- 認証コード右側の **コピー** ボタン
|
||||
- その下の認証 URL `https://auth.openai.com/codex/device`
|
||||
- 「認証を待っています...」のアニメーション表示
|
||||
2. **ブラウザ認証**:リンクをクリック(または URL を手動で訪問)し、ブラウザで:
|
||||
- ChatGPT アカウントにログイン
|
||||
- 先ほどコピーした認証コードを入力
|
||||
- 認証を確認
|
||||
3. **自動ポーリング完了**:CC Switch はバックグラウンドで OpenAI サーバーをポーリングし、認証成功を検知すると待機画面を自動的に閉じます
|
||||
4. **ログイン済みアカウントを表示**:ログインした ChatGPT アカウント(ログインメール)が **OAuth 認証センター → ログイン済みアカウント** リストに表示されます
|
||||
|
||||
> ⏱️ **認証コードの有効期限は約 15 分** です。タイムアウトすると「Device Code の有効期限切れ」が表示されるので、**再試行** をクリックして新しい認証コードを取得してください。
|
||||
|
||||
### 有効化と使用
|
||||
|
||||
Codex OAuth プロバイダーを追加・保存した後:
|
||||
|
||||
1. Claude のプロバイダーリストから探す
|
||||
2. カードの **有効化** ボタンをクリック —— 通常のプロバイダーと同じ
|
||||
3. Claude Code CLI がリバースプロキシ経由で Codex サービスを使用します
|
||||
4. トレイメニューの **Claude** サブメニューにもこのプロバイダーが表示され、素早く切り替え可能
|
||||
|
||||
> **内部動作**:CC Switch はリクエストを `https://chatgpt.com/backend-api/codex` にルーティングし、base URL が強制的に書き換えられます —— フォームにエンドポイントを手動入力する **必要はありません**。API フォーマットは `openai_responses` に固定されます。
|
||||
|
||||
### デフォルトモデル
|
||||
|
||||
Codex OAuth プリセットのデフォルトモデルマッピング:
|
||||
|
||||
| 役割 | デフォルトモデル |
|
||||
| ------------- | ---------------- |
|
||||
| メインモデル | `gpt-5.4` |
|
||||
| Sonnet 役割 | `gpt-5.4` |
|
||||
| Opus 役割 | `gpt-5.4` |
|
||||
| Haiku 役割 | `gpt-5.4-mini` |
|
||||
|
||||
プロバイダーの JSON エディタで `ANTHROPIC_MODEL` などの環境変数を上書きしてカスタマイズできます。
|
||||
|
||||
### マルチアカウント管理(OAuth 認証センター)
|
||||
|
||||
**OAuth 認証センター** は複数の ChatGPT アカウントの同時管理をサポートします:
|
||||
|
||||
| 操作 | 説明 |
|
||||
| -------------------------- | ---------------------------------------------------------------------- |
|
||||
| 別のアカウントを追加 | 「別のアカウントを追加」をクリックしてログインフローを繰り返す |
|
||||
| デフォルトに設定 | アカウント行の「デフォルトに設定」をクリック —— 新規プロバイダーに適用 |
|
||||
| プロバイダー用に選択 | プロバイダーフォームの「アカウント選択」ドロップダウンで特定アカウントを指定 |
|
||||
| アカウントを削除 | アカウント右側の赤い × をクリックして削除(Token がクリアされる) |
|
||||
| すべてのアカウントをログアウト | 下部の「すべてのアカウントをログアウト」ボタンで一括クリア |
|
||||
|
||||
> **使用シーン**:チームで開発マシンを共有する場合、各メンバーの ChatGPT アカウントごとに 1 つのプロバイダーを作成し、トレイメニューから素早く切り替えできます。
|
||||
|
||||
### Token 自動更新
|
||||
|
||||
- Token は **有効期限の 60 秒前** に自動更新され、すべてバックグラウンドで処理されるため手動介入は不要です
|
||||
- Refresh Token はローカルデータディレクトリに保存され、どこにもアップロードされません
|
||||
- Token のエクスポートは **サポートされていません**(漏洩防止)
|
||||
|
||||
### クォータ表示
|
||||
|
||||
ログインしてプロバイダーを有効化すると、**プロバイダーカード下部** に自動的にアカウントクォータが表示されます:
|
||||
|
||||
| 表示要素 | 例 | カラールール |
|
||||
| ---------------- | ------------------- | --------------------------------------------- |
|
||||
| 使用率 | `45%` | < 70% 緑、70–89% オレンジ、≥ 90% 赤 |
|
||||
| リセットまでの時間 | `7d12h 後にリセット` | ChatGPT アカウントのスライディングウィンドウまたは日次制限 |
|
||||
| 更新ボタン | 円形の矢印 | 手動でクォータを再取得 |
|
||||
|
||||
> ⚠️ **セッション期限切れ**:Token が完全に無効になった(自動更新できない)場合、カード下部に黄色い警告枠「セッション期限切れ」が表示されます。**OAuth 認証センター** からこのアカウントを削除し、再ログインしてください。
|
||||
|
||||
### よくある失敗
|
||||
|
||||
| シナリオ | 表示 | 解決方法 |
|
||||
| --------------------------- | --------------------------------- | --------------------------------------------- |
|
||||
| 認証コードタイムアウト | 「Device Code の有効期限切れ」 | 「再試行」をクリックして新しい認証コードを取得 |
|
||||
| ブラウザで認証拒否 | 「ユーザーが認証を拒否」 | 再ログインしブラウザで「認証」をクリック |
|
||||
| ネットワークエラー | 具体的なエラー情報を表示 | ネットワーク接続を確認、OpenAI ドメインへのアクセス可否を確認 |
|
||||
| ログイン前にプロバイダー作成 | 「ChatGPT アカウントにログインしてください」 | 先に OAuth 認証センターでログインを完了 |
|
||||
| Token 更新失敗 | クォータ欄に「セッション期限切れ」 | アカウントを削除して再ログイン |
|
||||
| クォータ取得失敗 | クォータ欄に「取得失敗」 | 「更新」ボタンをクリックして再試行 |
|
||||
|
||||
### ⚠️ リスク通知(重要)
|
||||
|
||||
Codex OAuth リバースプロキシは **リバースエンジニアリングされた OAuth フロー** で ChatGPT アカウントの Codex サービスにアクセスします。有効化前に必ず以下のリスクをご理解ください:
|
||||
|
||||
1. **利用規約違反**:OpenAI の利用規約に違反する可能性があります。同規約は未承認の自動化アクセス、サービスの複製、および既定のアクセス経路の迂回を禁止しています
|
||||
2. **アカウントリスク**:OpenAI は異常な使用パターンを疑わしい自動化として検知し、ChatGPT アカウントに一時的または永続的な制限を課す可能性があります
|
||||
3. **長期的な可用性は保証されません**:OpenAI は認証および検出メカニズムをいつでも更新する可能性があり、現在利用可能な方法が将来ブロックされる可能性があります
|
||||
|
||||
**この機能を有効化することは、すべてのリスクを自己責任で負うことを意味します**。CC Switch は本機能の使用による一切のアカウント制限、警告、サービス停止について責任を負いません。
|
||||
|
||||
> 📖 完全な免責事項と背景は [v3.13.0 Release Notes](../../../release-notes/v3.13.0-ja.md#️-リスク通知) をご覧ください。
|
||||
|
||||
## 高度なオプション
|
||||
|
||||
### API フォーマット(Claude のみ)
|
||||
|
||||
サードパーティ API を使用する Claude プロバイダーを追加する際、高度なオプションセクションで正しい **API フォーマット** を選択する必要がある場合があります:
|
||||
|
||||
| フォーマット | 説明 | 使用場面 |
|
||||
|------|------|------|
|
||||
| **Anthropic Messages** | ネイティブ Anthropic API フォーマット(デフォルト) | Anthropic API に直接接続、または互換プロキシ |
|
||||
| **OpenAI Chat Completions** | OpenAI Chat API フォーマット、プロキシが自動変換 | プロバイダーが OpenAI Chat フォーマットのみ対応 |
|
||||
| **OpenAI Responses API** | OpenAI Responses API フォーマット、プロキシが自動変換 | プロバイダーが OpenAI Responses フォーマットのみ対応 |
|
||||
|
||||
> **注意**:API フォーマットの変換はプロキシサービスが担当します。Anthropic 以外のフォーマットを使用する場合、リクエスト/レスポンスの正しい変換のためにプロキシが接管有効の状態で稼働している必要があります。詳しくは [4.1 プロキシサービス](../4-proxy/4.1-service.md) をご覧ください。
|
||||
|
||||
デフォルト以外の API フォーマットが設定されている場合、高度なオプションセクションが自動展開されます。
|
||||
|
||||
### 完全URLエンドポイントモード
|
||||
|
||||
v3.13.0 で追加された高度なオプション。デフォルトでは、CC Switch は設定された `base_url` を **プレフィックス** として扱い、`/v1/chat/completions` などの固定パスを後ろに連結します。一部のベンダー(非標準の URL レイアウトを必要とする第三者サービスなど)では、この連結方式ではリクエストが失敗します。
|
||||
|
||||
**有効化方法**:
|
||||
|
||||
1. プロバイダーを編集し、「高度なオプション」を展開
|
||||
2. **完全 URL モード** チェックボックスにチェックを入れる
|
||||
3. **完全なアップストリームエンドポイント**(プレフィックスではなく)を `base_url` に入力
|
||||
|
||||
**例の比較**:
|
||||
|
||||
| モード | `base_url` の記入例 | 実際のリクエスト先 |
|
||||
| ----------------------- | ------------------------------------------------ | ------------------------------------------------ |
|
||||
| デフォルト(プレフィックス連結) | `https://api.example.com` | `https://api.example.com/v1/chat/completions` |
|
||||
| **完全 URL モード** | `https://api.example.com/custom/path/messages` | `https://api.example.com/custom/path/messages` |
|
||||
|
||||
**使用シーン**:
|
||||
- ベンダーが非標準パスを要求する場合(`/v1/chat/completions` 以外)
|
||||
- ベンダーに多階層のパス構造がある場合
|
||||
- ベンダー専用の API ゲートウェイパス
|
||||
|
||||
> **ヒント**:プロキシ転送および Stream Check のいずれも「完全 URL モード」の設定に従うため、有効化後に追加調整は不要です。このオプションを無効化すると、パス連結はデフォルトの動作に戻ります。
|
||||
|
||||
### Claude 共通設定クイックトグル
|
||||
|
||||
Claude プロバイダーの編集時、JSON エディタの上部に **クイックトグル** が利用できます:
|
||||
|
||||
| トグル | 効果 | 設定変更 |
|
||||
|------|------|------|
|
||||
| **帰属情報を非表示** | コミット/PR の帰属メタデータをクリア | `attribution: {commit: "", pr: ""}` を設定 |
|
||||
| **チームメイトを有効化** | エージェントチーム機能を有効化 | `env.CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS = "1"` を設定 |
|
||||
| **ツール検索を有効化** | ツール検索機能を有効化 | `env.ENABLE_TOOL_SEARCH = "true"` を設定 |
|
||||
| **高強度** | エフォートレベルを高に設定 | `effortLevel = "high"` を設定 |
|
||||
| **自動アップグレードを無効化** | Claude Code の自動更新を防止 | `env.DISABLE_AUTOUPDATER = "1"` を設定 |
|
||||
|
||||
トグルのチェックを外すと、対応する設定エントリが完全に削除されます。変更は JSON エディタにリアルタイムで反映されます。
|
||||
|
||||
また、**共通設定を書き込み** チェックボックスを有効にすると、グローバル設定スニペットをプロバイダーにマージできます。**共通設定を編集** をクリックして共有スニペットをカスタマイズできます。
|
||||
|
||||
### Codex 1M コンテキストウィンドウ
|
||||
|
||||
Codex プロバイダーの追加時、**1M コンテキストウィンドウを有効化** トグルが利用できます:
|
||||
|
||||
- **有効時**:config.toml に `model_context_window = 1000000` を設定し、`model_auto_compact_token_limit = 900000` を自動入力
|
||||
- **無効時**:両方のフィールドを削除
|
||||
|
||||
トグルがオンの場合に表示されるテキストフィールドで、自動コンパクト制限をカスタマイズできます。
|
||||
|
||||
### カスタムアイコン
|
||||
|
||||
名前の左側にあるアイコンエリアをクリックすると:
|
||||
|
||||
@@ -26,30 +26,12 @@
|
||||
### 操作手順
|
||||
|
||||
1. システムトレイの CC Switch アイコンを右クリック
|
||||
2. 対応するアプリのサブメニュー(例:「Claude · 現在のプロバイダー」)にマウスを合わせる
|
||||
2. メニューで対応するアプリ(Claude/Codex/Gemini/OpenCode)を見つける
|
||||
3. 切り替えたいプロバイダー名をクリック
|
||||
4. 切り替え完了、トレイに短い通知が表示
|
||||
|
||||
### トレイメニュー構造
|
||||
|
||||
v3.13.0 より、トレイメニューがフラットなリストから **アプリ別サブメニュー** にリファクタリングされ、各アプリに独立したサブメニューが用意されました:
|
||||
|
||||
| サブメニュー | 説明 |
|
||||
| ------------ | -------------------------------------------------------------------- |
|
||||
| Claude | Claude のすべてのプロバイダー(Codex OAuth リバースプロキシを含む) |
|
||||
| Codex | Codex のすべてのプロバイダー |
|
||||
| Gemini | Gemini のすべてのプロバイダー |
|
||||
| OpenCode | OpenCode のすべてのプロバイダー |
|
||||
| OpenClaw | OpenClaw のすべてのプロバイダー |
|
||||
|
||||
**リファクタリングの利点**:
|
||||
|
||||
- **メニューのオーバーフロー防止**:プロバイダーが多数ある場合、フラットなリストでは画面の高さを超えますが、アプリ別サブメニューは自然にスケールします
|
||||
- **サブメニューのタイトルに現在有効なプロバイダーを表示**:サブメニューを開かなくても、各アプリがどのプロバイダーを使用中か一目でわかります
|
||||
- **アプリ別の分離**:Claude のプロバイダーを切り替えても Codex のビューには影響しません
|
||||
|
||||
> **ヒント**:バックグラウンド常駐 + 軽量モード + アプリ別サブメニューの組み合わせは、複数のアプリを頻繁に切り替えるヘビーユーザーに特に適しています。[1.5 個人設定 → 軽量モード](../1-getting-started/1.5-settings.md) を参照してください。
|
||||
|
||||

|
||||
|
||||
## 反映方法
|
||||
|
||||
@@ -52,20 +52,6 @@ JSON 形式の設定内容(以下を含む):
|
||||
|
||||
これにより、CC Switch と CLI ツールの設定が常に同期されます。
|
||||
|
||||
## モデル自動取得
|
||||
|
||||
プロバイダーの編集時に、プロバイダーのエンドポイントから利用可能なモデルリストを自動取得できます:
|
||||
|
||||
1. API Key とエンドポイントアドレスが入力されていることを確認
|
||||
2. モデル入力フィールドの横にある **モデル取得** ボタン(ダウンロードアイコン)をクリック
|
||||
3. グループ化されたドロップダウンからモデルを選択
|
||||
|
||||
詳しくは [2.1 プロバイダーの追加 - モデル自動取得](./2.1-add.md#モデル自動取得) をご覧ください。
|
||||
|
||||
## 共通設定クイックトグル(Claude)
|
||||
|
||||
Claude プロバイダーの編集時、JSON エディタの上部にツール検索、自動アップグレード無効化、チームメイト、高強度などの共通設定のクイックトグルスイッチが利用できます。詳しくは [2.1 プロバイダーの追加 - Claude 共通設定クイックトグル](./2.1-add.md#claude-共通設定クイックトグル) をご覧ください。
|
||||
|
||||
## API Key の変更
|
||||
|
||||
プロバイダーの編集時に、**API Key** 入力ボックスから直接変更できます:
|
||||
|
||||
@@ -1,72 +1,8 @@
|
||||
# 2.5 使用量クエリ
|
||||
|
||||
CC Switch のクォータ・残高表示は 2 つのカテゴリに分かれます:**自動クエリ**(公式サブスクリプション系、すぐに使える)と **手動有効化**(内蔵テンプレート + カスタムスクリプト、ユーザー設定後に表示)。
|
||||
## 機能説明
|
||||
|
||||
| カテゴリ | 範囲 | ユーザー操作必要 |
|
||||
| ---------------------------------- | --------------------------------------------------------------------------------- | ---------------- |
|
||||
| **自動クエリ** | Claude / Codex / Gemini 公式サブスクリプション、GitHub Copilot、Codex OAuth リバースプロキシ | 不要(デフォルト有効) |
|
||||
| **手動有効化(内蔵テンプレート)** | Token Plan、第三者残高クエリ | 必要(下記参照) |
|
||||
| **手動有効化(カスタムスクリプト)** | 内蔵テンプレート未対応の中継サービス、プライベートデプロイ、特殊 API | 必要(下記参照) |
|
||||
|
||||
## 自動クエリ(公式サブスクリプション系)
|
||||
|
||||
v3.13.0 より、以下の 3 カテゴリはプロバイダー有効化後に **自動的** にカード下部にクォータが表示され、追加設定は不要です:
|
||||
|
||||
| カテゴリ | 対象プロバイダー | 表示内容 |
|
||||
| ---------------------- | --------------------------------------------- | ------------------------------------ |
|
||||
| 公式サブスクリプション | Claude / Codex / Gemini 公式ログイン | 公式サブスクリプションクォータ |
|
||||
| GitHub Copilot | Copilot プロバイダーカード | Premium interactions 残量 |
|
||||
| Codex OAuth | Codex OAuth リバースプロキシカード(Claude プロバイダー) | ChatGPT アカウント Codex クォータ |
|
||||
|
||||
これら 3 カテゴリの共通点は、**データソースが唯一かつ意味が明確** であることです(公式サブスクリプションの使用率)。そのため CC Switch は対応する公式または OAuth クエリエンドポイントを直接呼び出します。
|
||||
|
||||
### 自動クエリの操作
|
||||
|
||||
- **カード下部表示**:使用率 + リセットまでのカウントダウン、使用率に応じて色が変化(< 70% 緑 / 70–89% オレンジ / ≥ 90% 赤)
|
||||
- **手動更新**:カード上の更新アイコンをクリックして再取得
|
||||
- **カードの簡略化**:これら 3 カテゴリでは、**ヘルスチェック** と **使用量クエリ設定** ボタンが自動的に非表示となり、内蔵表示への干渉を防ぎます
|
||||
- **セッション期限切れ通知**:Token の更新に失敗した場合、カードに黄色の「セッション期限切れ」警告が表示されます(Copilot / Codex OAuth)
|
||||
|
||||
---
|
||||
|
||||
## 手動有効化(内蔵テンプレート + カスタムスクリプト)
|
||||
|
||||
上記 3 カテゴリの自動クエリ対応プロバイダー以外、**その他すべてのプロバイダー**(Token Plan、第三者残高クエリ、各種中継サービスを含む)では、プロバイダーカード上で **手動で「使用量クエリ」スイッチをオン** にして初めてクォータが表示されます。
|
||||
|
||||
### なぜ手動有効化が必要なのか?
|
||||
|
||||
重要な理由の一つは:**同じリクエスト URL(同じベンダー)が複数のクエリモードを提供している場合がある** ことです —— プランごとのクォータクエリと、アカウント残高クエリの両方が存在する可能性があります。CC Switch はどちらをクエリすべきか自動判定できないため、このようなプロバイダーの内蔵クエリは **デフォルトで無効** になっており、適切なテンプレートを選択してから有効化する必要があります。
|
||||
|
||||
### 内蔵テンプレートの対象範囲
|
||||
|
||||
v3.13.0 では以下のカテゴリに **すぐに使える内蔵テンプレート** を提供しており、有効化後にスクリプトを書く必要はありません:
|
||||
|
||||
| カテゴリ | 対象プロバイダー | テンプレートタイプ |
|
||||
| --------------- | --------------------------------------------------------- | ------------------------- |
|
||||
| Token Plan | Kimi / Zhipu GLM / MiniMax | プランクォータ(使用進捗付き) |
|
||||
| 第三者残高 | DeepSeek / StepFun / SiliconFlow / OpenRouter / Novita AI | 公式残高クエリ |
|
||||
|
||||
> **ヒント**:上記の内蔵テンプレート以外で対象外のプロバイダーには、**カスタムスクリプト** 方式(下記参照)で独自のクエリロジックを記述できます。
|
||||
|
||||
### 有効化手順
|
||||
|
||||
1. プロバイダーカードにマウスをホバーして操作ボタンを表示
|
||||
2. **使用量クエリ** ボタン(📊 アイコン)をクリック
|
||||
3. 設定パネル上部の **使用量クエリを有効にする** スイッチをオンにする
|
||||
4. 適切な内蔵テンプレート(Token Plan、第三者残高など)または「カスタム」を選択
|
||||
5. 必要に応じて API Key / Base URL / Access Token などのパラメータを入力(多くの場合は空欄のままプロバイダー自身の認証情報を使用可能)
|
||||
6. 「スクリプトをテスト」をクリックして正常に応答するか確認
|
||||
7. 設定を保存 —— 次回プロバイダーを有効化すると、カード下部にクォータが表示されます
|
||||
|
||||
> ⚠️ **注意**:有効化後の自動更新間隔は「自動クエリ間隔」フィールドで制御します(`0` に設定すると自動更新を無効化)。プロバイダーが「現在有効」状態のときのみバックグラウンドクエリがトリガーされます。
|
||||
|
||||
---
|
||||
|
||||
## カスタムスクリプトクエリ(高度)
|
||||
|
||||
### 機能説明
|
||||
|
||||
プロバイダーが **内蔵テンプレートの対象範囲外** の場合、JavaScript でカスタムクエリスクリプトを記述できます。中継サービス、プライベートデプロイ、特殊な API 形式などに適しています。
|
||||
使用量クエリ機能により、カスタムスクリプトを設定して、プロバイダーの残額や使用量などの情報をリアルタイムでクエリできます。
|
||||
|
||||
**使用シーン**:
|
||||
- API アカウントの残額確認
|
||||
@@ -219,24 +155,6 @@ New API タイプの中継サービス専用に設計されています:
|
||||
|
||||
### トラブルシューティング
|
||||
|
||||
### 自動クエリにクォータが表示されない(公式サブスクリプション系)
|
||||
|
||||
**確認事項**:
|
||||
1. プロバイダーが公式サブスクリプション系であることを確認 —— Claude / Codex / Gemini 公式ログイン、GitHub Copilot、Codex OAuth リバースプロキシ
|
||||
2. プロバイダーが「現在有効」状態か(非アクティブ時はクエリがトリガーされません)
|
||||
3. OAuth タイプ(Copilot / Codex OAuth)の場合、Token がまだ有効期限内か確認。カードに「セッション期限切れ」と表示される場合は **OAuth 認証センター** で再ログインしてください
|
||||
4. 公式クォータエンドポイントへのネットワークアクセス可否
|
||||
|
||||
### 手動有効化後もクォータが表示されない
|
||||
|
||||
**確認事項**:
|
||||
1. プロバイダーカードの「使用量クエリ」パネル上部にある **使用量クエリを有効にする** スイッチがオンか
|
||||
2. 適切な内蔵テンプレート(Token Plan / 第三者残高 / カスタム)が選択されているか
|
||||
3. 「スクリプトをテスト」をクリックして具体的なエラー情報を確認
|
||||
4. API Key / Base URL などの必須フィールドが正しく入力されているか
|
||||
5. プロバイダーのクォータエンドポイントへのネットワークアクセス可否
|
||||
6. プロバイダーが「現在有効」状態のときのみ、バックグラウンドの自動更新がトリガーされます
|
||||
|
||||
### クエリ失敗
|
||||
|
||||
**確認事項**:
|
||||
|
||||
@@ -118,27 +118,8 @@ CC Switch は強力な検索とフィルタリング機能を提供していま
|
||||
|
||||
### アンインストールの効果
|
||||
|
||||
- **自動バックアップ**:削除前にスキルが `~/.cc-switch/skill-backups/` にバックアップされる
|
||||
- すべてのアプリディレクトリ(Claude、Codex、Gemini、OpenCode)からスキルを削除
|
||||
- SSOT ディレクトリ(`~/.cc-switch/skills/`)からスキルを削除
|
||||
- データベースからスキルレコードを削除
|
||||
|
||||
### バックアップから復元
|
||||
|
||||
以前アンインストールしたスキルを復元する場合:
|
||||
|
||||
1. Skills ページを開く
|
||||
2. **バックアップから復元** ボタンをクリック
|
||||
3. リスト(スキル名とバックアップ日が表示)から復元したいバックアップを選択
|
||||
4. スキルが復元され、現在のアプリで有効化される
|
||||
|
||||
### バックアップの削除
|
||||
|
||||
古いスキルバックアップを削除するには:
|
||||
|
||||
1. 復元ダイアログで削除したいバックアップを見つける
|
||||
2. バックアップエントリの横にある **削除** ボタンをクリック
|
||||
3. 削除を確認(この操作は取り消せません)
|
||||
- ローカルのスキルフォルダを削除
|
||||
- インストール状態を更新
|
||||
|
||||
## リポジトリ管理
|
||||
|
||||
@@ -192,59 +173,11 @@ Subdirectory: skills
|
||||
|
||||
## スキルの更新
|
||||
|
||||
v3.13.0 より、Skills は **自動更新検出** と **一括更新** に対応しました —— アンインストール&再インストールの必要はありません。
|
||||
現在、自動更新には対応していません。スキルを更新するには:
|
||||
|
||||
### 更新検出の仕組み
|
||||
|
||||
CC Switch は **SHA-256 コンテンツハッシュ** によってローカルにインストールされた skill とリモートリポジトリのバージョンを比較します。リモートに何らかのファイル変更があれば、対応するローカル skill カードに「新しいバージョンあり」のインジケーターが自動的に表示されます。
|
||||
|
||||
### 単体更新
|
||||
|
||||
更新が必要な skill について:
|
||||
|
||||
1. Skills パネルで更新インジケーター付きの skill カードを見つける
|
||||
2. カード上の **更新** ボタンをクリック
|
||||
3. ダウンロード完了を待つ —— ステータスは自動的に更新されます
|
||||
|
||||
### 一括更新
|
||||
|
||||
複数の skill に更新が必要な場合:
|
||||
|
||||
1. Skills パネル上部の **すべて更新** ボタンをクリック(スライドインアニメーション付きで表示)
|
||||
2. CC Switch が更新が必要なすべての skill を一括ダウンロード
|
||||
3. 完了後パネルが自動的に更新され、更新インジケーターは消えます
|
||||
|
||||
> **ヒント**:定期的に「更新」ボタンをクリックしてリモートスキャンをトリガーし、更新検出の結果を最新に保ってください。
|
||||
|
||||
## 保存場所の切り替え
|
||||
|
||||
v3.13.0 より、Skills の **ソース保存場所** は 2 つの場所から切り替え可能になりました:
|
||||
|
||||
| 場所 | 説明 |
|
||||
| ------------------------ | -------------------------------------------------------------------- |
|
||||
| **CC Switch 内蔵保存** | デフォルト位置 `~/.cc-switch/skills/`、CC Switch が一元管理 |
|
||||
| **`~/.agents/skills`** | コミュニティの agent ツール規約に準拠した共有ディレクトリ、他ツールとの連携に適する |
|
||||
|
||||
### 切り替え方法
|
||||
|
||||
Skills パネルの設定または管理メニューから対象の保存場所を選択します。切り替えの際 **skill の状態は失われません** —— CC Switch が既存の skill を新しい場所へスムーズに移行します。
|
||||
|
||||
> ⚠️ **区別**:本節の「保存場所の切り替え」は skill の **ソース保存** を管理します。一方、[1.5 個人設定 → Skills 同期方式](../1-getting-started/1.5-settings.md) は skill を **各アプリディレクトリへどう配布するか**(シンボリックリンク vs コピー)を管理します。両者は併用します。
|
||||
|
||||
## 公式レジストリ検索(skills.sh)
|
||||
|
||||
v3.13.0 では **skills.sh** 公式レジストリ検索を統合し、CC Switch 内から直接コミュニティ skill を発見できます。
|
||||
|
||||
### 使用手順
|
||||
|
||||
1. 「リポジトリ管理」ボタンをクリックしてダイアログを開く
|
||||
2. ダイアログ内の **skills.sh 検索** 入力欄を使用
|
||||
3. キーワードを入力してリアルタイムで結果をフィルタリング
|
||||
4. 対象の skill をクリックして自分のリポジトリリストに素早く追加
|
||||
|
||||
v3.13.0 では skills.sh のリンク切れと空の説明への対応も修正され、コミュニティ skill のメタデータ表示がより安定しました。
|
||||
|
||||
## トラブルシューティング
|
||||
1. 既存のスキルをアンインストール
|
||||
2. リストを更新
|
||||
3. 再度インストール
|
||||
|
||||
### スキルリストが空の場合
|
||||
|
||||
@@ -272,15 +205,3 @@ v3.13.0 では skills.sh のリンク切れと空の説明への対応も修正
|
||||
- ネットワーク接続を確認
|
||||
- ディスク容量を確認
|
||||
- ディレクトリの権限を確認
|
||||
|
||||
### 更新ボタンが表示されない場合
|
||||
|
||||
考えられる原因:
|
||||
|
||||
- リモートリポジトリに新しいコンテンツがない
|
||||
- CC Switch が最新のスキャンを完了していない
|
||||
|
||||
解決方法:
|
||||
|
||||
- 「更新」をクリックして再スキャン
|
||||
- リポジトリ設定が正しいブランチとパスを指していることを確認
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
# 3.4 セッションマネージャー
|
||||
|
||||
セッションマネージャーでは、対応するすべての CLI ツールの会話セッションを一か所で閲覧、検索、管理できます。
|
||||
|
||||
## 対応アプリ
|
||||
|
||||
| アプリ | セッション保存場所 |
|
||||
|------|----------|
|
||||
| Claude Code | `~/.cache/claude/projects/*.jsonl` |
|
||||
| Codex | Codex 設定のセッションディレクトリ |
|
||||
| OpenCode | `~/.local/share/opencode/`(JSON または SQLite) |
|
||||
| OpenClaw | `~/.openclaw/agents/<agent>/sessions/*.jsonl` |
|
||||
| Gemini CLI | `~/.cache/gemini/tmp/<project_hash>/chats/` |
|
||||
|
||||
## セッションマネージャーを開く
|
||||
|
||||
メインナビゲーションバーの **セッション** ボタンをクリックします。
|
||||
|
||||
> **注意**:セッションボタンは対応する 5 つのアプリすべてで表示されます。
|
||||
|
||||
## インターフェースのレイアウト
|
||||
|
||||
セッションマネージャーは **2 カラムレイアウト** を採用しています:
|
||||
|
||||
- **左パネル**:検索とフィルターツールバー付きのセッションリスト
|
||||
- **右パネル**:選択したセッションの詳細と会話履歴
|
||||
|
||||
### セッションリスト(左パネル)
|
||||
|
||||
各セッションエントリには以下が表示されます:
|
||||
- プロバイダーアイコン
|
||||
- セッションタイトル
|
||||
- 最終アクティブ時間(相対形式、例:「5分前」)
|
||||
|
||||
### セッション詳細(右パネル)
|
||||
|
||||
セッションを選択すると、右パネルに以下が表示されます:
|
||||
- **タイトル**:セッションタイトル、プロジェクトディレクトリ名、またはセッション ID から取得
|
||||
- **最終アクティブ日時**:完全なタイムスタンプ
|
||||
- **プロジェクトディレクトリ**:クリックでフルパスをコピー(ベース名とツールチップでフルパスを表示)
|
||||
- **再開コマンド**:利用可能な場合、モノスペースフォントで表示
|
||||
- **会話履歴**:メッセージの全文記録
|
||||
|
||||
## 検索とフィルタリング
|
||||
|
||||
### 全文検索
|
||||
|
||||
左パネル上部の検索ボックスを使用して、以下の項目を横断的に検索できます:
|
||||
- セッション ID
|
||||
- タイトル
|
||||
- サマリー
|
||||
- プロジェクトディレクトリ
|
||||
- ソースファイルパス
|
||||
|
||||
前方一致検索に対応し、リアルタイムで結果をフィルタリングします。**Esc** で検索をクリアできます。
|
||||
|
||||
### プロバイダーフィルター
|
||||
|
||||
左パネル右上のプロバイダーフィルタードロップダウンをクリックして、アプリ別にフィルタリングします:
|
||||
- **すべて** — すべてのプロバイダーのセッションを表示
|
||||
- **Claude Code**
|
||||
- **Codex**
|
||||
- **OpenCode**
|
||||
- **OpenClaw**
|
||||
- **Gemini CLI**
|
||||
|
||||
フィルターは検索と組み合わせて使用できます。
|
||||
|
||||
### 更新
|
||||
|
||||
更新ボタン(循環矢印アイコン)をクリックすると、すべてのプロバイダーディレクトリを再スキャンして新しいセッションや削除済みセッションを検出します。
|
||||
|
||||
## セッション操作
|
||||
|
||||
### セッションの再開
|
||||
|
||||
選択したセッションの **再開** ボタン(再生アイコン)をクリックして、会話を続行します。
|
||||
|
||||
**macOS の場合:**
|
||||
- CC Switch は設定済みのターミナルで再開コマンドを起動します
|
||||
- ターミナルはセッションのプロジェクトディレクトリで開きます
|
||||
- ターミナルの起動に失敗した場合、コマンドがクリップボードにコピーされます
|
||||
|
||||
**対応ターミナル(macOS):** Terminal.app、iTerm2、Ghostty、Kitty、WezTerm、Alacritty
|
||||
|
||||
**その他のプラットフォーム:**
|
||||
- 再開コマンドがクリップボードにコピーされます
|
||||
- ターミナルに貼り付けてセッションを再開してください
|
||||
|
||||
> 再開コマンドが利用できないセッションでは、再開ボタンは無効になります。
|
||||
|
||||
#### ディレクトリピッカー(Claude ターミナル再開)
|
||||
|
||||
v3.13.0 より、**Claude セッション** の再開前に **ディレクトリピッカー** が表示され、デフォルトのプロジェクトディレクトリを上書きできます。以下のシナリオに対応します:
|
||||
|
||||
- **プロジェクトが移動された**:元のプロジェクトディレクトリが移動・リネームされた
|
||||
- **シンボリックリンク切れ**:元のパスにアクセスできない
|
||||
- **一時的なディレクトリ変更**:異なる作業ディレクトリで会話を続けたい
|
||||
|
||||
**使用方法**:
|
||||
|
||||
1. Claude セッションの **再開** ボタンをクリック
|
||||
2. 表示されるディレクトリピッカーで、デフォルトのディレクトリを確認するか、新しいディレクトリを選択
|
||||
3. CC Switch が選択したディレクトリで Claude ターミナルセッションを起動します
|
||||
|
||||
> **ヒント**:Codex / Gemini / OpenCode / OpenClaw のセッション再開フローには現在ディレクトリピッカーは含まれず、セッション元のプロジェクトディレクトリを使用します。
|
||||
|
||||
### セッションの削除
|
||||
|
||||
**削除** ボタン(ゴミ箱アイコン)をクリックすると、セッションファイルが完全に削除されます。削除前に確認ダイアログが表示されます。
|
||||
|
||||
> ローカルソースパスのないセッション(不変のセッションなど)は削除できません。
|
||||
|
||||
### 一括操作
|
||||
|
||||
複数のセッションを一度に管理するには:
|
||||
|
||||
1. 左パネルツールバーの **一括モード** ボタン(チェックボックスアイコン)をクリック
|
||||
2. 表示されるチェックボックスでセッションを選択
|
||||
3. **すべて選択** でフィルタリング結果をすべて選択、または **クリア** で選択解除
|
||||
4. **一括削除**(赤いゴミ箱アイコン)をクリックして選択したすべてのセッションを削除
|
||||
|
||||
削除前に件数を表示する確認ダイアログが表示されます。結果には成功した削除件数と失敗件数が報告されます。
|
||||
|
||||
## 会話履歴
|
||||
|
||||
### メッセージの表示
|
||||
|
||||
メッセージは役割ごとに色分けされます:
|
||||
- **ユーザー** メッセージ:緑、左寄せ
|
||||
- **AI**(アシスタント)メッセージ:青、右寄せ
|
||||
- **システム** メッセージ:アンバー
|
||||
- **ツール** メッセージ:パープル
|
||||
|
||||
### 目次
|
||||
|
||||
長い会話の場合、目次機能が利用できます:
|
||||
- **デスクトップ(XL+ 画面)**:右側のサイドバーにユーザーメッセージのプレビューを表示
|
||||
- **小さい画面**:右下のフローティングボタン(リストアイコン)をクリックするとダイアログが開く
|
||||
|
||||
エントリをクリックすると該当メッセージにスクロールし、一時的にハイライト表示されます。
|
||||
|
||||
## ヒント
|
||||
|
||||
- セッションは最終アクティブ時間の新しい順にソートされます
|
||||
- セッション数バッジは検索やフィルタリングに応じて更新されます
|
||||
- OpenCode のセッションは JSON ファイルと SQLite データベースの両方から取得される場合があります(重複は自動的に除去されます)
|
||||
@@ -1,85 +0,0 @@
|
||||
# 3.5 ワークスペースファイルとデイリーメモリー
|
||||
|
||||
## 概要
|
||||
|
||||
ワークスペースパネルは、**OpenClaw** 向けのファイル管理とデイリーメモリー機能を提供します。ワークスペース設定ファイルの編集やデイリーメモリージャーナルの管理が可能です。
|
||||
|
||||
> この機能は OpenClaw 専用です。ワークスペースボタンは、OpenClaw が選択されている場合にナビゲーションバーに表示されます。
|
||||
|
||||
## ワークスペースファイル
|
||||
|
||||
### ファイルの保存場所
|
||||
|
||||
すべてのワークスペースファイルは `~/.openclaw/workspace/` に保存されます。
|
||||
|
||||
パネル上部のディレクトリパスをクリックすると、ファイルマネージャーで開きます。
|
||||
|
||||
### 利用可能なファイル
|
||||
|
||||
CC Switch は 9 つのワークスペースファイルを管理しており、それぞれ特定の役割を持っています:
|
||||
|
||||
| ファイル | 説明 |
|
||||
|------|------|
|
||||
| **AGENTS.md** | エージェントの定義と設定 |
|
||||
| **SOUL.md** | システムのソウル/パーソナリティ設定 |
|
||||
| **USER.md** | ユーザープロファイル情報 |
|
||||
| **IDENTITY.md** | アイデンティティとロールの定義 |
|
||||
| **TOOLS.md** | 利用可能なツールの設定 |
|
||||
| **MEMORY.md** | システムメモリー |
|
||||
| **HEARTBEAT.md** | ハートビート設定 |
|
||||
| **BOOTSTRAP.md** | ブートストラップシーケンス |
|
||||
| **BOOT.md** | ブート設定 |
|
||||
|
||||
### ファイルステータス
|
||||
|
||||
各ファイルにはステータスインジケーターが表示されます:
|
||||
- **緑のチェックマーク**:ファイルがディスク上に存在
|
||||
- **空の円**:ファイルがまだ存在しない(初回保存時に作成)
|
||||
|
||||
### ファイルの編集
|
||||
|
||||
1. ファイルカードをクリックして Markdown エディタを開く
|
||||
2. コンテンツを編集
|
||||
3. **保存** をクリックしてディスクに書き込み
|
||||
|
||||
ファイルがまだ存在しない場合は、初回保存時に作成されます。
|
||||
|
||||
## デイリーメモリー
|
||||
|
||||
デイリーメモリー機能は、`~/.openclaw/workspace/memory/` に保存される日付別のジャーナルシステムを提供します。
|
||||
|
||||
### デイリーメモリーへのアクセス
|
||||
|
||||
ワークスペースファイルグリッドの **デイリーメモリー** カードをクリックして、メモリーパネルを開きます。
|
||||
|
||||
### ファイルリスト
|
||||
|
||||
パネルには日付の新しい順にすべてのデイリーメモリーファイルが表示されます。各エントリには以下が表示されます:
|
||||
- **日付**(ファイル名から変換、例:`2026-04-01.md`)
|
||||
- **ファイルサイズ**
|
||||
- **プレビュー**(コンテンツの最初の 2 行)
|
||||
|
||||
### 今日のノートを作成
|
||||
|
||||
**今日のノートを作成** ボタンをクリックすると:
|
||||
- 今日の日付(`YYYY-MM-DD.md`)で新しいノートを開く
|
||||
- 今日のノートがすでに存在する場合は、編集用に開く
|
||||
- ファイルは保存をクリックした後に保存される
|
||||
|
||||
### 検索
|
||||
|
||||
すべてのデイリーメモリーファイルを横断検索できます:
|
||||
|
||||
1. **Cmd/Ctrl+F** を押すか、検索アイコンをクリック
|
||||
2. 検索語を入力
|
||||
3. 結果には以下が表示されます:
|
||||
- ファイルごとのマッチ数
|
||||
- マッチした行のスニペットプレビュー
|
||||
- ファイルの日付とサイズ
|
||||
|
||||
**Esc** で検索を閉じます。
|
||||
|
||||
### 編集と削除
|
||||
|
||||
- **編集**:ファイルエントリをクリックして Markdown エディタで開く
|
||||
- **削除**:ファイルエントリにマウスをホバーして削除アイコンをクリック。確認ダイアログが表示されます(削除は取り消せません)。
|
||||
@@ -150,20 +150,6 @@ base_url = "http://127.0.0.1:15721/v1"
|
||||
GOOGLE_GEMINI_BASE_URL=http://127.0.0.1:15721
|
||||
```
|
||||
|
||||
## API フォーマット変換
|
||||
|
||||
プロキシは、Anthropic 以外のフォーマットが設定されたプロバイダーに対して、API フォーマットの自動変換をサポートします。これにより、OpenAI 互換 API のみをサポートするプロバイダーを Claude Code で使用できます。
|
||||
|
||||
| プロバイダー API フォーマット | プロキシの動作 |
|
||||
|------|------|
|
||||
| **Anthropic Messages** | パススルー(変換なし) |
|
||||
| **OpenAI Chat Completions** | Anthropic リクエストを OpenAI Chat フォーマットに変換し、レスポンスを逆変換 |
|
||||
| **OpenAI Responses API** | Anthropic リクエストを OpenAI Responses フォーマットに変換し、レスポンスを逆変換 |
|
||||
|
||||
API フォーマットはプロバイダーごとに、Claude プロバイダーの追加・編集時の[高度なオプション](../2-providers/2.1-add.md#api-フォーマットclaude-のみ)で設定します。
|
||||
|
||||
> **注意**:フォーマット変換にはプロキシがアプリ接管有効の状態で稼働している必要があります。変換はストリーミングと非ストリーミングの両方のリクエストに対応しています。
|
||||
|
||||
## プロキシの停止
|
||||
|
||||
### 方法 1:メイン画面のスイッチ
|
||||
|
||||
@@ -9,34 +9,14 @@
|
||||
- 使用パターンの分析
|
||||
- 問題のトラブルシューティング
|
||||
|
||||
v3.13.0 より、使用量データの取得元は 2 つあります:
|
||||
|
||||
| データ取得元 | 対象範囲 | プロキシ経由が必要? |
|
||||
| ---------------------------------- | --------------------------------------- | -------------------- |
|
||||
| **プロキシリクエストログ** | プロキシを経由したすべてのリクエスト | 必要 |
|
||||
| **CLI セッションログ**(v3.13 新規)| Claude / Codex / Gemini のセッション履歴 | 不要 |
|
||||
|
||||
- **Codex セッション**:JSONL セッションログに基づく **精密な解析** に切り替え、従来の推定値を置き換え。モデル名を正規化することで料金検索の整合性を保証
|
||||
- **Gemini セッション**:Gemini CLI のセッションログから精密に同期
|
||||
- **Claude セッション**:セッションログから直接使用量をインポート可能
|
||||
- 使用量パネルは **アプリ別フィルタリング**(Claude / Codex / Gemini)に対応し、データが混在しません
|
||||
|
||||
## 前提条件
|
||||
|
||||
使用するデータ取得元によって前提条件が異なります:
|
||||
|
||||
**プロキシリクエストログ**(すべてのアプリとプロキシリクエストを対象):
|
||||
使用量統計機能を使用するには:
|
||||
|
||||
1. プロキシサービスを起動
|
||||
2. アプリケーション接管を有効化
|
||||
3. ログ記録を有効化
|
||||
|
||||
**CLI セッションログ**(v3.13 新規、プロキシ不要):
|
||||
|
||||
1. CC Switch で対応するアプリ(Claude / Codex / Gemini)を有効化
|
||||
2. 対応する CLI にセッション履歴ファイルがあること
|
||||
3. CC Switch が定期的にセッションディレクトリをスキャンして使用量をインポートします
|
||||
|
||||
## 使用量統計を開く
|
||||
|
||||
設定 → 使用量 タブ
|
||||
@@ -206,22 +186,6 @@ Token 使用量の変化を表示:
|
||||
| キャッシュ読取価格 | 100 万キャッシュヒット Token あたりの価格 |
|
||||
| キャッシュ作成価格 | 100 万キャッシュ作成 Token あたりの価格 |
|
||||
|
||||
### モデル ID の正規化ルール
|
||||
|
||||
料金を照合する前に、CC Switch はリクエスト内のモデル ID を正規化します:
|
||||
|
||||
- 最後の `/` より前の接頭辞を削除
|
||||
- `:` 以降の接尾辞を削除
|
||||
- `@` を `-` に置換
|
||||
|
||||
料金設定では、リクエスト内の完全な元のモデル名ではなく、正規化後のモデル ID を入力してください。
|
||||
|
||||
| 元のモデル名 | 入力するモデル ID | 説明 |
|
||||
|------|------|------|
|
||||
| `stepfun-ai/step-3.5-flash` | `step-3.5-flash` | プロバイダー接頭辞を削除 |
|
||||
| `moonshotai/kimi-k2-0905:exa` | `kimi-k2-0905` | 接頭辞と `:` 以降を削除 |
|
||||
| `gpt-5.2-codex@low` | `gpt-5.2-codex-low` | `@` を `-` に置換 |
|
||||
|
||||
### 操作
|
||||
|
||||
- **追加**:「追加」ボタンで新しいモデル価格を追加
|
||||
@@ -232,7 +196,7 @@ Token 使用量の変化を表示:
|
||||
|
||||
### プリセット価格
|
||||
|
||||
CC Switch は一般的なモデルの公式価格(100 万 Token あたり)をプリセットしています。v3.13.0 では一部モデルの **CNY → USD 価格を修正** し、これまで欠けていたモデル定義を補完したほか、**MiniMax のプランクォータ計算** と **0% → 100% の使用進捗** 表示を修正し、費用見積もりとプラン進捗の表示がより正確になりました。
|
||||
CC Switch は一般的なモデルの公式価格(100 万 Token あたり)をプリセットしています:
|
||||
|
||||
**Claude シリーズ(ドル)**:
|
||||
|
||||
|
||||
@@ -2,15 +2,12 @@
|
||||
|
||||
## 機能説明
|
||||
|
||||
モデルテスト機能(**Stream Check** とも呼ばれる)は、プロバイダーに設定されたモデルが使用可能かどうかを確認するために、実際の API リクエストを送信してテストします:
|
||||
モデルテスト機能は、プロバイダーに設定されたモデルが使用可能かどうかを確認するために、実際の API リクエストを送信してテストします:
|
||||
|
||||
- モデルが存在するか
|
||||
- API Key が有効か
|
||||
- エンドポイントが正常に応答するか
|
||||
- 応答レイテンシが正常か
|
||||
- ストリーミングレスポンスの初回トークン時間(TTFB)
|
||||
|
||||
v3.13.0 より、Stream Check の対応範囲が **5 つのアプリ全対応**(Claude / Codex / Gemini / OpenCode / OpenClaw)に拡張され、OpenClaw の全プロトコルバリアント(`openai-completions` など)も含まれます。OpenCode は npm パッケージマッピングで自動識別、OpenClaw はカスタム `auth-header` 検出、Bedrock エラーメッセージ、`baseURL` フォールバックなどのエッジケースにも対応しています。
|
||||
|
||||
## 設定を開く
|
||||
|
||||
@@ -20,13 +17,11 @@ v3.13.0 より、Stream Check の対応範囲が **5 つのアプリ全対応**
|
||||
|
||||
各アプリのテスト用モデルを設定します:
|
||||
|
||||
| アプリ | 設定項目 | デフォルト値 | 説明 |
|
||||
| ---------- | ---------------- | ------------------ | ------------------------------------------------------- |
|
||||
| Claude | Claude モデル | システムデフォルト | Haiku シリーズの使用を推奨(低コスト・高速) |
|
||||
| Codex | Codex モデル | システムデフォルト | mini シリーズの使用を推奨 |
|
||||
| Gemini | Gemini モデル | システムデフォルト | Flash シリーズの使用を推奨 |
|
||||
| OpenCode | OpenCode モデル | システムデフォルト | v3.13.0 で追加、npm パッケージマッピングで自動検出 |
|
||||
| OpenClaw | OpenClaw モデル | システムデフォルト | v3.13.0 で追加、全プロトコルバリアントとカスタム auth-header に対応 |
|
||||
| アプリ | 設定項目 | デフォルト値 | 説明 |
|
||||
|------|--------|--------|------|
|
||||
| Claude | Claude モデル | システムデフォルト | Haiku シリーズの使用を推奨(低コスト・高速) |
|
||||
| Codex | Codex モデル | システムデフォルト | mini シリーズの使用を推奨 |
|
||||
| Gemini | Gemini モデル | システムデフォルト | Flash シリーズの使用を推奨 |
|
||||
|
||||
### モデル選択のアドバイス
|
||||
|
||||
|
||||
@@ -12,11 +12,12 @@
|
||||
|
||||
```
|
||||
~/.cc-switch/
|
||||
├── cc-switch.db # SQLite データベース(SSOT)
|
||||
├── cc-switch.db # SQLite データベース
|
||||
├── settings.json # デバイスレベルの設定
|
||||
├── skills/ # スキル SSOT ディレクトリ
|
||||
├── skill-backups/ # スキルバックアップ(アンインストール時に作成)
|
||||
└── db_backup_*.db # データベースバックアップ
|
||||
└── backups/ # 自動バックアップ
|
||||
├── backup-20251230-120000.json
|
||||
├── backup-20251229-180000.json
|
||||
└── ...
|
||||
```
|
||||
|
||||
### データベースの内容
|
||||
|
||||
@@ -2,9 +2,23 @@
|
||||
|
||||
## インストールに関する問題
|
||||
|
||||
### macOS のインストール
|
||||
### macOS で「不明な開発者」と表示される
|
||||
|
||||
CC Switch の macOS 版は Apple のコード署名と公証を受けています。追加の操作なしで直接ダウンロードしてインストールできます。問題が発生した場合は、[Releases ページ](https://github.com/farion1231/cc-switch/releases) から最新版をダウンロードしてください。
|
||||
**問題**:初回起動時に「開けません。身元不明の開発者のものです」と表示される
|
||||
|
||||
**解決方法 1**:システム設定から
|
||||
1. 警告ダイアログを閉じる
|
||||
2. 「システム設定」→「プライバシーとセキュリティ」を開く
|
||||
3. CC Switch に関する表示を見つける
|
||||
4. 「このまま開く」をクリック
|
||||
5. 再度アプリを開く
|
||||
|
||||
**解決方法 2**:ターミナルコマンドから(推奨)
|
||||
```bash
|
||||
sudo xattr -dr com.apple.quarantine /Applications/CC\ Switch.app/
|
||||
```
|
||||
|
||||
実行後、正常にアプリを開けるようになります。
|
||||
|
||||
### Windows でインストール後に起動できない
|
||||
|
||||
@@ -156,51 +170,6 @@ chmod +x CC-Switch-*.AppImage
|
||||
- [ ] ログ記録が有効か
|
||||
- [ ] プロキシ経由でリクエストがあったか
|
||||
|
||||
## クォータ・残高
|
||||
|
||||
### なぜ一部のプロバイダーは自動的にクォータが表示され、他は手動で有効化する必要があるのですか?
|
||||
|
||||
**公式サブスクリプション系**(Claude / Codex / Gemini 公式ログイン、GitHub Copilot、Codex OAuth リバースプロキシ)のみ、プロバイダーを有効化すると自動的にクォータが表示されます。**その他すべてのプロバイダー**(Token Plan および第三者残高クエリを含む)は、プロバイダーカードの「使用量クエリ」パネルで手動でスイッチをオンにし、内蔵テンプレートを選択する必要があります。同じリクエスト URL が「プラン」と「残高」の両方のクエリモードを持つ可能性があるため、ユーザー自身が選択する必要があるからです。詳細は [2.5 使用量クエリ → 手動有効化](../2-providers/2.5-usage-query.md#手動有効化内蔵テンプレート--カスタムスクリプト) を参照してください。
|
||||
|
||||
### 公式サブスクリプションのプロバイダーにクォータが表示されない
|
||||
|
||||
**確認事項**:
|
||||
1. プロバイダーが「現在有効」状態であることを確認(非アクティブ時はクエリがトリガーされません)
|
||||
2. Copilot / Codex OAuth の場合、OAuth Token がまだ有効期限内か確認。カードに「セッション期限切れ」と表示されたら **OAuth 認証センター** で再ログインしてください
|
||||
3. ネットワーク接続を確認
|
||||
4. カード上の更新アイコンをクリックして手動で再取得
|
||||
|
||||
### Token Plan や第三者残高を有効化しても表示されない
|
||||
|
||||
**確認事項**:
|
||||
1. 「使用量クエリ」パネルで「使用量クエリを有効にする」スイッチがオンになっているか
|
||||
2. 適切な内蔵テンプレートが選択されて保存されているか
|
||||
3. 「スクリプトをテスト」をクリックして具体的なエラーを確認
|
||||
4. プロバイダーが「現在有効」状態のときのみバックグラウンド自動更新が動作します
|
||||
|
||||
### Codex の使用量が直接接続時と合わない
|
||||
|
||||
v3.13.0 で Codex の使用量が推定値から **JSONL セッションログに基づく精密解析** に切り替わり、モデル名が正規化されて料金検索の整合性が保たれます。新しいデータは公式の請求と一致します。古い推定データが残っている場合は、履歴エントリを削除するか、新しいセッションデータによる上書きを待ってください。
|
||||
|
||||
## Codex OAuth リバースプロキシ
|
||||
|
||||
### Codex OAuth のログイン方法は?
|
||||
|
||||
完全な Device Code ログインフロー(認証コード + ブラウザ認証)、2 つの入口(プロバイダー追加パネル / OAuth 認証センター)、マルチアカウント管理、よくある失敗シナリオは [2.1 プロバイダーの追加 → Codex OAuth リバースプロキシ(Claude プロバイダー)](../2-providers/2.1-add.md#codex-oauth-リバースプロキシclaude-プロバイダー) を参照してください。
|
||||
|
||||
### Codex OAuth リバースプロキシを有効化するリスクは?
|
||||
|
||||
Codex OAuth リバースプロキシは **リバースエンジニアリングされた OAuth フロー** で ChatGPT アカウントの Codex サービスにアクセスします。OpenAI の利用規約に違反する可能性があり、アカウント制限や停止のリスクがあり、長期的な可用性も保証されません。**有効化すると自己責任となります**。
|
||||
|
||||
完全な免責事項は [v3.13.0 Release Notes → リスク通知](../../../release-notes/v3.13.0-ja.md#️-リスク通知) と [2.1 プロバイダーの追加 → Codex OAuth リバースプロキシ](../2-providers/2.1-add.md#codex-oauth-リバースプロキシclaude-プロバイダー) を参照してください。
|
||||
|
||||
### Codex OAuth にログインしたがクォータが表示されない
|
||||
|
||||
**解決方法**:
|
||||
1. **OAuth 認証センター**(設定 → OAuth 認証センター、Beta ラベル付き)で OAuth ログインフローが完了していることを確認
|
||||
2. Token がまだ有効期限内か確認。カードに「セッション期限切れ」と表示される場合は Token が更新できない状態
|
||||
3. 期限切れの場合は、OAuth 認証センターでアカウントを削除して再ログインしてください
|
||||
|
||||
## その他の問題
|
||||
|
||||
### トレイアイコンが表示されない
|
||||
@@ -228,20 +197,6 @@ Codex OAuth リバースプロキシは **リバースエンジニアリング
|
||||
2. 最新版を手動でダウンロードしてインストール
|
||||
3. Homebrew を使用する場合:`brew upgrade --cask cc-switch`
|
||||
|
||||
## 軽量モード
|
||||
|
||||
### 軽量モードに入るには?
|
||||
|
||||
システムトレイメニューから「軽量モード」をトグルします。メインウィンドウが閉じ、CC Switch はトレイ専用アプリとして動作します。再度トグルするか「メインウィンドウを開く」をクリックすると終了します。
|
||||
|
||||
### 軽量モードではメモリ使用量が少なくなる?
|
||||
|
||||
はい。軽量モードではメインウィンドウとその Web ビューを破棄するため、トレイメニュー機能を維持しながらメモリ使用量を大幅に削減します。
|
||||
|
||||
### 軽量モードでもディープリンクでメインウィンドウを呼び出せる?
|
||||
|
||||
はい。CC Switch v3.13.0 より、すべてのウィンドウ再表示パス(通常起動、ディープリンク、シングルトン起動、トレイ `show_main`、軽量モードからの復帰)をカバーしています。`ccswitch://` リンクをクリックするとメインウィンドウが **必要に応じて再構築** され、インポート確認ダイアログが表示されます。初回起動は通常状態より若干遅くなります(ウィンドウの再構築が必要なため)が、以降の切り替えは通常速度に戻ります。
|
||||
|
||||
## ヘルプの入手
|
||||
|
||||
### Issue の提出
|
||||
|
||||
@@ -24,9 +24,7 @@ CC Switch ユーザーマニュアル
|
||||
├── 3. 拡張機能
|
||||
│ ├── 3.1 MCP サーバー管理
|
||||
│ ├── 3.2 Prompts プロンプト管理
|
||||
│ ├── 3.3 Skills スキル管理
|
||||
│ ├── 3.4 セッションマネージャー
|
||||
│ └── 3.5 ワークスペースとメモリー
|
||||
│ └── 3.3 Skills スキル管理
|
||||
│
|
||||
├── 4. プロキシと高可用性
|
||||
│ ├── 4.1 プロキシサービス
|
||||
@@ -71,8 +69,6 @@ CC Switch ユーザーマニュアル
|
||||
| [3.1-mcp.md](./3-extensions/3.1-mcp.md) | MCP プロトコル、サーバーの追加、アプリバインド |
|
||||
| [3.2-prompts.md](./3-extensions/3.2-prompts.md) | プリセットの作成、有効化の切り替え、スマートバックフィル |
|
||||
| [3.3-skills.md](./3-extensions/3.3-skills.md) | スキルの発見、インストール・アンインストール、リポジトリ管理 |
|
||||
| [3.4-sessions.md](./3-extensions/3.4-sessions.md) | セッションマネージャー:閲覧、検索、再開、削除 |
|
||||
| [3.5-workspace.md](./3-extensions/3.5-workspace.md) | ワークスペースファイルとデイリーメモリー(OpenClaw) |
|
||||
|
||||
### 4. プロキシと高可用性
|
||||
|
||||
@@ -103,19 +99,9 @@ CC Switch ユーザーマニュアル
|
||||
|
||||
## バージョン情報
|
||||
|
||||
- ドキュメントバージョン:v3.13.0
|
||||
- 最終更新:2026-04-08
|
||||
- CC Switch v3.13.0+ 対応
|
||||
|
||||
### v3.13.0 の注目機能
|
||||
|
||||
- **軽量モード**:トレイへ最小化時にメインウィンドウを破棄、アイドル時のリソース使用量をほぼゼロに — 詳細は [1.5 個人設定](./1-getting-started/1.5-settings.md)
|
||||
- **クォータ・残高表示**:公式サブスクリプション系(Claude/Codex/Gemini/Copilot/Codex OAuth)はカードに自動表示、Token Plan および第三者残高は内蔵テンプレートでワンクリック有効化 — 詳細は [2.5 使用量クエリ](./2-providers/2.5-usage-query.md)
|
||||
- **Codex OAuth リバースプロキシ**:ChatGPT アカウントで Claude Code 内から Codex サービスを再利用 — 詳細は [2.1 プロバイダーの追加](./2-providers/2.1-add.md)
|
||||
- **アプリ別トレイサブメニュー**:5 アプリ独立サブメニュー、メニューのオーバーフローを防止 — 詳細は [2.2 プロバイダーの切り替え](./2-providers/2.2-switch.md)
|
||||
- **Skills の発見と一括更新**:SHA-256 ハッシュによる更新検出、一括更新、skills.sh 公式レジストリ検索 — 詳細は [3.3 Skills スキル管理](./3-extensions/3.3-skills.md)
|
||||
- **完全URLエンドポイントモード**:高度なオプションで `base_url` を完全なアップストリームエンドポイントとして扱う — 詳細は [2.1 プロバイダーの追加](./2-providers/2.1-add.md)
|
||||
- **OpenCode / OpenClaw ストリームチェック完全対応**:Stream Check パネルを 5 アプリ全対応に拡張 — 詳細は [4.5 モデルテスト](./4-proxy/4.5-model-test.md)
|
||||
- ドキュメントバージョン:v3.12.0
|
||||
- 最終更新:2026-03-09
|
||||
- CC Switch v3.12.0+ 対応
|
||||
|
||||
## コントリビュート
|
||||
|
||||
|
||||
@@ -145,9 +145,21 @@ brew upgrade --cask cc-switch
|
||||
2. 解压得到 `CC Switch.app`
|
||||
3. 拖动到「应用程序」文件夹
|
||||
|
||||
### 已签名并公证
|
||||
### 首次打开提示
|
||||
|
||||
CC Switch macOS 版本已通过 Apple 代码签名和公证,可直接安装打开,无需额外操作。
|
||||
由于开发者没有 Apple 开发者账号,首次打开可能出现「未知开发者」警告:
|
||||
|
||||
**推荐解决方法**:
|
||||
打开终端执行以下命令:
|
||||
```bash
|
||||
sudo xattr -dr com.apple.quarantine /Applications/CC\ Switch.app/
|
||||
```
|
||||
|
||||
**备选解决方法(通过系统设置)**:
|
||||
1. 关闭警告弹窗
|
||||
2. 打开「系统设置」→「隐私与安全性」
|
||||
3. 找到 CC Switch 相关提示,点击「仍要打开」
|
||||
4. 再次打开应用即可正常使用
|
||||
|
||||
## Linux
|
||||
|
||||
|
||||
@@ -100,13 +100,10 @@ CC Switch 在系统托盘显示图标,提供快速操作入口。
|
||||
| 菜单项 | 功能 |
|
||||
|--------|------|
|
||||
| 打开主界面 | 显示主窗口并聚焦 |
|
||||
| 应用子菜单 | 按 Claude/Codex/Gemini/OpenCode/OpenClaw 分组的折叠子菜单(如 "Claude · PackyCode") |
|
||||
| 供应商列表 | 在每个子菜单内,点击切换,当前启用的显示勾选标记 |
|
||||
| 轻量模式 | 勾选框切换,进入/退出仅托盘运行模式 |
|
||||
| 应用分组 | 按 Claude/Codex/Gemini/OpenCode/OpenClaw 分组显示供应商 |
|
||||
| 供应商列表 | 点击切换,当前启用的显示勾选标记 |
|
||||
| 退出 | 完全退出应用 |
|
||||
|
||||
> **注意**:每个应用子菜单的标题会显示当前供应商名称(如 "Claude · PackyCode")。没有配置供应商的应用会显示禁用的"(无供应商)"条目。应用可见性由设置中的"应用可见性"选项控制。
|
||||
|
||||
### 多语言支持
|
||||
|
||||
托盘菜单支持三种语言,根据设置自动切换:
|
||||
@@ -117,17 +114,6 @@ CC Switch 在系统托盘显示图标,提供快速操作入口。
|
||||
| English | Open main window | Quit |
|
||||
| 日本語 | メインウィンドウを開く | 終了 |
|
||||
|
||||
### 轻量模式
|
||||
|
||||
托盘菜单包含 **轻量模式** 切换开关(勾选框)。启用后:
|
||||
|
||||
- 主窗口关闭以释放资源
|
||||
- 应用仅在系统托盘中运行
|
||||
- 你仍可通过托盘子菜单切换供应商
|
||||
- 在 macOS 上,Dock 图标也会隐藏
|
||||
|
||||
要退出轻量模式,取消勾选该选项或点击"打开主界面" — 主窗口将被重建并显示。
|
||||
|
||||
### 使用场景
|
||||
|
||||
托盘切换供应商无需打开主界面,适合:
|
||||
@@ -135,7 +121,6 @@ CC Switch 在系统托盘显示图标,提供快速操作入口。
|
||||
- 频繁切换供应商
|
||||
- 主窗口最小化时快速操作
|
||||
- 后台运行时管理配置
|
||||
- 使用轻量模式以最小化资源占用
|
||||
|
||||
## 设置页面
|
||||
|
||||
|
||||
@@ -33,10 +33,8 @@
|
||||
| 应用 | 生效方式 |
|
||||
|------|----------|
|
||||
| Claude Code | ✅ 即时生效(支持热重载) |
|
||||
| Codex | 需要关闭并重新打开终端 |
|
||||
| Codex | 需关闭并重新打开终端 |
|
||||
| Gemini | ✅ 即时生效(每次请求重新读取配置) |
|
||||
| OpenCode | 需要关闭并重新打开终端 |
|
||||
| OpenClaw | 需要关闭并重新打开终端 |
|
||||
|
||||
### Claude Code 首次安装提示
|
||||
|
||||
@@ -66,14 +64,6 @@ codex
|
||||
# Gemini - 启动后输入测试问题
|
||||
gemini
|
||||
> 你好,请简单介绍一下自己
|
||||
|
||||
# OpenCode - 启动后输入测试问题
|
||||
opencode
|
||||
> 你好,请简单介绍一下自己
|
||||
|
||||
# OpenClaw - 启动后输入测试问题
|
||||
openclaw
|
||||
> 你好,请简单介绍一下自己
|
||||
```
|
||||
|
||||
如果 AI 能正常回复,说明配置成功。
|
||||
|
||||
@@ -46,26 +46,6 @@ CC Switch 支持三种语言:
|
||||
|
||||
推荐使用「最小化到托盘」,方便通过托盘快速切换供应商。
|
||||
|
||||
### 轻量模式
|
||||
|
||||
v3.13.0 起新增「轻量模式」——一种**仅托盘运行**的状态,用于把空闲时的桌面占用降到最低。
|
||||
|
||||
**触发方式**:右键系统托盘图标 → 点击「轻量模式」。主窗口会被**销毁**(而不是隐藏),UI 资源和内存随之释放。
|
||||
|
||||
**退出方式**:从托盘菜单点击「打开主界面」,或通过深链接 / 再次启动 CC Switch。窗口会按需**重建**,状态保持一致。
|
||||
|
||||
| 特性 | 最小化到托盘 | 轻量模式 |
|
||||
| ------------ | -------------------- | ------------------------ |
|
||||
| UI 进程 | 保留在内存中 | 完全销毁 |
|
||||
| 空闲资源占用 | 与正常运行相当 | 接近零 |
|
||||
| 再次打开速度 | 瞬时(直接显示) | 略慢(需要重建窗口) |
|
||||
| 托盘切换功能 | 可用 | 可用 |
|
||||
| 深链接唤起 | 可用 | 可用(按需重建) |
|
||||
|
||||
> 💡 **使用场景**:如果你 CC Switch 长时间常驻后台,主要通过托盘菜单切换供应商,开启轻量模式能显著降低内存占用。
|
||||
|
||||
> ⚠️ **注意**:轻量模式状态不持久 — 下次正常启动时会回到普通模式。需要长期使用可搭配开机自启。
|
||||
|
||||
### Claude 插件集成
|
||||
|
||||
开启后,CC Switch 在切换供应商时会自动同步配置到 VS Code 中的 Claude Code 插件(写入 `~/.claude/config.json` 的 `primaryApiKey`)。
|
||||
@@ -187,74 +167,37 @@ CC Switch 自身数据的存储位置,默认为 `~/.cc-switch/`。
|
||||
|
||||
### 备份与恢复
|
||||
|
||||
备份管理面板提供对数据库备份的全面控制。
|
||||
管理自动备份:
|
||||
|
||||
#### 自动备份设置
|
||||
| 配置 | 说明 |
|
||||
| -------- | -------------------------- |
|
||||
| 备份间隔 | 自动备份的时间间隔(小时) |
|
||||
| 保留数量 | 保留的备份份数 |
|
||||
|
||||
| 配置 | 选项 | 默认值 |
|
||||
| -------- | ---------------------------------- | --------- |
|
||||
| 备份间隔 | 禁用、6h、12h、24h、48h、7d | 24 小时 |
|
||||
| 保留数量 | 3、5、10、15、20、30、50 | 10 个备份 |
|
||||
|
||||
设置间隔后,CC Switch 会按计划自动备份数据库。超出保留数量的旧备份会自动删除。
|
||||
|
||||
#### 备份列表
|
||||
|
||||
面板显示所有现有备份,包含:
|
||||
- **显示名称**(根据时间戳自动生成,如 `db_backup_20260315_143000`)
|
||||
- **创建时间**
|
||||
- **文件大小**(如 "1.5 MB")
|
||||
|
||||
#### 备份操作
|
||||
|
||||
| 操作 | 说明 |
|
||||
| ------------ | ------------------------------------------------------------------------ |
|
||||
| **立即备份** | 立即创建一个备份 |
|
||||
| **恢复** | 从选定的备份恢复数据库。恢复前会自动创建当前数据库的安全备份 |
|
||||
| **重命名** | 修改备份的显示名称 |
|
||||
| **删除** | 永久删除备份(需确认) |
|
||||
|
||||
> ⚠️ **重要**:恢复备份会覆盖当前数据库。恢复操作前始终会自动创建安全备份,以便在需要时恢复。
|
||||
支持查看备份列表和从备份恢复。
|
||||
|
||||
### 云同步(WebDAV)
|
||||
|
||||
通过 WebDAV 协议在多台设备间同步配置。使用 **v2 协议**,支持双层版本控制,提高可靠性。
|
||||
通过 WebDAV 协议在多台设备间同步配置。
|
||||
|
||||
| 配置项 | 说明 |
|
||||
| -------- | ---------------------------------------------------------------------------- |
|
||||
| 服务预设 | 坚果云 / Nextcloud / 群晖 / 自定义 |
|
||||
| 服务地址 | WebDAV 服务器 URL |
|
||||
| 用户名 | 登录用户名 |
|
||||
| 密码 | 登录密码(应用专用密码;已保存的凭据在未修改时会被保留) |
|
||||
| 远程目录 | 远程存储路径(默认 `cc-switch-sync`) |
|
||||
| 配置名称 | 设备配置文件名(默认 `default`) |
|
||||
| 自动同步 | 开启后按配置的间隔自动同步 |
|
||||
| 配置项 | 说明 |
|
||||
| -------- | ------------------------------------- |
|
||||
| 服务预设 | 坚果云 / Nextcloud / 群晖 / 自定义 |
|
||||
| 服务地址 | WebDAV 服务器 URL |
|
||||
| 用户名 | 登录用户名 |
|
||||
| 密码 | 登录密码(应用专用密码) |
|
||||
| 远程目录 | 远程存储路径(默认 `cc-switch-sync`) |
|
||||
| 配置名称 | 设备配置文件名(默认 `default`) |
|
||||
| 自动同步 | 开启后自动上传变更 |
|
||||
|
||||
#### 操作
|
||||
操作:
|
||||
|
||||
| 操作 | 说明 |
|
||||
| ------------ | -------------------------------------------------------------------------------------------- |
|
||||
| **测试连接** | 验证 WebDAV URL、用户名和密码是否有效 |
|
||||
| **上传** | 将本地数据库上传到远程,显示进度指示器 |
|
||||
| **下载** | 下载远程数据库。下载前显示远程快照信息(协议版本、数据库版本、时间戳、大小)供确认。覆盖本地数据库前会自动创建安全备份 |
|
||||
- **测试连接**:验证 WebDAV 配置是否正确
|
||||
- **保存**:保存配置并自动测试
|
||||
- **上传**:将本地数据上传到远程
|
||||
- **下载**:从远程下载数据到本地
|
||||
|
||||
#### 自动同步
|
||||
|
||||
启用 **自动同步** 后:
|
||||
- 首次激活时会显示确认对话框
|
||||
- CC Switch 按配置的间隔自动将数据库同步到 WebDAV
|
||||
- 面板中显示同步状态
|
||||
|
||||
#### 远程快照信息
|
||||
|
||||
下载前,CC Switch 会显示远程快照的详细信息:
|
||||
- 协议版本(v2)
|
||||
- 数据库兼容版本
|
||||
- 远程备份的时间戳
|
||||
- 文件大小
|
||||
- 兼容性状态(不兼容时显示警告)
|
||||
|
||||
> ⚠️ **注意**:上传会覆盖远程数据,下载会覆盖本地数据。下载前始终会自动创建安全备份。
|
||||
> ⚠️ **注意**:上传会覆盖远程数据,下载会覆盖本地数据。操作前请确认。
|
||||
|
||||
### 日志配置
|
||||
|
||||
@@ -271,26 +214,6 @@ CC Switch 自身数据的存储位置,默认为 `~/.cc-switch/`。
|
||||
- **debug** - 记录调试信息
|
||||
- **trace** - 记录所有详细信息
|
||||
|
||||
## OAuth 认证中心(Beta)
|
||||
|
||||
设置 → **OAuth 认证中心** Tab
|
||||
|
||||
v3.13.0 新增的 **OAuth 认证中心**(Beta)统一管理第三方 OAuth 凭据,目前支持两类账号:
|
||||
|
||||
| 账号类型 | 用途 |
|
||||
| ---------------------------- | ----------------------------------------------- |
|
||||
| **GitHub Copilot** | 配合 Copilot 反向代理使用 |
|
||||
| **ChatGPT (Codex OAuth)** | 配合 Codex OAuth 反向代理使用,管理 ChatGPT 账号 |
|
||||
|
||||
**你可以在这里**:
|
||||
|
||||
- 通过 Device Code 流程登录 ChatGPT / GitHub 账号
|
||||
- 查看已登录账号列表和认证状态
|
||||
- 为多账号设置默认账号
|
||||
- 移除单个账号或一键注销所有账号
|
||||
|
||||
> ⚠️ **注意**:这两项功能使用逆向 OAuth 流程,存在账号风险和服务条款风险。使用前请阅读 [2.1 添加供应商 → Codex OAuth 反向代理](../2-providers/2.1-add.md#codex-oauth-反向代理claude-供应商) 的完整风险提示。
|
||||
|
||||
## 关于页面
|
||||
|
||||
设置 → 关于 Tab
|
||||
|
||||
@@ -152,23 +152,6 @@
|
||||
| AWS Bedrock | AWS Bedrock 服务 |
|
||||
| OpenAI Compatible | OpenAI 兼容接口 |
|
||||
|
||||
## 自动获取模型
|
||||
|
||||
添加或编辑供应商时,可以自动从供应商端点发现可用模型列表,免去手动复制粘贴模型 ID 的繁琐流程。
|
||||
|
||||
1. 确保已填写 **API Key** 和 **端点地址**
|
||||
2. 点击模型输入框旁的 **获取模型** 按钮(下载图标)
|
||||
3. CC Switch 使用配置的 API Key 调用 OpenAI 兼容的 `/v1/models` 端点
|
||||
4. 从按类别分组的下拉菜单中选择模型
|
||||
|
||||
此功能覆盖全部五个应用 —— **Claude / Codex / Gemini / OpenCode / OpenClaw**,适用于所有支持 `/v1/models` 端点的供应商。
|
||||
|
||||
**常见错误**:
|
||||
- **认证失败(401/403)**:检查你的 API Key 是否正确
|
||||
- **端点不支持(404/405)**:该供应商未提供 `/v1/models` 端点,需手动填写模型 ID
|
||||
- **解析失败**:返回内容不符合 OpenAI 兼容格式
|
||||
- **超时**:端点响应缓慢,请稍后重试或检查网络
|
||||
|
||||
## 自定义配置
|
||||
|
||||
选择「自定义」预设后,需要手动编辑 JSON 配置。
|
||||
@@ -331,200 +314,8 @@ CC Switch 支持两种方式导入供应商配置:
|
||||
|
||||
> ⚠️ **注意**:导入会覆盖现有数据库,建议先导出当前配置作为备份。导出的文件名格式为 `cc-switch-export-{时间戳}.sql`。
|
||||
|
||||
## Codex OAuth 反向代理(Claude 供应商)
|
||||
|
||||
v3.13.0 起,CC Switch 新增了 **Codex OAuth 反向代理**路径,让你可以**用 ChatGPT 账号**在 Claude Code 中复用 Codex 服务。
|
||||
|
||||
> 💡 **位置提示**:这项功能作为一个**新的 Claude 供应商卡片类型**出现,而不是 Codex 侧的预设。添加后会和普通 API-Key 型供应商并列在 Claude 的供应商列表中。
|
||||
|
||||
### 前提条件
|
||||
|
||||
- 拥有可登录的 **ChatGPT 账号**
|
||||
- 能够访问 `auth.openai.com` 和 `chatgpt.com`
|
||||
- **在使用前请先阅读本节末尾的 [⚠️ 风险提示](#️-风险提示重要)**
|
||||
|
||||
### 两个入口
|
||||
|
||||
你可以从下面任意一个入口开始:
|
||||
|
||||
#### 入口 A:从添加供应商面板开始(推荐新用户)
|
||||
|
||||
1. 切换到 **Claude** 应用
|
||||
2. 点击右上角的 **+** 按钮打开添加供应商面板
|
||||
3. 在预设列表的第三方分类下选择 **Codex (ChatGPT Plus/Pro)** 预设(以 UI 中显示的名称为准)
|
||||
4. 如果尚未登录 ChatGPT 账号,面板会**自动引导**你进入登录流程(见下文"登录流程")
|
||||
5. 登录成功后,供应商表单会显示已登录的账号,点击「保存」完成添加
|
||||
|
||||
#### 入口 B:从 OAuth 认证中心开始(适合多账号管理)
|
||||
|
||||
1. 打开 **设置 → OAuth 认证中心**(标签页顶部带 **Beta** 标记)
|
||||
2. 在 **ChatGPT (Codex OAuth)** 区块点击 **使用 ChatGPT 登录** 按钮
|
||||
3. 完成登录流程(见下文)
|
||||
4. 登录完成后,回到 **Claude** 应用 → **添加供应商** → 选择同一个 Codex (ChatGPT Plus/Pro) 预设
|
||||
5. 在表单中的「选择账号」下拉框选择刚登录的账号,保存即可
|
||||
|
||||
### 登录流程(Device Code)
|
||||
|
||||
不管从哪个入口进入,登录流程都一致:
|
||||
|
||||
1. **获取验证码**:CC Switch 调用 OpenAI Device Code 流程,并在界面上显示:
|
||||
- 一个 **验证码**(约 8 位字符,例如 `ABCD-1234`)
|
||||
- 验证码右侧的 **复制** 按钮
|
||||
- 下方的授权链接 `https://auth.openai.com/codex/device`
|
||||
- "等待授权中..." 的动画提示
|
||||
2. **浏览器授权**:点击链接(或手动访问该 URL),在浏览器中:
|
||||
- 登录你的 ChatGPT 账号
|
||||
- 输入上一步复制的验证码
|
||||
- 确认授权
|
||||
3. **自动轮询完成**:CC Switch 会在后台持续轮询 OpenAI 服务器,检测到授权成功后自动关闭等待界面
|
||||
4. **显示已登录账号**:登录的 ChatGPT 账号会出现在 **OAuth 认证中心 → 已登录账号**列表中,显示登录邮箱
|
||||
|
||||
> ⏱️ **验证码有效期约 15 分钟**。如果超时,界面会显示"Device Code 已过期",点击「重试」即可重新获取验证码。
|
||||
|
||||
### 启用与使用
|
||||
|
||||
添加并保存 Codex OAuth 供应商后:
|
||||
|
||||
1. 在 Claude 供应商列表中找到它
|
||||
2. 点击卡片的 **启用** 按钮 — 和普通供应商完全一致
|
||||
3. Claude Code CLI 即可通过反向代理使用 ChatGPT 订阅
|
||||
4. 托盘菜单的 **Claude** 子菜单中也会出现这个供应商,支持快速切换
|
||||
|
||||
> 💡 **底层细节**:CC Switch 会将请求路由到 `https://chatgpt.com/backend-api/codex`,Base URL 被强制重写 — 你**无需**在表单中手动填写端点地址。API 格式固定为 `openai_responses`。
|
||||
|
||||
### 默认模型
|
||||
|
||||
Codex OAuth 预设的默认模型映射:
|
||||
|
||||
| 角色 | 默认模型 |
|
||||
| ------------- | -------------- |
|
||||
| 主模型 | `gpt-5.4` |
|
||||
| Sonnet 角色 | `gpt-5.4` |
|
||||
| Opus 角色 | `gpt-5.4` |
|
||||
| Haiku 角色 | `gpt-5.4-mini` |
|
||||
|
||||
你可以在供应商的 JSON 编辑器中覆盖 `ANTHROPIC_MODEL` 等环境变量来自定义。
|
||||
|
||||
### 多账号管理(OAuth 认证中心)
|
||||
|
||||
**OAuth 认证中心**支持同时管理多个 ChatGPT 账号:
|
||||
|
||||
| 操作 | 说明 |
|
||||
| ---------------- | ---------------------------------------------------- |
|
||||
| 添加其他账号 | 点击「添加其他账号」重复登录流程 |
|
||||
| 设为默认 | 在账号行点击「设为默认」—— 新建供应商默认使用该账号 |
|
||||
| 为供应商选账号 | 供应商表单中通过「选择账号」下拉框指定特定账号 |
|
||||
| 移除账号 | 点击账号右侧的红色 × 移除(Token 被清除) |
|
||||
| 注销所有账号 | 底部「注销所有账号」按钮一键清除 |
|
||||
|
||||
> 💡 **使用场景**:如果你和团队共享一台开发机,可以为每个成员的 ChatGPT 账号各建一个供应商,通过托盘菜单快速切换。
|
||||
|
||||
### Token 自动刷新
|
||||
|
||||
- Token 会在**过期前 60 秒**自动刷新,全程后台进行,无需手动干预
|
||||
- Refresh Token 存储在本地数据目录,不会上传到任何地方
|
||||
- **不支持**导出 Token(防止泄露)
|
||||
|
||||
### 配额展示
|
||||
|
||||
登录并启用供应商后,**供应商卡片底部**会自动显示账号配额:
|
||||
|
||||
| 显示元素 | 示例 | 颜色规则 |
|
||||
| ------------ | ------------------ | ------------------------------------------- |
|
||||
| 使用百分比 | `45%` | < 70% 绿色,70–89% 橙色,≥ 90% 红色 |
|
||||
| 重置倒计时 | `7d12h 后重置` | ChatGPT 账号的滑动窗口或每日限额 |
|
||||
| 刷新按钮 | 圆形箭头 | 手动重新查询配额 |
|
||||
|
||||
> ⚠️ **会话已过期**:如果 Token 完全失效(无法自动刷新),卡片底部会显示黄色警告框「会话已过期」。此时请到 **OAuth 认证中心**移除该账号并重新登录。
|
||||
|
||||
### 常见失败
|
||||
|
||||
| 场景 | 表现 | 解决方法 |
|
||||
| -------------------- | ------------------------------- | --------------------------------------- |
|
||||
| 验证码超时 | 显示"Device Code 已过期" | 点击「重试」重新获取验证码 |
|
||||
| 浏览器拒绝授权 | 显示"用户拒绝授权" | 重新登录,在浏览器中点击"授权" |
|
||||
| 网络错误 | 显示具体错误信息 | 检查网络连接,确认能访问 OpenAI 域名 |
|
||||
| 创建供应商前未登录 | "请先登录 ChatGPT 账号"提示 | 先到 OAuth 认证中心完成登录 |
|
||||
| Token 失效无法刷新 | 配额框显示"会话已过期" | 移除账号后重新登录 |
|
||||
| 配额查询失败 | 配额框显示"查询失败" | 点击「刷新」按钮重试 |
|
||||
|
||||
### ⚠️ 风险提示(重要)
|
||||
|
||||
Codex OAuth 反向代理通过**逆向工程的 OAuth 流程**访问 ChatGPT 账号的 Codex 服务。启用前请务必理解以下风险:
|
||||
|
||||
1. **违反服务条款**:可能违反 OpenAI 的服务条款,该条款禁止未经授权的自动化访问、服务复制和绕过既定访问路径
|
||||
2. **账号风险**:OpenAI 可能将异常使用模式标记为可疑自动化,对 ChatGPT 账号施加临时或永久限制
|
||||
3. **无法保证长期可用**:OpenAI 随时可能更新其认证和检测机制,当前可用的方式未来可能被封堵
|
||||
|
||||
**启用此功能即表示你自行承担所有风险**。CC Switch 不对因使用本功能产生的账号限制、警告或服务暂停承担责任。
|
||||
|
||||
> 📖 完整免责声明及更多背景参见 [v3.13.0 Release Notes](../../../release-notes/v3.13.0-zh.md#️-风险提示)。
|
||||
|
||||
## 高级选项
|
||||
|
||||
### API 格式(仅 Claude)
|
||||
|
||||
添加使用第三方 API 的 Claude 供应商时,可能需要在高级选项中选择正确的 **API 格式**:
|
||||
|
||||
| 格式 | 说明 | 适用场景 |
|
||||
|------|------|----------|
|
||||
| **Anthropic Messages** | 原生 Anthropic API 格式(默认) | 直接 Anthropic API 或兼容代理 |
|
||||
| **OpenAI Chat Completions** | OpenAI Chat API 格式,由代理自动转换 | 供应商仅支持 OpenAI Chat 格式 |
|
||||
| **OpenAI Responses API** | OpenAI Responses API 格式,由代理自动转换 | 供应商仅支持 OpenAI Responses 格式 |
|
||||
|
||||
> **注意**:API 格式转换由代理服务处理。使用非 Anthropic 格式时,需要开启代理并启用应用接管才能正确转换请求/响应。详见 [4.1 代理服务](../4-proxy/4.1-service.md)。
|
||||
|
||||
当配置了非默认 API 格式时,高级选项区域会自动展开。
|
||||
|
||||
### 完整 URL 端点模式
|
||||
|
||||
v3.13.0 起新增的高级选项。默认情况下,CC Switch 会把配置的 `base_url` 视作**前缀**,再在其后拼接 `/v1/chat/completions` 等固定路径。对于部分厂商(如需要非标准 URL 布局的第三方服务),这种拼接方式会导致请求失败。
|
||||
|
||||
**启用方式**:
|
||||
|
||||
1. 编辑供应商,展开「高级选项」
|
||||
2. 勾选 **完整 URL 模式** 复选框
|
||||
3. 将**完整的上游端点**(而非前缀)填入 `base_url`
|
||||
|
||||
**示例对比**:
|
||||
|
||||
| 模式 | `base_url` 填写 | 实际请求目标 |
|
||||
| ----------------------- | ------------------------------------------------ | ------------------------------------------------ |
|
||||
| 默认(前缀拼接) | `https://api.example.com` | `https://api.example.com/v1/chat/completions` |
|
||||
| **完整 URL 模式** | `https://api.example.com/custom/path/messages` | `https://api.example.com/custom/path/messages` |
|
||||
|
||||
**适用场景**:
|
||||
- 供应商要求使用非标准路径(不是 `/v1/chat/completions`)
|
||||
- 供应商有多层级路径结构
|
||||
- 厂商专属的 API 网关路径
|
||||
|
||||
> 💡 **提示**:代理转发和 Stream Check 都会遵循「完整 URL 模式」配置,因此启用后无需额外调整。如果关闭此选项,路径拼接恢复为默认行为。
|
||||
|
||||
### Claude 通用配置快捷开关
|
||||
|
||||
编辑 Claude 供应商时,JSON 编辑器上方提供一组 **快捷开关**:
|
||||
|
||||
| 开关 | 效果 | 配置变更 |
|
||||
|------|------|----------|
|
||||
| **隐藏署名** | 清除提交/PR 的署名元数据 | 设置 `attribution: {commit: "", pr: ""}` |
|
||||
| **启用 Teammates** | 启用 Agent 团队功能 | 设置 `env.CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS = "1"` |
|
||||
| **启用工具搜索** | 启用工具搜索功能 | 设置 `env.ENABLE_TOOL_SEARCH = "true"` |
|
||||
| **高效能模式** | 将 effort 级别设为 high | 设置 `effortLevel = "high"` |
|
||||
| **禁用自动更新** | 阻止 Claude Code 自动更新 | 设置 `env.DISABLE_AUTOUPDATER = "1"` |
|
||||
|
||||
取消勾选开关时,对应的配置项会被完全移除。更改会实时反映在 JSON 编辑器中。
|
||||
|
||||
此外,**写入通用配置** 复选框可将全局配置片段合并到供应商中。点击 **编辑通用配置** 可自定义共享的配置片段。
|
||||
|
||||
### Codex 1M 上下文窗口
|
||||
|
||||
添加 Codex 供应商时,提供 **启用 1M 上下文窗口** 开关:
|
||||
|
||||
- **启用时**:在 config.toml 中设置 `model_context_window = 1000000` 并自动填充 `model_auto_compact_token_limit = 900000`
|
||||
- **禁用时**:移除这两个字段
|
||||
|
||||
开关开启后显示的文本框可自定义自动压缩限制值。
|
||||
|
||||
### 自定义图标
|
||||
|
||||
点击名称左侧的图标区域,可以:
|
||||
|
||||
@@ -26,30 +26,12 @@
|
||||
### 操作步骤
|
||||
|
||||
1. 右键点击系统托盘的 CC Switch 图标
|
||||
2. 将鼠标悬停在对应应用的子菜单上(如 "Claude · 当前供应商")
|
||||
3. 点击要切换到的供应商名称
|
||||
2. 在菜单中找到对应应用(Claude/Codex/Gemini/OpenCode)
|
||||
3. 点击要切换的供应商名称
|
||||
4. 切换完成,托盘会短暂提示
|
||||
|
||||
### 托盘菜单结构
|
||||
|
||||
v3.13.0 起,托盘菜单从原来的扁平列表重构为**按应用分组的分级子菜单**,为每个应用独立建立子菜单:
|
||||
|
||||
| 子菜单 | 说明 |
|
||||
| ----------- | -------------------------------------------- |
|
||||
| Claude | Claude 所有供应商(含 Codex OAuth 反向代理) |
|
||||
| Codex | Codex 所有供应商 |
|
||||
| Gemini | Gemini 所有供应商 |
|
||||
| OpenCode | OpenCode 所有供应商 |
|
||||
| OpenClaw | OpenClaw 所有供应商 |
|
||||
|
||||
**重构带来的好处**:
|
||||
|
||||
- **防止菜单溢出**:有大量供应商时,扁平列表会超出屏幕高度;分级子菜单天然支持无限扩展
|
||||
- **子菜单标题显示当前激活供应商**:无需打开子菜单即可知道每个应用当前用的是哪个供应商
|
||||
- **按应用隔离操作**:切换 Claude 的供应商不会干扰到 Codex 的视图
|
||||
|
||||
> 💡 **提示**:后台常驻 + 轻量模式 + 分级子菜单的组合特别适合频繁切换多个应用的重度用户。参考 [1.5 个性化配置 → 轻量模式](../1-getting-started/1.5-settings.md)。
|
||||
|
||||

|
||||
|
||||
## 生效方式
|
||||
|
||||
@@ -52,20 +52,6 @@ JSON 格式的配置内容,包括:
|
||||
|
||||
这确保了 CC Switch 和 CLI 工具的配置始终同步。
|
||||
|
||||
## 自动获取模型
|
||||
|
||||
编辑供应商时,可以自动从供应商端点获取可用模型列表:
|
||||
|
||||
1. 确保已填写 API Key 和端点地址
|
||||
2. 点击模型输入框旁的 **获取模型** 按钮(下载图标)
|
||||
3. 从分组下拉菜单中选择模型
|
||||
|
||||
详细说明请参阅 [2.1 添加供应商 — 自动获取模型](./2.1-add.md#自动获取模型)。
|
||||
|
||||
## 通用配置快捷开关(Claude)
|
||||
|
||||
编辑 Claude 供应商时,JSON 编辑器上方提供常用设置的快捷开关,包括工具搜索、禁用自动更新、Teammates、高效能模式等。详见 [2.1 添加供应商 — Claude 通用配置快捷开关](./2.1-add.md#claude-通用配置快捷开关)。
|
||||
|
||||
## 修改 API Key
|
||||
|
||||
编辑供应商时,可以直接在 **API Key** 输入框中修改:
|
||||
|
||||
@@ -1,72 +1,8 @@
|
||||
# 2.5 用量查询
|
||||
|
||||
CC Switch 的配额/余额展示分为两大类:**自动查询**(官方订阅类,开箱即用)和**手动启用**(内置模板 + 自定义脚本,需要用户配置后再显示)。
|
||||
## 功能说明
|
||||
|
||||
| 类别 | 范围 | 是否需要用户启用 |
|
||||
| -------------------------- | --------------------------------------------------------------------- | ---------------- |
|
||||
| **自动查询** | Claude / Codex / Gemini 官方订阅、GitHub Copilot、Codex OAuth 反向代理 | 否(默认启用) |
|
||||
| **手动启用(内置模板)** | Token Plan、第三方余额查询 | 是(见下文) |
|
||||
| **手动启用(自定义脚本)** | 未被内置模板覆盖的中转服务、私有部署、特殊 API | 是(见下文) |
|
||||
|
||||
## 自动查询(官方订阅类)
|
||||
|
||||
v3.13.0 起,以下三类供应商在启用后会**自动**在卡片底部显示配额,用户无需任何额外配置:
|
||||
|
||||
| 类别 | 覆盖供应商 | 显示内容 |
|
||||
| --------------- | ----------------------------------------- | --------------------------- |
|
||||
| 官方订阅 | Claude / Codex / Gemini 官方登录 | 官方订阅配额 |
|
||||
| GitHub Copilot | Copilot 供应商卡片 | Premium interactions 剩余量 |
|
||||
| Codex OAuth | Codex OAuth 反向代理卡片(Claude 供应商) | ChatGPT 账号 Codex 配额 |
|
||||
|
||||
这三类的共同特点是**数据来源唯一且语义明确**(官方订阅的使用率),不存在歧义,因此 CC Switch 直接调用对应的官方或 OAuth 查询接口。
|
||||
|
||||
### 自动查询的交互
|
||||
|
||||
- **卡片底部显示**:使用百分比 + 重置倒计时,颜色随使用率变化(< 70% 绿 / 70–89% 橙 / ≥ 90% 红)
|
||||
- **手动刷新**:点击卡片上的刷新图标按钮重新查询
|
||||
- **卡片简化**:对这三类供应商,**健康检查**和**用量查询配置**按钮会被自动隐藏,避免干扰内置展示
|
||||
- **会话过期提示**:如果 Token 无法刷新,卡片会显示「会话已过期」警告(Copilot / Codex OAuth)
|
||||
|
||||
---
|
||||
|
||||
## 手动启用(内置模板 + 自定义脚本)
|
||||
|
||||
除了上述三类自动查询的供应商,**所有其他供应商**(包括 Token Plan、第三方余额查询、以及各类中转服务)都需要在供应商卡片上**手动打开「用量查询」开关**后才会显示配额。
|
||||
|
||||
### 为什么需要手动启用?
|
||||
|
||||
一个重要原因是:**同一个请求地址(同一家供应商)可能同时提供多种查询模式** —— 既可能有按套餐的配额查询,也可能有按账户余额的查询。CC Switch 无法自动推断你想查哪一种,所以这类供应商的内置查询**默认关闭**,由你选择合适的模板后启用。
|
||||
|
||||
### 覆盖的内置模板
|
||||
|
||||
v3.13.0 为以下类别提供了**开箱即用的内置模板**,启用后无需手写脚本:
|
||||
|
||||
| 类别 | 覆盖供应商 | 模板类型 |
|
||||
| ---------- | --------------------------------------------------------- | ----------------------- |
|
||||
| Token Plan | Kimi / Zhipu GLM / MiniMax | 套餐配额(带使用进度) |
|
||||
| 第三方余额 | DeepSeek / StepFun / SiliconFlow / OpenRouter / Novita AI | 官方余额查询 |
|
||||
|
||||
> 💡 除了以上内置模板外,对未被覆盖的供应商,你可以使用**自定义脚本**方式(见下文)编写自己的查询逻辑。
|
||||
|
||||
### 启用步骤
|
||||
|
||||
1. 鼠标悬停在供应商卡片上,显示操作按钮
|
||||
2. 点击 **用量查询** 按钮(📊 图标)
|
||||
3. 在配置面板顶部打开 **启用用量查询** 开关
|
||||
4. 选择合适的内置模板(例如 Token Plan、第三方余额)或选择「自定义」
|
||||
5. 按需填入 API Key / Base URL / Access Token 等参数(大多数情况可留空,使用供应商本身的凭据)
|
||||
6. 点击「测试脚本」确认能正常返回
|
||||
7. 保存配置 —— 下次激活该供应商时,配额将显示在卡片底部
|
||||
|
||||
> ⚠️ **注意**:启用后的自动刷新间隔通过「自动查询间隔」字段控制(设为 `0` 禁用自动刷新),仅当供应商处于「当前启用」状态时才会触发后台查询。
|
||||
|
||||
---
|
||||
|
||||
## 自定义脚本查询(高级)
|
||||
|
||||
### 功能说明
|
||||
|
||||
当供应商**不在内置模板覆盖范围**内时,你可以用 JavaScript 编写自定义查询脚本。适用于中转服务、私有部署、特殊格式 API 等。
|
||||
用量查询功能允许你配置自定义脚本,实时查询供应商的剩余额度、已用量等信息。
|
||||
|
||||
**使用场景**:
|
||||
- 查看 API 账户剩余余额
|
||||
@@ -219,24 +155,6 @@ CC Switch 提供三种预设模板:
|
||||
|
||||
### 故障排除
|
||||
|
||||
### 自动查询未显示配额(官方订阅类)
|
||||
|
||||
**检查**:
|
||||
1. 确认供应商是官方订阅类 —— Claude / Codex / Gemini 官方登录、GitHub Copilot、Codex OAuth 反向代理
|
||||
2. 供应商是否处于「当前启用」状态(非激活时不会触发查询)
|
||||
3. 对于 OAuth 类型(Copilot / Codex OAuth),检查 Token 是否仍在有效期内;如果卡片显示「会话已过期」,请到 **OAuth 认证中心**重新登录
|
||||
4. 网络是否可访问官方配额接口
|
||||
|
||||
### 手动启用后仍未显示配额
|
||||
|
||||
**检查**:
|
||||
1. 供应商卡片的「用量查询」面板顶部**启用用量查询**开关是否已打开
|
||||
2. 是否选择了合适的内置模板(Token Plan / 第三方余额 / 自定义)
|
||||
3. 点击「测试脚本」查看返回的具体错误信息
|
||||
4. API Key / Base URL 等必要字段是否填写正确
|
||||
5. 网络是否可访问供应商的配额端点
|
||||
6. 仅当供应商处于「当前启用」状态时,后台自动查询才会生效
|
||||
|
||||
### 查询失败
|
||||
|
||||
**检查**:
|
||||
|
||||
@@ -118,27 +118,8 @@ CC Switch 提供强大的搜索和过滤功能:
|
||||
|
||||
### 卸载效果
|
||||
|
||||
- **自动备份**:删除前,技能会被备份到 `~/.cc-switch/skill-backups/`
|
||||
- 从所有应用目录(Claude、Codex、Gemini、OpenCode)移除技能
|
||||
- 从 SSOT 目录(`~/.cc-switch/skills/`)移除技能
|
||||
- 从数据库删除技能记录
|
||||
|
||||
### 从备份恢复
|
||||
|
||||
如需恢复之前卸载的技能:
|
||||
|
||||
1. 打开 Skills 页面
|
||||
2. 点击 **从备份恢复** 按钮
|
||||
3. 从列表中选择要恢复的备份(显示技能名称和备份日期)
|
||||
4. 技能将被恢复并为当前应用启用
|
||||
|
||||
### 删除备份
|
||||
|
||||
如需删除旧的技能备份:
|
||||
|
||||
1. 在恢复对话框中,找到要删除的备份
|
||||
2. 点击备份条目旁的 **删除** 按钮
|
||||
3. 确认删除 — 此操作不可撤销
|
||||
- 删除本地技能文件夹
|
||||
- 更新安装状态
|
||||
|
||||
## 仓库管理
|
||||
|
||||
@@ -192,59 +173,11 @@ Subdirectory: skills
|
||||
|
||||
## 技能更新
|
||||
|
||||
v3.13.0 起,Skills 支持**自动更新检测**和**批量更新**,不再需要卸载后重新安装。
|
||||
目前不支持自动更新。如需更新技能:
|
||||
|
||||
### 更新检测原理
|
||||
|
||||
CC Switch 基于 **SHA-256 内容哈希**比较本地已安装的 skill 与远端仓库版本。只要远端有任何文件内容变化,本地对应的 skill 卡片会自动显示「有新版本」标识。
|
||||
|
||||
### 单项更新
|
||||
|
||||
对于有新版本的 skill:
|
||||
|
||||
1. 在 Skills 面板找到带更新标识的 skill 卡片
|
||||
2. 点击卡片上的 **更新** 按钮
|
||||
3. 等待下载完成,状态自动刷新
|
||||
|
||||
### 全部更新
|
||||
|
||||
当有多个 skill 需要更新时:
|
||||
|
||||
1. 点击 Skills 面板顶部的 **全部更新** 按钮(出现时带滑入动画)
|
||||
2. CC Switch 会批量下载所有需要更新的 skill
|
||||
3. 完成后面板自动刷新,更新标识消失
|
||||
|
||||
> 💡 **建议**:定期点击「刷新」按钮触发一次远端扫描,确保更新检测结果最新。
|
||||
|
||||
## 存储位置切换
|
||||
|
||||
v3.13.0 起,Skills 的**源存储位置**可以在两个位置之间切换:
|
||||
|
||||
| 位置 | 说明 |
|
||||
| ------------------------ | -------------------------------------------------------- |
|
||||
| **CC Switch 内置存储** | 默认位置 `~/.cc-switch/skills/`,由 CC Switch 统一管理 |
|
||||
| **`~/.agents/skills`** | 符合社区 agent 工具约定的共享目录,便于与其他工具协同 |
|
||||
|
||||
### 切换方式
|
||||
|
||||
在 Skills 面板的设置或管理菜单中选择目标存储位置。切换过程**不会丢失 skill 状态** —— CC Switch 会平滑迁移现有 skill 到新位置。
|
||||
|
||||
> ⚠️ **区别提示**:本节的「存储位置切换」管理的是 skill 的**源存储**。而 [1.5 个性化配置 → Skills 同步方式](../1-getting-started/1.5-settings.md) 管理的是 skill 如何**分发到各应用目录**(软链接 vs 复制),两者配合使用。
|
||||
|
||||
## 公共注册表搜索(skills.sh)
|
||||
|
||||
v3.13.0 集成了 **skills.sh** 公共注册表搜索,让你直接在 CC Switch 内发现社区 skill。
|
||||
|
||||
### 使用步骤
|
||||
|
||||
1. 点击「仓库管理」按钮打开对话框
|
||||
2. 在对话框内使用 **skills.sh 搜索** 输入框
|
||||
3. 输入关键词实时筛选结果
|
||||
4. 点击目标 skill 即可快速添加到你的仓库列表
|
||||
|
||||
v3.13.0 还修复了 skills.sh 链接失效和空描述的兼容处理,社区 skill 的元数据显示更稳定。
|
||||
|
||||
## 常见问题
|
||||
1. 卸载现有技能
|
||||
2. 刷新列表
|
||||
3. 重新安装
|
||||
|
||||
### 技能列表为空
|
||||
|
||||
@@ -272,15 +205,3 @@ v3.13.0 还修复了 skills.sh 链接失效和空描述的兼容处理,社区
|
||||
- 检查网络连接
|
||||
- 检查磁盘空间
|
||||
- 检查目录权限
|
||||
|
||||
### 更新按钮不出现
|
||||
|
||||
可能原因:
|
||||
|
||||
- 远端仓库没有新内容
|
||||
- CC Switch 尚未完成最新扫描
|
||||
|
||||
解决方法:
|
||||
|
||||
- 点击「刷新」重新扫描
|
||||
- 确认仓库配置指向正确的分支和路径
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
# 3.4 会话管理器
|
||||
|
||||
会话管理器可让你在一处浏览、搜索和管理所有支持的 CLI 工具的对话会话。
|
||||
|
||||
## 支持的应用
|
||||
|
||||
| 应用 | 会话存储位置 |
|
||||
|------|-------------|
|
||||
| Claude Code | `~/.cache/claude/projects/*.jsonl` |
|
||||
| Codex | Codex 配置会话目录 |
|
||||
| OpenCode | `~/.local/share/opencode/`(JSON 或 SQLite) |
|
||||
| OpenClaw | `~/.openclaw/agents/<agent>/sessions/*.jsonl` |
|
||||
| Gemini CLI | `~/.cache/gemini/tmp/<project_hash>/chats/` |
|
||||
|
||||
## 打开会话管理器
|
||||
|
||||
点击主导航栏中的 **会话** 按钮。
|
||||
|
||||
> **注意**:会话按钮在所有五种应用模式下均可见。
|
||||
|
||||
## 界面布局
|
||||
|
||||
会话管理器采用 **双栏布局**:
|
||||
|
||||
- **左侧面板**:会话列表,包含搜索和过滤工具栏
|
||||
- **右侧面板**:选中会话的详情和对话历史
|
||||
|
||||
### 会话列表(左侧面板)
|
||||
|
||||
每个会话条目显示:
|
||||
- 供应商图标
|
||||
- 会话标题
|
||||
- 最后活跃时间(相对格式,如"5 分钟前")
|
||||
|
||||
### 会话详情(右侧面板)
|
||||
|
||||
选中会话后,右侧面板显示:
|
||||
- **标题**:来自会话标题、项目目录名称或会话 ID
|
||||
- **最后活跃日期/时间**:完整时间戳
|
||||
- **项目目录**:可点击复制完整路径(显示目录名,完整路径以提示框显示)
|
||||
- **恢复命令**:以等宽字体显示(如可用)
|
||||
- **对话历史**:完整消息记录
|
||||
|
||||
## 搜索与过滤
|
||||
|
||||
### 全文搜索
|
||||
|
||||
使用左侧面板顶部的搜索框,可搜索以下内容:
|
||||
- 会话 ID
|
||||
- 标题
|
||||
- 摘要
|
||||
- 项目目录
|
||||
- 源文件路径
|
||||
|
||||
搜索支持前缀匹配,实时过滤结果。按 **Esc** 清除搜索。
|
||||
|
||||
### 供应商过滤
|
||||
|
||||
点击左侧面板右上角的供应商过滤下拉菜单,按应用过滤:
|
||||
- **全部** — 显示所有供应商的会话
|
||||
- **Claude Code**
|
||||
- **Codex**
|
||||
- **OpenCode**
|
||||
- **OpenClaw**
|
||||
- **Gemini CLI**
|
||||
|
||||
过滤可与搜索组合使用。
|
||||
|
||||
### 刷新
|
||||
|
||||
点击刷新按钮(圆形箭头图标),重新扫描所有供应商目录以发现新增或已删除的会话。
|
||||
|
||||
## 会话操作
|
||||
|
||||
### 恢复会话
|
||||
|
||||
点击选中会话上的 **恢复** 按钮(播放图标)继续对话。
|
||||
|
||||
**macOS 上**:
|
||||
- CC Switch 使用你偏好的终端启动恢复命令
|
||||
- 终端会在会话的项目目录中打开
|
||||
- 如果终端启动失败,命令会被复制到剪贴板
|
||||
|
||||
**支持的终端(macOS)**:Terminal.app、iTerm2、Ghostty、Kitty、WezTerm、Alacritty
|
||||
|
||||
**其他平台**:
|
||||
- 恢复命令会被复制到剪贴板
|
||||
- 在终端中粘贴即可恢复会话
|
||||
|
||||
> 如果会话没有可用的恢复命令,恢复按钮将被禁用。
|
||||
|
||||
#### 目录选择器(Claude 终端恢复)
|
||||
|
||||
v3.13.0 起,**Claude 会话**恢复前会弹出**目录选择器**,让你可以覆盖默认的项目目录。适用于下列场景:
|
||||
|
||||
- **项目已迁移**:原项目目录已被移动或重命名
|
||||
- **软链接断裂**:原始路径无法访问
|
||||
- **临时换目录**:想在不同的工作目录中继续对话
|
||||
|
||||
**使用方法**:
|
||||
|
||||
1. 点击 Claude 会话的 **恢复** 按钮
|
||||
2. 在弹出的目录选择器中,确认默认目录或选择新目录
|
||||
3. CC Switch 会在所选目录下启动 Claude 终端会话
|
||||
|
||||
> 💡 **提示**:Codex / Gemini / OpenCode / OpenClaw 会话的恢复流程暂不包含目录选择器,仍使用会话原始项目目录。
|
||||
|
||||
### 删除会话
|
||||
|
||||
点击 **删除** 按钮(垃圾桶图标)永久删除会话文件。删除前会显示确认对话框。
|
||||
|
||||
> 没有本地源路径的会话(如不可变会话)无法删除。
|
||||
|
||||
### 批量操作
|
||||
|
||||
批量管理多个会话:
|
||||
|
||||
1. 点击左侧面板工具栏中的 **批量模式** 按钮(复选框图标)
|
||||
2. 使用出现的复选框选择会话
|
||||
3. 使用 **全选** 选择所有过滤结果,或使用 **清除** 取消选择
|
||||
4. 点击 **批量删除**(红色垃圾桶图标)删除所有选中的会话
|
||||
|
||||
删除前会显示确认对话框并展示数量。结果会报告成功删除的数量和失败的数量。
|
||||
|
||||
## 对话历史
|
||||
|
||||
### 消息显示
|
||||
|
||||
消息按角色以颜色区分:
|
||||
- **用户** 消息:绿色,左对齐
|
||||
- **AI**(助手)消息:蓝色,右对齐
|
||||
- **系统** 消息:琥珀色
|
||||
- **工具** 消息:紫色
|
||||
|
||||
### 目录导航
|
||||
|
||||
对于较长的对话,提供目录导航功能:
|
||||
- **桌面端(XL+ 屏幕)**:右侧边栏显示用户消息预览
|
||||
- **较小屏幕**:右下角浮动按钮(列表图标),点击打开对话框
|
||||
|
||||
点击任意条目可滚动到对应消息,消息会短暂高亮显示。
|
||||
|
||||
## 提示
|
||||
|
||||
- 会话按最后活跃时间排序(最新在前)
|
||||
- 会话数量徽章会随搜索和过滤实时更新
|
||||
- OpenCode 会话可能来自 JSON 文件和 SQLite 数据库 — 重复项会自动去重
|
||||
@@ -1,85 +0,0 @@
|
||||
# 3.5 工作区文件与每日记忆
|
||||
|
||||
## 概述
|
||||
|
||||
工作区面板为 **OpenClaw** 提供文件管理和每日记忆功能。你可以编辑工作区配置文件并维护每日记忆日志。
|
||||
|
||||
> 此功能为 OpenClaw 专属。当 OpenClaw 为当前选中的应用时,导航栏中会显示工作区按钮。
|
||||
|
||||
## 工作区文件
|
||||
|
||||
### 文件位置
|
||||
|
||||
所有工作区文件存储在 `~/.openclaw/workspace/`。
|
||||
|
||||
点击面板顶部的目录路径可在文件管理器中打开。
|
||||
|
||||
### 可用文件
|
||||
|
||||
CC Switch 管理 9 个工作区文件,每个文件有特定用途:
|
||||
|
||||
| 文件 | 说明 |
|
||||
|------|------|
|
||||
| **AGENTS.md** | Agent 定义与配置 |
|
||||
| **SOUL.md** | 系统灵魂/性格设置 |
|
||||
| **USER.md** | 用户资料信息 |
|
||||
| **IDENTITY.md** | 身份与角色定义 |
|
||||
| **TOOLS.md** | 可用工具配置 |
|
||||
| **MEMORY.md** | 系统记忆 |
|
||||
| **HEARTBEAT.md** | 心跳配置 |
|
||||
| **BOOTSTRAP.md** | 引导序列 |
|
||||
| **BOOT.md** | 启动配置 |
|
||||
|
||||
### 文件状态
|
||||
|
||||
每个文件显示状态指示器:
|
||||
- **绿色对勾**:文件已存在
|
||||
- **空心圆圈**:文件尚未创建(首次保存时创建)
|
||||
|
||||
### 编辑文件
|
||||
|
||||
1. 点击任意文件卡片打开 Markdown 编辑器
|
||||
2. 编辑内容
|
||||
3. 点击 **保存** 将更改写入磁盘
|
||||
|
||||
如果文件尚不存在,将在首次保存时创建。
|
||||
|
||||
## 每日记忆
|
||||
|
||||
每日记忆功能提供按日期组织的日志系统,存储在 `~/.openclaw/workspace/memory/`。
|
||||
|
||||
### 访问每日记忆
|
||||
|
||||
点击工作区文件网格中的 **每日记忆** 卡片,打开记忆面板。
|
||||
|
||||
### 文件列表
|
||||
|
||||
面板显示所有每日记忆文件,按日期排序(最新在前)。每个条目显示:
|
||||
- **日期**(从文件名格式化,如 `2026-04-01.md`)
|
||||
- **文件大小**
|
||||
- **预览**(内容的前 2 行)
|
||||
|
||||
### 创建今日笔记
|
||||
|
||||
点击 **创建今日** 按钮:
|
||||
- 打开以今日日期命名的新笔记(`YYYY-MM-DD.md`)
|
||||
- 如果今日笔记已存在,则打开进行编辑
|
||||
- 文件仅在点击保存后才会持久化
|
||||
|
||||
### 搜索
|
||||
|
||||
搜索所有每日记忆文件:
|
||||
|
||||
1. 按 **Cmd/Ctrl+F** 或点击搜索图标
|
||||
2. 输入搜索词
|
||||
3. 结果显示匹配的文件,包含:
|
||||
- 每个文件的匹配数量
|
||||
- 匹配行的片段预览
|
||||
- 文件日期和大小
|
||||
|
||||
按 **Esc** 关闭搜索。
|
||||
|
||||
### 编辑与删除
|
||||
|
||||
- **编辑**:点击文件条目在 Markdown 编辑器中打开
|
||||
- **删除**:将鼠标悬停在文件条目上,点击删除图标。会显示确认对话框 — 删除操作不可撤销。
|
||||
@@ -150,20 +150,6 @@ base_url = "http://127.0.0.1:15721/v1"
|
||||
GOOGLE_GEMINI_BASE_URL=http://127.0.0.1:15721
|
||||
```
|
||||
|
||||
## API 格式转换
|
||||
|
||||
代理支持为配置了非 Anthropic 格式的供应商自动进行 API 格式转换。这使你可以将仅支持 OpenAI 兼容 API 的供应商用于 Claude Code。
|
||||
|
||||
| 供应商 API 格式 | 代理行为 |
|
||||
|-----------------|----------|
|
||||
| **Anthropic Messages** | 透传(不转换) |
|
||||
| **OpenAI Chat Completions** | 将 Anthropic 请求转换为 OpenAI Chat 格式,响应反向转换 |
|
||||
| **OpenAI Responses API** | 将 Anthropic 请求转换为 OpenAI Responses 格式,响应反向转换 |
|
||||
|
||||
API 格式在添加或编辑 Claude 供应商时于[高级选项](../2-providers/2.1-add.md#api-格式仅-claude)中按供应商配置。
|
||||
|
||||
> **注意**:格式转换需要代理运行并启用应用接管。转换同时支持流式和非流式请求。
|
||||
|
||||
## 停止代理
|
||||
|
||||
### 方式一:主界面开关
|
||||
|
||||
@@ -9,34 +9,14 @@
|
||||
- 分析使用模式
|
||||
- 排查问题
|
||||
|
||||
v3.13.0 起,用量数据有两个来源:
|
||||
|
||||
| 数据来源 | 覆盖范围 | 是否需要代理拦截 |
|
||||
| -------------------------- | -------------------------------- | ---------------- |
|
||||
| **代理请求日志** | 通过代理转发的所有请求 | 需要 |
|
||||
| **CLI 会话日志**(v3.13 新增) | Claude / Codex / Gemini 会话历史 | 不需要 |
|
||||
|
||||
- **Codex 会话**:改用 JSONL 会话日志**精确解析**,替代原先的估算,并对模型名称做归一化保证定价查询一致
|
||||
- **Gemini 会话**:通过 Gemini CLI 会话日志精确同步
|
||||
- **Claude 会话**:同样支持从会话日志直接导入用量
|
||||
- 用量面板支持**按应用筛选**(Claude / Codex / Gemini),数据互不干扰
|
||||
|
||||
## 前提条件
|
||||
|
||||
根据你使用的数据来源,前提条件不同:
|
||||
|
||||
**代理请求日志**(覆盖全部应用和所有代理请求):
|
||||
使用用量统计功能需要:
|
||||
|
||||
1. ✅ 启动代理服务
|
||||
2. ✅ 开启应用接管
|
||||
3. ✅ 开启日志记录
|
||||
|
||||
**CLI 会话日志**(v3.13 新增,无需代理):
|
||||
|
||||
1. ✅ 在 CC Switch 中启用对应应用(Claude / Codex / Gemini)
|
||||
2. ✅ 确保对应 CLI 有会话历史文件
|
||||
3. ✅ CC Switch 会定期扫描会话目录并导入用量
|
||||
|
||||
## 打开用量统计
|
||||
|
||||
设置 → 用量 Tab
|
||||
@@ -206,22 +186,6 @@ v3.13.0 起,用量数据有两个来源:
|
||||
| 缓存读取价格 | 每百万缓存命中 Token 的价格 |
|
||||
| 缓存创建价格 | 每百万缓存创建 Token 的价格 |
|
||||
|
||||
### 模型 ID 匹配规则
|
||||
|
||||
在匹配定价前,CC Switch 会先对请求中的模型 ID 做标准化处理:
|
||||
|
||||
- 去掉最后一个 `/` 之前的前缀
|
||||
- 去掉 `:` 之后的后缀
|
||||
- 将 `@` 替换为 `-`
|
||||
|
||||
因此,在定价配置中请填写清洗后的模型 ID,而不是请求里的完整原始模型名。
|
||||
|
||||
| 原始模型名 | 应填写的模型 ID | 说明 |
|
||||
|------|------|------|
|
||||
| `stepfun-ai/step-3.5-flash` | `step-3.5-flash` | 去掉供应商前缀 |
|
||||
| `moonshotai/kimi-k2-0905:exa` | `kimi-k2-0905` | 去掉前缀和 `:` 后缀 |
|
||||
| `gpt-5.2-codex@low` | `gpt-5.2-codex-low` | 将 `@` 替换为 `-` |
|
||||
|
||||
### 操作
|
||||
|
||||
- **添加**:点击「添加」按钮新增模型定价
|
||||
@@ -232,7 +196,7 @@ v3.13.0 起,用量数据有两个来源:
|
||||
|
||||
### 预设价格
|
||||
|
||||
CC Switch 预设了常用模型的官方价格(每百万 Token)。v3.13.0 修正了部分模型的 **CNY → USD 定价**并补齐了此前缺失的模型定义,同时修复了 **MiniMax 套餐配额数学**与 **0% → 100% 用量进度**,使费用估算和套餐进度展示更准确。
|
||||
CC Switch 预设了常用模型的官方价格(每百万 Token):
|
||||
|
||||
**Claude 系列(美元)**:
|
||||
|
||||
|
||||
@@ -2,15 +2,12 @@
|
||||
|
||||
## 功能说明
|
||||
|
||||
模型检查功能(也称为 **Stream Check**)用于验证供应商配置的模型是否可用,通过发送实际的 API 请求来测试:
|
||||
模型检查功能用于验证供应商配置的模型是否可用,通过发送实际的 API 请求来测试:
|
||||
|
||||
- 模型是否存在
|
||||
- API Key 是否有效
|
||||
- 端点是否正常响应
|
||||
- 响应延迟是否正常
|
||||
- 流式响应首字节时间(TTFB)
|
||||
|
||||
v3.13.0 起,Stream Check 覆盖范围扩展到**全部五个应用**(Claude / Codex / Gemini / OpenCode / OpenClaw),包括 OpenClaw 的全部协议变体(`openai-completions` 等)。OpenCode 通过 npm 包映射自动识别;OpenClaw 支持自定义 `auth-header` 检测,并处理了 Bedrock 错误消息、`baseURL` 回退等边界情况。
|
||||
|
||||
## 打开配置
|
||||
|
||||
@@ -20,13 +17,11 @@ v3.13.0 起,Stream Check 覆盖范围扩展到**全部五个应用**(Claude
|
||||
|
||||
为每个应用配置用于测试的模型:
|
||||
|
||||
| 应用 | 配置项 | 默认值 | 说明 |
|
||||
| -------- | ------------- | -------- | -------------------------------------------- |
|
||||
| Claude | Claude 模型 | 系统默认 | 建议使用 Haiku 系列(成本低、速度快) |
|
||||
| Codex | Codex 模型 | 系统默认 | 建议使用 mini 系列 |
|
||||
| Gemini | Gemini 模型 | 系统默认 | 建议使用 Flash 系列 |
|
||||
| OpenCode | OpenCode 模型 | 系统默认 | v3.13.0 新增,通过 npm 包映射自动检测 |
|
||||
| OpenClaw | OpenClaw 模型 | 系统默认 | v3.13.0 新增,覆盖全部协议变体及自定义 auth-header |
|
||||
| 应用 | 配置项 | 默认值 | 说明 |
|
||||
|------|--------|--------|------|
|
||||
| Claude | Claude 模型 | 系统默认 | 建议使用 Haiku 系列(成本低、速度快) |
|
||||
| Codex | Codex 模型 | 系统默认 | 建议使用 mini 系列 |
|
||||
| Gemini | Gemini 模型 | 系统默认 | 建议使用 Flash 系列 |
|
||||
|
||||
### 模型选择建议
|
||||
|
||||
|
||||
@@ -12,11 +12,12 @@
|
||||
|
||||
```
|
||||
~/.cc-switch/
|
||||
├── cc-switch.db # SQLite 数据库(SSOT)
|
||||
├── cc-switch.db # SQLite 数据库
|
||||
├── settings.json # 设备级设置
|
||||
├── skills/ # 技能 SSOT 目录
|
||||
├── skill-backups/ # 技能备份(卸载时创建)
|
||||
└── db_backup_*.db # 数据库备份
|
||||
└── backups/ # 自动备份
|
||||
├── backup-20251230-120000.json
|
||||
├── backup-20251229-180000.json
|
||||
└── ...
|
||||
```
|
||||
|
||||
### 数据库内容
|
||||
|
||||
@@ -2,9 +2,23 @@
|
||||
|
||||
## 安装问题
|
||||
|
||||
### macOS 安装
|
||||
### macOS 提示「未知开发者」
|
||||
|
||||
CC Switch macOS 版本已通过 Apple 代码签名和公证,可直接下载安装,无需额外操作。如遇问题,请尝试从 [Releases 页面](https://github.com/farion1231/cc-switch/releases) 下载最新版本。
|
||||
**问题**:首次打开时提示「无法打开,因为它来自身份不明的开发者」
|
||||
|
||||
**解决方法一**:通过系统设置
|
||||
1. 关闭警告弹窗
|
||||
2. 打开「系统设置」→「隐私与安全性」
|
||||
3. 找到 CC Switch 相关提示
|
||||
4. 点击「仍要打开」
|
||||
5. 再次打开应用
|
||||
|
||||
**解决方法二**:通过终端命令(推荐)
|
||||
```bash
|
||||
sudo xattr -dr com.apple.quarantine /Applications/CC\ Switch.app/
|
||||
```
|
||||
|
||||
执行后即可正常打开应用。
|
||||
|
||||
### Windows 安装后无法启动
|
||||
|
||||
@@ -156,51 +170,6 @@ chmod +x CC-Switch-*.AppImage
|
||||
- [ ] 日志记录是否开启
|
||||
- [ ] 是否有请求通过代理
|
||||
|
||||
## 配额与余额
|
||||
|
||||
### 为什么有的供应商自动显示配额,有的需要手动启用?
|
||||
|
||||
只有**官方订阅类**(Claude / Codex / Gemini 官方登录、GitHub Copilot、Codex OAuth 反向代理)会在启用供应商后自动显示配额。**其他所有供应商**(包括 Token Plan 和第三方余额查询)都需要手动到供应商卡片的「用量查询」面板中打开开关并选择内置模板,因为同一个请求地址可能同时有"套餐"和"余额"两种查询模式,需要你自行选择。详见 [2.5 用量查询 → 手动启用](../2-providers/2.5-usage-query.md#手动启用内置模板--自定义脚本)。
|
||||
|
||||
### 官方订阅供应商没有显示配额
|
||||
|
||||
**检查**:
|
||||
1. 确认供应商处于「当前启用」状态(非激活时不触发查询)
|
||||
2. 对于 Copilot / Codex OAuth,检查 OAuth Token 是否仍在有效期内;如果卡片显示「会话已过期」,请到 **OAuth 认证中心**重新登录
|
||||
3. 检查网络连通性
|
||||
4. 点击卡片上的刷新图标手动重新查询
|
||||
|
||||
### Token Plan 或第三方余额启用后仍不显示
|
||||
|
||||
**检查**:
|
||||
1. 确认在「用量查询」面板中已打开「启用用量查询」开关
|
||||
2. 已经选择了合适的内置模板并保存
|
||||
3. 点击「测试脚本」查看具体错误信息
|
||||
4. 供应商需要处于「当前启用」状态后台才会自动刷新
|
||||
|
||||
### Codex 用量和直连时对不上
|
||||
|
||||
v3.13.0 将 Codex 用量从估算切换为**基于 JSONL 会话日志的精确解析**,同时对模型名称做归一化以保证定价查询一致。新数据会与官方账单对齐;若仍看到旧的估算数据,可以删除历史条目或等待新会话数据覆盖。
|
||||
|
||||
## Codex OAuth 反向代理
|
||||
|
||||
### 启用 Codex OAuth 反向代理有什么风险?
|
||||
|
||||
Codex OAuth 反向代理通过**逆向工程的 OAuth 流程**访问 ChatGPT 账号的 Codex 服务,可能违反 OpenAI 的服务条款,存在账号被限制或暂停的风险,且长期可用性无法保证。**启用即表示自行承担所有风险**。
|
||||
|
||||
完整免责声明参见 [v3.13.0 Release Notes → 风险提示](../../../release-notes/v3.13.0-zh.md#️-风险提示) 和 [2.1 添加供应商 → Codex OAuth 反向代理](../2-providers/2.1-add.md)。
|
||||
|
||||
### 如何登录 Codex OAuth?
|
||||
|
||||
完整的 Device Code 登录流程(验证码 + 浏览器授权)、两个入口(添加供应商面板 / OAuth 认证中心)、多账号管理和常见失败场景,参见 [2.1 添加供应商 → Codex OAuth 反向代理(Claude 供应商)](../2-providers/2.1-add.md#codex-oauth-反向代理claude-供应商)。
|
||||
|
||||
### Codex OAuth 登录后配额没显示
|
||||
|
||||
**解决方法**:
|
||||
1. 确认在 **OAuth 认证中心**(设置 → OAuth 认证中心,带 Beta 标记)中已完成 OAuth 登录流程
|
||||
2. 检查 Token 是否仍在有效期内 — 卡片上如果显示"会话已过期"表示 Token 无法刷新
|
||||
3. 如果过期,在 OAuth 认证中心移除该账号后重新登录
|
||||
|
||||
## 其他问题
|
||||
|
||||
### 托盘图标不显示
|
||||
@@ -228,20 +197,6 @@ Codex OAuth 反向代理通过**逆向工程的 OAuth 流程**访问 ChatGPT 账
|
||||
2. 手动下载最新版本安装
|
||||
3. 如使用 Homebrew:`brew upgrade --cask cc-switch`
|
||||
|
||||
## 轻量模式
|
||||
|
||||
### 如何进入轻量模式?
|
||||
|
||||
从系统托盘菜单切换"轻量模式"。主窗口关闭,CC Switch 仅作为托盘应用运行。再次切换或点击"打开主界面"即可退出。
|
||||
|
||||
### 轻量模式下应用占用更少内存?
|
||||
|
||||
是的。轻量模式会销毁主窗口及其 Web 视图,显著减少内存占用,同时保留托盘菜单功能。
|
||||
|
||||
### 轻量模式下深链接还能唤起主界面吗?
|
||||
|
||||
可以。CC Switch v3.13.0 起会覆盖所有窗口重新显示路径(正常启动、深链接、单例激活、托盘 `show_main` 以及轻量模式返程),点击 `ccswitch://` 链接会**按需重建**主窗口并显示导入确认对话框。第一次打开会比普通状态略慢(需要重建窗口),但后续切换恢复正常速度。
|
||||
|
||||
## 获取帮助
|
||||
|
||||
### 提交 Issue
|
||||
|
||||
@@ -24,9 +24,7 @@
|
||||
├── 3. 扩展功能
|
||||
│ ├── 3.1 MCP 服务器管理
|
||||
│ ├── 3.2 Prompts 提示词管理
|
||||
│ ├── 3.3 Skills 技能管理
|
||||
│ ├── 3.4 会话管理器
|
||||
│ └── 3.5 工作区文件与每日记忆
|
||||
│ └── 3.3 Skills 技能管理
|
||||
│
|
||||
├── 4. 代理与高可用
|
||||
│ ├── 4.1 代理服务
|
||||
@@ -71,8 +69,6 @@
|
||||
| [3.1-mcp.md](./3-extensions/3.1-mcp.md) | MCP 协议、添加服务器、应用绑定 |
|
||||
| [3.2-prompts.md](./3-extensions/3.2-prompts.md) | 创建预设、激活切换、智能回填 |
|
||||
| [3.3-skills.md](./3-extensions/3.3-skills.md) | 发现技能、安装卸载、仓库管理 |
|
||||
| [3.4-sessions.md](./3-extensions/3.4-sessions.md) | 会话浏览、搜索过滤、恢复与删除 |
|
||||
| [3.5-workspace.md](./3-extensions/3.5-workspace.md) | OpenClaw 工作区文件、每日记忆 |
|
||||
|
||||
### 4. 代理与高可用
|
||||
|
||||
@@ -103,19 +99,9 @@
|
||||
|
||||
## 版本信息
|
||||
|
||||
- 文档版本:v3.13.0
|
||||
- 最后更新:2026-04-08
|
||||
- 适用于 CC Switch v3.13.0+
|
||||
|
||||
### v3.13.0 亮点
|
||||
|
||||
- **轻量模式**:退出到托盘时销毁主窗口,空闲占用接近零 — 详见 [1.5 个性化配置](./1-getting-started/1.5-settings.md)
|
||||
- **配额与余额展示**:官方订阅类(Claude/Codex/Gemini/Copilot/Codex OAuth)自动展示剩余额度;Token Plan 和第三方余额通过内置模板一键启用 — 详见 [2.5 用量查询](./2-providers/2.5-usage-query.md)
|
||||
- **Codex OAuth 反向代理**:用 ChatGPT 账号在 Claude Code 中复用 Codex 服务 — 详见 [2.1 添加供应商](./2-providers/2.1-add.md)
|
||||
- **托盘按应用分级菜单**:五应用独立子菜单,防止菜单溢出 — 详见 [2.2 切换供应商](./2-providers/2.2-switch.md)
|
||||
- **Skills 发现与批量更新**:SHA-256 更新检测、批量更新、skills.sh 公共注册表搜索 — 详见 [3.3 Skills 技能管理](./3-extensions/3.3-skills.md)
|
||||
- **完整 URL 端点模式**:高级选项支持将 base_url 视作完整上游端点 — 详见 [2.1 添加供应商](./2-providers/2.1-add.md)
|
||||
- **OpenCode / OpenClaw 流式检测全覆盖**:Stream Check 面板扩展到全部五个应用 — 详见 [4.5 模型检查](./4-proxy/4.5-model-test.md)
|
||||
- 文档版本:v3.12.0
|
||||
- 最后更新:2026-03-09
|
||||
- 适用于 CC Switch v3.12.0+
|
||||
|
||||
## 贡献
|
||||
|
||||
|
||||
@@ -1,597 +0,0 @@
|
||||
# CC-Switch "工作目录" 功能 — 实施方案
|
||||
|
||||
## Context
|
||||
|
||||
CC-Switch 管理 5 个 CLI 工具(Claude Code / Codex / Gemini CLI / OpenCode / OpenClaw)的供应商、MCP 服务器、Skills、提示词配置。当前所有启用状态是全局的——用户在不同项目间切换时需要手动 toggle。
|
||||
|
||||
本功能允许用户注册多个工作目录(项目文件夹),切换目录时自动保存/恢复各实体的启用状态。**不做数据隔离**——所有实体共享全局池,仅 "谁是激活的" 按目录区分。
|
||||
|
||||
---
|
||||
|
||||
## 一、需要按目录区分的实体(完整清单)
|
||||
|
||||
| 实体 | 当前状态字段 | 存储方式 | 需要区分? | 理由 |
|
||||
|------|-------------|---------|-----------|------|
|
||||
| **Provider** | `is_current` | per `(id, app_type)` | **YES** | 不同项目用不同供应商 |
|
||||
| **Provider (Failover)** | `in_failover_queue` | per `(id, app_type)` | **YES** | 备用供应商队列跟随主供应商配置 |
|
||||
| **MCP Server** | `enabled_claude/codex/gemini/opencode` | per `id`, 4列 | **YES** | 不同项目需要不同 MCP 工具 |
|
||||
| **Skill** | `enabled_claude/codex/gemini/opencode` | per `id`, 4列 | **YES** | 不同项目需要不同 Skills |
|
||||
| **Prompt** | `enabled` | per `(id, app_type)`, 单选 | **YES** | 不同项目用不同系统提示词 |
|
||||
| Proxy Config | `enabled`, thresholds | per `app_type` | NO | 基础设施级别,非项目相关 |
|
||||
| Settings | key-value | flat table | NO | 全局用户偏好 |
|
||||
| Provider Health | failures, errors | runtime | **CLEAR** | 切换时清除,重新计算 |
|
||||
| Common Config | `common_config_{app}` | settings table | NO | 全局模板,非项目相关 |
|
||||
| Usage/Logs | historical | various tables | NO | 历史数据,不应分区 |
|
||||
|
||||
> 原计划遗漏了 **Failover Queue** 和 **Provider Health 清除**。
|
||||
|
||||
---
|
||||
|
||||
## 二、数据库变更(Schema v8 → v9)
|
||||
|
||||
### 新增 5 张表
|
||||
|
||||
```sql
|
||||
-- 1. 工作目录注册表
|
||||
CREATE TABLE IF NOT EXISTS working_directories (
|
||||
id TEXT PRIMARY KEY,
|
||||
path TEXT NOT NULL UNIQUE,
|
||||
name TEXT,
|
||||
is_current BOOLEAN NOT NULL DEFAULT 0,
|
||||
created_at INTEGER NOT NULL DEFAULT 0
|
||||
);
|
||||
|
||||
-- 2. Provider 状态快照 (is_current + in_failover_queue)
|
||||
-- 每个目录保存所有 provider 的两个状态标志
|
||||
CREATE TABLE IF NOT EXISTS dir_provider_state (
|
||||
dir_id TEXT NOT NULL,
|
||||
app_type TEXT NOT NULL,
|
||||
provider_id TEXT NOT NULL,
|
||||
is_current BOOLEAN NOT NULL DEFAULT 0,
|
||||
in_failover_queue BOOLEAN NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (dir_id, app_type, provider_id)
|
||||
);
|
||||
|
||||
-- 3. MCP 启用状态快照 (直接镜像 4 列,不做行展开)
|
||||
CREATE TABLE IF NOT EXISTS dir_mcp_state (
|
||||
dir_id TEXT NOT NULL,
|
||||
mcp_id TEXT NOT NULL,
|
||||
enabled_claude BOOLEAN NOT NULL DEFAULT 0,
|
||||
enabled_codex BOOLEAN NOT NULL DEFAULT 0,
|
||||
enabled_gemini BOOLEAN NOT NULL DEFAULT 0,
|
||||
enabled_opencode BOOLEAN NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (dir_id, mcp_id)
|
||||
);
|
||||
|
||||
-- 4. Skill 启用状态快照 (直接镜像 4 列)
|
||||
CREATE TABLE IF NOT EXISTS dir_skill_state (
|
||||
dir_id TEXT NOT NULL,
|
||||
skill_id TEXT NOT NULL,
|
||||
enabled_claude BOOLEAN NOT NULL DEFAULT 0,
|
||||
enabled_codex BOOLEAN NOT NULL DEFAULT 0,
|
||||
enabled_gemini BOOLEAN NOT NULL DEFAULT 0,
|
||||
enabled_opencode BOOLEAN NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (dir_id, skill_id)
|
||||
);
|
||||
|
||||
-- 5. Prompt 启用状态快照 (每个 app_type 只存激活的 prompt_id)
|
||||
CREATE TABLE IF NOT EXISTS dir_prompt_state (
|
||||
dir_id TEXT NOT NULL,
|
||||
app_type TEXT NOT NULL,
|
||||
prompt_id TEXT NOT NULL,
|
||||
PRIMARY KEY (dir_id, app_type)
|
||||
);
|
||||
```
|
||||
|
||||
### 设计决策说明
|
||||
|
||||
**MCP/Skill 用 4 列镜像而非 `(entity_id, app_type, enabled)` 行展开**:
|
||||
- 与主表 `mcp_servers` / `skills` 结构一致,snapshot/apply 代码直接 copy 4 列
|
||||
- 避免 4 倍行膨胀(每个 MCP 服务器 1 行 vs 4 行)
|
||||
- 未来增加新 app 时,两边同步加列即可
|
||||
|
||||
**Prompt 只存 `(dir_id, app_type, prompt_id)`**:
|
||||
- 每个 app_type 最多一个 enabled prompt,不需要存 boolean
|
||||
- 无记录 = 该 app 无激活 prompt
|
||||
|
||||
**Provider 合并 `is_current` + `in_failover_queue`**:
|
||||
- 两个标志都是 per `(app_type, provider_id)` 的状态
|
||||
- 存在同一表中避免多表 JOIN
|
||||
|
||||
### 迁移脚本
|
||||
|
||||
在 `schema.rs` 中:
|
||||
- `create_tables_on_conn()` 添加 5 个 CREATE TABLE
|
||||
- 新增 `migrate_v8_to_v9(conn)`: 创建 5 张表 + 插入 `__default__` 行
|
||||
- `SCHEMA_VERSION` 升至 9
|
||||
- 迁移循环添加 `7 => ...` 后加 `8 => { Self::migrate_v8_to_v9(conn)?; Self::set_user_version(conn, 9)?; }`
|
||||
|
||||
```rust
|
||||
fn migrate_v8_to_v9(conn: &Connection) -> Result<(), AppError> {
|
||||
// 创建 5 张表(使用 IF NOT EXISTS,幂等)
|
||||
// ...
|
||||
// 插入 __default__ 虚拟目录,代表"全局默认"状态
|
||||
conn.execute(
|
||||
"INSERT OR IGNORE INTO working_directories (id, path, name, is_current, created_at) \
|
||||
VALUES ('__default__', '__default__', NULL, 0, ?1)",
|
||||
[crate::database::get_unix_timestamp()?],
|
||||
)?;
|
||||
Ok(())
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 三、后端实现
|
||||
|
||||
### 3.1 DAO 层 — `src-tauri/src/database/dao/working_dir.rs`
|
||||
|
||||
所有方法都是 `impl Database` 块,遵循现有 DAO 模式。
|
||||
|
||||
**关键方法签名**(需要 `_on_conn` 变体支持事务):
|
||||
|
||||
```rust
|
||||
// ═══ 工作目录 CRUD ═══
|
||||
pub fn list_working_directories(&self) -> Result<Vec<WorkingDirectory>, AppError>
|
||||
pub fn add_working_directory(&self, id: &str, path: &str, name: Option<&str>) -> Result<(), AppError>
|
||||
pub fn delete_working_directory(&self, id: &str) -> Result<(), AppError>
|
||||
pub fn rename_working_directory(&self, id: &str, name: &str) -> Result<(), AppError>
|
||||
pub fn get_current_working_directory(&self) -> Result<Option<WorkingDirectory>, AppError>
|
||||
|
||||
// 使用 _on_conn 变体,在 Service 层的事务中调用
|
||||
fn set_current_working_directory_on_conn(conn: &Connection, id: &str) -> Result<(), AppError>
|
||||
|
||||
// ═══ 快照写入 ═══ (都有 _on_conn 变体)
|
||||
fn snapshot_providers_on_conn(conn: &Connection, dir_id: &str) -> Result<(), AppError>
|
||||
fn snapshot_mcp_on_conn(conn: &Connection, dir_id: &str) -> Result<(), AppError>
|
||||
fn snapshot_skills_on_conn(conn: &Connection, dir_id: &str) -> Result<(), AppError>
|
||||
fn snapshot_prompts_on_conn(conn: &Connection, dir_id: &str) -> Result<(), AppError>
|
||||
|
||||
// ═══ 快照恢复 ═══ (都有 _on_conn 变体, 返回 bool = 是否有快照)
|
||||
fn apply_provider_snapshot_on_conn(conn: &Connection, dir_id: &str) -> Result<bool, AppError>
|
||||
fn apply_mcp_snapshot_on_conn(conn: &Connection, dir_id: &str) -> Result<bool, AppError>
|
||||
fn apply_skill_snapshot_on_conn(conn: &Connection, dir_id: &str) -> Result<bool, AppError>
|
||||
fn apply_prompt_snapshot_on_conn(conn: &Connection, dir_id: &str) -> Result<bool, AppError>
|
||||
```
|
||||
|
||||
**snapshot_providers 实现思路**:
|
||||
```sql
|
||||
-- 先清除旧快照
|
||||
DELETE FROM dir_provider_state WHERE dir_id = ?1;
|
||||
-- 从主表复制当前状态
|
||||
INSERT INTO dir_provider_state (dir_id, app_type, provider_id, is_current, in_failover_queue)
|
||||
SELECT ?1, app_type, id, is_current, in_failover_queue
|
||||
FROM providers
|
||||
WHERE is_current = 1 OR in_failover_queue = 1;
|
||||
```
|
||||
|
||||
**apply_provider_snapshot 实现思路**:
|
||||
```sql
|
||||
-- 检查是否有快照
|
||||
SELECT COUNT(*) FROM dir_provider_state WHERE dir_id = ?1; -- 如果 0,返回 false
|
||||
|
||||
-- 在事务中:先清除主表所有 is_current 和 in_failover_queue
|
||||
UPDATE providers SET is_current = 0;
|
||||
UPDATE providers SET in_failover_queue = 0;
|
||||
|
||||
-- 从快照恢复
|
||||
UPDATE providers SET is_current = 1
|
||||
WHERE (id, app_type) IN (SELECT provider_id, app_type FROM dir_provider_state WHERE dir_id = ?1 AND is_current = 1);
|
||||
|
||||
UPDATE providers SET in_failover_queue = 1
|
||||
WHERE (id, app_type) IN (SELECT provider_id, app_type FROM dir_provider_state WHERE dir_id = ?1 AND in_failover_queue = 1);
|
||||
```
|
||||
|
||||
**snapshot_mcp / snapshot_skills 实现思路**(直接镜像 4 列):
|
||||
```sql
|
||||
DELETE FROM dir_mcp_state WHERE dir_id = ?1;
|
||||
INSERT INTO dir_mcp_state (dir_id, mcp_id, enabled_claude, enabled_codex, enabled_gemini, enabled_opencode)
|
||||
SELECT ?1, id, enabled_claude, enabled_codex, enabled_gemini, enabled_opencode
|
||||
FROM mcp_servers;
|
||||
```
|
||||
|
||||
**apply_mcp_snapshot 实现思路**:
|
||||
```sql
|
||||
-- 先全部禁用
|
||||
UPDATE mcp_servers SET enabled_claude = 0, enabled_codex = 0, enabled_gemini = 0, enabled_opencode = 0;
|
||||
|
||||
-- 从快照恢复
|
||||
UPDATE mcp_servers SET
|
||||
enabled_claude = (SELECT enabled_claude FROM dir_mcp_state WHERE dir_id = ?1 AND mcp_id = mcp_servers.id),
|
||||
enabled_codex = (SELECT enabled_codex FROM dir_mcp_state WHERE dir_id = ?1 AND mcp_id = mcp_servers.id),
|
||||
enabled_gemini = (SELECT enabled_gemini FROM dir_mcp_state WHERE dir_id = ?1 AND mcp_id = mcp_servers.id),
|
||||
enabled_opencode = (SELECT enabled_opencode FROM dir_mcp_state WHERE dir_id = ?1 AND mcp_id = mcp_servers.id)
|
||||
WHERE id IN (SELECT mcp_id FROM dir_mcp_state WHERE dir_id = ?1);
|
||||
```
|
||||
|
||||
### 3.2 Service 层 — `src-tauri/src/services/working_dir.rs`
|
||||
|
||||
```rust
|
||||
use crate::store::AppState;
|
||||
use crate::error::AppError;
|
||||
use crate::database::lock_conn;
|
||||
use crate::app_config::AppType;
|
||||
use crate::services::{McpService, ProviderService, SkillService};
|
||||
use crate::config::write_text_file;
|
||||
use crate::prompt_files::prompt_file_path;
|
||||
|
||||
pub struct WorkingDirService;
|
||||
|
||||
impl WorkingDirService {
|
||||
/// 核心切换逻辑
|
||||
pub fn switch(state: &AppState, target_dir_id: &str) -> Result<(), AppError> {
|
||||
// ═══ 前置检查 ═══
|
||||
// 1. 检查代理接管状态,若活跃则拒绝切换
|
||||
// 使用 db.is_live_takeover_active() 或同步检查 proxy_config.live_takeover_active
|
||||
// (因为 ProxyService::is_running() 是 async,而此函数是 sync)
|
||||
Self::check_proxy_not_active(state)?;
|
||||
|
||||
// ═══ Phase 1: 回填 Prompt ═══
|
||||
// 在 snapshot 之前,将 live 文件内容回填到当前 enabled prompt
|
||||
// 这样即使用户手动编辑了 live 文件,内容也不会丢失
|
||||
Self::backfill_prompt_content(state)?;
|
||||
|
||||
// ═══ Phase 2: 数据库操作(事务) ═══
|
||||
{
|
||||
let conn = lock_conn!(state.db.conn);
|
||||
conn.execute("BEGIN IMMEDIATE", [])?;
|
||||
|
||||
let result = (|| -> Result<(), AppError> {
|
||||
// 获取当前工作目录
|
||||
let current = Self::get_current_dir_id_on_conn(&conn)?;
|
||||
|
||||
// 保存当前状态到旧目录
|
||||
if let Some(old_id) = ¤t {
|
||||
Database::snapshot_providers_on_conn(&conn, old_id)?;
|
||||
Database::snapshot_mcp_on_conn(&conn, old_id)?;
|
||||
Database::snapshot_skills_on_conn(&conn, old_id)?;
|
||||
Database::snapshot_prompts_on_conn(&conn, old_id)?;
|
||||
} else {
|
||||
// 无当前目录 = 全局模式,保存到 __default__
|
||||
Database::snapshot_providers_on_conn(&conn, "__default__")?;
|
||||
Database::snapshot_mcp_on_conn(&conn, "__default__")?;
|
||||
Database::snapshot_skills_on_conn(&conn, "__default__")?;
|
||||
Database::snapshot_prompts_on_conn(&conn, "__default__")?;
|
||||
}
|
||||
|
||||
// 加载目标目录快照(如果有的话)
|
||||
// 如果无快照(首次进入),保持主表不变
|
||||
Database::apply_provider_snapshot_on_conn(&conn, target_dir_id)?;
|
||||
Database::apply_mcp_snapshot_on_conn(&conn, target_dir_id)?;
|
||||
Database::apply_skill_snapshot_on_conn(&conn, target_dir_id)?;
|
||||
Database::apply_prompt_snapshot_on_conn(&conn, target_dir_id)?;
|
||||
|
||||
// 更新 is_current 标记
|
||||
Database::set_current_working_directory_on_conn(&conn, target_dir_id)?;
|
||||
|
||||
Ok(())
|
||||
})();
|
||||
|
||||
match result {
|
||||
Ok(()) => conn.execute("COMMIT", [])?,
|
||||
Err(e) => {
|
||||
let _ = conn.execute("ROLLBACK", []);
|
||||
return Err(e);
|
||||
}
|
||||
};
|
||||
}
|
||||
// conn 锁在此处释放
|
||||
|
||||
// ═══ Phase 3: 同步 live 配置文件 ═══
|
||||
Self::sync_all_live(state)?;
|
||||
|
||||
// ═══ Phase 4: 清除 Provider Health ═══
|
||||
state.db.clear_all_provider_health()?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// 回填 live prompt 文件内容到 DB(切换前调用)
|
||||
fn backfill_prompt_content(state: &AppState) -> Result<(), AppError> {
|
||||
for app in AppType::all() {
|
||||
let path = prompt_file_path(&app)?;
|
||||
if !path.exists() { continue; }
|
||||
let live_content = std::fs::read_to_string(&path).unwrap_or_default();
|
||||
if live_content.trim().is_empty() { continue; }
|
||||
|
||||
let mut prompts = state.db.get_prompts(app.as_str())?;
|
||||
if let Some((_, prompt)) = prompts.iter_mut().find(|(_, p)| p.enabled) {
|
||||
prompt.content = live_content;
|
||||
prompt.updated_at = Some(get_unix_timestamp()?);
|
||||
state.db.save_prompt(app.as_str(), prompt)?;
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// 将 DB 中的 enabled prompt 内容写入 live 文件(切换后调用)
|
||||
/// 注意:不做回填!只写入。区别于 PromptService::enable_prompt()
|
||||
fn write_prompts_to_live(state: &AppState) -> Result<(), AppError> {
|
||||
for app in AppType::all() {
|
||||
let path = prompt_file_path(&app)?;
|
||||
let prompts = state.db.get_prompts(app.as_str())?;
|
||||
if let Some(prompt) = prompts.values().find(|p| p.enabled) {
|
||||
write_text_file(&path, &prompt.content)?;
|
||||
}
|
||||
// 无 enabled prompt 时不清空文件(保留现状)
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// 同步所有 live 配置(Provider + MCP + Skill + Prompt)
|
||||
fn sync_all_live(state: &AppState) -> Result<(), AppError> {
|
||||
// 1. Provider → live files
|
||||
ProviderService::sync_current_to_live(state)?;
|
||||
// sync_current_to_live 内部已调用 McpService::sync_all_enabled()
|
||||
|
||||
// 2. Skills → app dirs (循环每个 app)
|
||||
for app in AppType::all() {
|
||||
let _ = SkillService::sync_to_app(&state.db, &app);
|
||||
}
|
||||
|
||||
// 3. Prompts → live files
|
||||
Self::write_prompts_to_live(state)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// 检查代理是否活跃(同步检查数据库标志)
|
||||
fn check_proxy_not_active(state: &AppState) -> Result<(), AppError> {
|
||||
// 检查 proxy_config 表中 live_takeover_active 列
|
||||
// 如果有任何 app 的 live_takeover_active = 1,拒绝切换
|
||||
let conn = lock_conn!(state.db.conn);
|
||||
let active: bool = conn.query_row(
|
||||
"SELECT EXISTS(SELECT 1 FROM proxy_config WHERE live_takeover_active = 1)",
|
||||
[], |r| r.get(0)
|
||||
).unwrap_or(false);
|
||||
|
||||
if active {
|
||||
return Err(AppError::Message(
|
||||
"代理接管模式运行中,请先停止代理再切换工作目录".into()
|
||||
));
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 3.3 Command 层 — `src-tauri/src/commands/working_dir.rs`
|
||||
|
||||
遵循现有模式:`State<'_, AppState>` + `Result<T, String>` + `.map_err(|e| e.to_string())`。
|
||||
|
||||
```rust
|
||||
#[tauri::command]
|
||||
pub fn list_working_directories(state: State<'_, AppState>) -> Result<Vec<WorkingDirectory>, String>
|
||||
|
||||
#[tauri::command]
|
||||
pub fn add_working_directory(state: State<'_, AppState>, path: String, name: Option<String>) -> Result<WorkingDirectory, String>
|
||||
|
||||
#[tauri::command]
|
||||
pub fn delete_working_directory(state: State<'_, AppState>, id: String) -> Result<(), String>
|
||||
|
||||
#[tauri::command]
|
||||
pub fn rename_working_directory(state: State<'_, AppState>, id: String, name: String) -> Result<(), String>
|
||||
|
||||
#[tauri::command]
|
||||
pub fn switch_working_directory(state: State<'_, AppState>, id: String) -> Result<(), String>
|
||||
// 调用 WorkingDirService::switch()
|
||||
|
||||
#[tauri::command]
|
||||
pub fn get_current_working_directory(state: State<'_, AppState>) -> Result<Option<WorkingDirectory>, String>
|
||||
```
|
||||
|
||||
### 3.4 需修改的现有文件
|
||||
|
||||
| 文件 | 修改内容 |
|
||||
|------|---------|
|
||||
| `src-tauri/src/database/schema.rs` | 添加 5 个 CREATE TABLE + `migrate_v8_to_v9()` |
|
||||
| `src-tauri/src/database/mod.rs` | `SCHEMA_VERSION = 9` + 迁移循环加 `8 => ...` + `pub mod working_dir` in dao |
|
||||
| `src-tauri/src/database/dao/mod.rs` | 添加 `pub mod working_dir;` |
|
||||
| `src-tauri/src/services/mod.rs` | 添加 `pub mod working_dir;` + `pub use working_dir::WorkingDirService;` |
|
||||
| `src-tauri/src/commands/mod.rs` | 添加 `mod working_dir;` + `pub use working_dir::*;` |
|
||||
| `src-tauri/src/lib.rs` | invoke_handler 注册 6 个新命令 |
|
||||
|
||||
### 3.5 可能需要新增的 DAO 辅助方法
|
||||
|
||||
`src-tauri/src/database/dao/failover.rs`:
|
||||
```rust
|
||||
/// 清除所有 provider_health 记录(切换目录时调用)
|
||||
pub fn clear_all_provider_health(&self) -> Result<(), AppError>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 四、前端实现
|
||||
|
||||
### 4.1 API — `src/lib/api/workingDir.ts`
|
||||
|
||||
```typescript
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
|
||||
export interface WorkingDirectory {
|
||||
id: string;
|
||||
path: string;
|
||||
name?: string;
|
||||
isCurrent: boolean;
|
||||
createdAt: number;
|
||||
}
|
||||
|
||||
export const workingDirApi = {
|
||||
list: () => invoke<WorkingDirectory[]>("list_working_directories"),
|
||||
add: (path: string, name?: string) =>
|
||||
invoke<WorkingDirectory>("add_working_directory", { path, name }),
|
||||
delete: (id: string) => invoke<void>("delete_working_directory", { id }),
|
||||
rename: (id: string, name: string) =>
|
||||
invoke<void>("rename_working_directory", { id, name }),
|
||||
switch: (id: string) => invoke<void>("switch_working_directory", { id }),
|
||||
getCurrent: () =>
|
||||
invoke<WorkingDirectory | null>("get_current_working_directory"),
|
||||
};
|
||||
```
|
||||
|
||||
### 4.2 组件 — `src/components/WorkingDirSwitcher.tsx`
|
||||
|
||||
**位置**:Header toolbar,靠近 AppSwitcher。
|
||||
|
||||
**功能**:
|
||||
- 下拉菜单显示已注册目录列表
|
||||
- 当前目录高亮
|
||||
- "浏览…" 按钮调用 Tauri 文件夹选择对话框
|
||||
- 右键菜单:重命名、删除
|
||||
- "__default__(全局)" 选项恢复到全局状态
|
||||
- 切换后 invalidate 所有相关 React Query
|
||||
|
||||
**切换后的 Query Invalidation**:
|
||||
```typescript
|
||||
// 需要验证实际的 queryKey 名称
|
||||
queryClient.invalidateQueries({ queryKey: ["providers"] });
|
||||
queryClient.invalidateQueries({ queryKey: ["mcp-servers"] });
|
||||
queryClient.invalidateQueries({ queryKey: ["installed-skills"] });
|
||||
queryClient.invalidateQueries({ queryKey: ["prompts"] });
|
||||
queryClient.invalidateQueries({ queryKey: ["workingDirectories"] });
|
||||
```
|
||||
|
||||
### 4.3 i18n
|
||||
|
||||
三个文件都需更新:
|
||||
- `src/i18n/locales/zh.json`
|
||||
- `src/i18n/locales/en.json`
|
||||
- `src/i18n/locales/ja.json`
|
||||
|
||||
---
|
||||
|
||||
## 五、切换流程时序
|
||||
|
||||
```
|
||||
用户选择目录 B
|
||||
│
|
||||
├── 1. check_proxy_not_active()
|
||||
│ → 如果代理接管中,返回错误,终止
|
||||
│
|
||||
├── 2. backfill_prompt_content()
|
||||
│ → 读 live prompt 文件 → 更新 DB 中已启用 prompt 的 content
|
||||
│ → 保护用户手动编辑的 prompt 不丢失
|
||||
│
|
||||
├── 3. BEGIN TRANSACTION
|
||||
│ ├── snapshot(old_dir / __default__)
|
||||
│ │ ├── providers → dir_provider_state (is_current + in_failover_queue)
|
||||
│ │ ├── mcp_servers → dir_mcp_state (4 列直接复制)
|
||||
│ │ ├── skills → dir_skill_state (4 列直接复制)
|
||||
│ │ └── prompts → dir_prompt_state (enabled prompt_id)
|
||||
│ │
|
||||
│ ├── apply(target_dir)
|
||||
│ │ ├── dir_provider_state → providers
|
||||
│ │ ├── dir_mcp_state → mcp_servers
|
||||
│ │ ├── dir_skill_state → skills
|
||||
│ │ └── dir_prompt_state → prompts
|
||||
│ │
|
||||
│ └── set_current_working_directory(target_dir)
|
||||
│
|
||||
├── COMMIT
|
||||
│
|
||||
├── 4. sync_all_live()
|
||||
│ ├── ProviderService::sync_current_to_live(state)
|
||||
│ │ └── 内部已调用 McpService::sync_all_enabled()
|
||||
│ ├── for app in AppType::all() { SkillService::sync_to_app(&db, &app) }
|
||||
│ └── write_prompts_to_live() ← 无回填,直接写
|
||||
│
|
||||
└── 5. clear_all_provider_health()
|
||||
→ 清除运行时熔断器状态
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 六、边界情况处理
|
||||
|
||||
| 场景 | 处理方式 |
|
||||
|------|---------|
|
||||
| **首次进入目录(无快照)** | `apply_*_snapshot()` 返回 false,主表保持不变。用户调整后,下次切走时自动保存。 |
|
||||
| **全局模式 → 目录** | 自动将当前状态 snapshot 到 `__default__` 虚拟目录。`__default__` 在 v9 迁移中预创建。 |
|
||||
| **目录 → 全局模式** | 用户选择 `__default__`,恢复全局状态。 |
|
||||
| **新增 MCP/Skill/Provider** | 新实体在 dir_*_state 中无记录。apply 时只更新有记录的实体,新增的保持 DB 默认值。 |
|
||||
| **删除 MCP/Skill/Provider** | dir_*_state 中对应记录在 apply 时找不到主表行,UPDATE 影响 0 行,静默跳过。 |
|
||||
| **删除工作目录** | 级联删除 dir_*_state 中所有 `dir_id` 匹配的行。若为当前目录,回退到 `__default__`。 |
|
||||
| **代理接管中切换** | `check_proxy_not_active()` 检测到 `live_takeover_active = 1`,拒绝切换并提示用户先停止代理。 |
|
||||
| **切换中途崩溃** | 事务保护 DB 操作的原子性。最坏情况:DB 已更新但 live 文件未同步。下次启动可添加恢复检查(Phase 2 优化)。 |
|
||||
| **用户手动编辑了 prompt 文件** | `backfill_prompt_content()` 在切换前读取 live 文件回填到 DB,保护手动修改。 |
|
||||
|
||||
---
|
||||
|
||||
## 七、实施顺序
|
||||
|
||||
### Phase 1: 数据库
|
||||
1. `database/schema.rs` — 5 个 CREATE TABLE + `migrate_v8_to_v9()`
|
||||
2. `database/mod.rs` — `SCHEMA_VERSION = 9` + 迁移分支
|
||||
3. `database/dao/working_dir.rs` — 全部 DAO 方法(`_on_conn` 变体)
|
||||
4. `database/dao/failover.rs` — 新增 `clear_all_provider_health()`
|
||||
5. `database/dao/mod.rs` — 注册模块
|
||||
|
||||
### Phase 2: 服务 + 命令
|
||||
6. `services/working_dir.rs` — `WorkingDirService::switch()` 等
|
||||
7. `commands/working_dir.rs` — 6 个 Tauri 命令
|
||||
8. `services/mod.rs` — 注册模块
|
||||
9. `commands/mod.rs` — 注册模块
|
||||
10. `lib.rs` — invoke_handler 注册
|
||||
|
||||
### Phase 3: 前端
|
||||
11. `src/lib/api/workingDir.ts` — API 封装
|
||||
12. `src/types.ts` — WorkingDirectory 类型
|
||||
13. `src/components/WorkingDirSwitcher.tsx` — UI 组件
|
||||
14. `src/App.tsx` — 集成到 header toolbar
|
||||
15. `src/i18n/locales/{zh,en,ja}.json` — 国际化
|
||||
|
||||
### Phase 4: 优化(可选)
|
||||
16. 启动恢复检查(DB 状态 vs live 文件一致性)
|
||||
17. 托盘菜单显示当前工作目录
|
||||
|
||||
---
|
||||
|
||||
## 八、关键文件索引
|
||||
|
||||
### 新增文件(5 个)
|
||||
- `src-tauri/src/database/dao/working_dir.rs`
|
||||
- `src-tauri/src/services/working_dir.rs`
|
||||
- `src-tauri/src/commands/working_dir.rs`
|
||||
- `src/lib/api/workingDir.ts`
|
||||
- `src/components/WorkingDirSwitcher.tsx`
|
||||
|
||||
### 必须修改的文件(7 个)
|
||||
- `src-tauri/src/database/schema.rs` — CREATE TABLE + 迁移
|
||||
- `src-tauri/src/database/mod.rs` — 版本号 + 迁移循环
|
||||
- `src-tauri/src/database/dao/mod.rs` — 模块注册
|
||||
- `src-tauri/src/database/dao/failover.rs` — clear_all_provider_health
|
||||
- `src-tauri/src/services/mod.rs` — 模块注册
|
||||
- `src-tauri/src/commands/mod.rs` — 模块注册
|
||||
- `src-tauri/src/lib.rs` — invoke_handler
|
||||
|
||||
### 必须修改的前端文件(4 个)
|
||||
- `src/App.tsx` — 集成 WorkingDirSwitcher
|
||||
- `src/types.ts` — WorkingDirectory 接口
|
||||
- `src/i18n/locales/zh.json` — 中文
|
||||
- `src/i18n/locales/en.json` — 英文
|
||||
- `src/i18n/locales/ja.json` — 日文
|
||||
|
||||
### 参考文件(理解现有模式)
|
||||
- `src-tauri/src/services/mcp.rs` — `sync_all_enabled()` (line 165)
|
||||
- `src-tauri/src/services/skill.rs` — `sync_to_app()` (line 1707)
|
||||
- `src-tauri/src/services/provider/mod.rs` — `sync_current_to_live()` (line 1552)
|
||||
- `src-tauri/src/services/prompt.rs` — `enable_prompt()` (line 73) — 理解回填逻辑
|
||||
- `src-tauri/src/prompt_files.rs` — prompt 文件路径
|
||||
- `src-tauri/src/config.rs` — `write_text_file()` (line 176)
|
||||
|
||||
---
|
||||
|
||||
## 九、验证计划
|
||||
|
||||
### 后端验证
|
||||
1. `cargo test` — DAO 层单元测试(使用 `Database::memory()`)
|
||||
- 快照/恢复往返一致性
|
||||
- 新增/删除实体后的 apply 行为
|
||||
- `__default__` 全局状态保护
|
||||
- 事务回滚测试
|
||||
2. 手动测试 — 启动应用,创建两个目录,切换并验证 live 文件变化
|
||||
|
||||
### 前端验证
|
||||
1. `pnpm typecheck` — TypeScript 类型检查
|
||||
2. `pnpm lint` — ESLint 检查
|
||||
3. 手动 UI 测试 — 工作目录切换器交互、query invalidation 后数据刷新
|
||||