npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

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

About

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

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

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

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

Open Software & Tools

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

© 2025 – Pkg Stats / Ryan Hefner

@moguw/cc-cli

v3.0.2

Published

Claude Code配置管理CLI工具

Readme

CC CLI - Claude Code 配置管理工具

Language: 中文 | English

NPM版本 下载量 License

一键管理 Claude Code、Codex、Gemini CLI 配置的命令行工具。支持多站点、多 Token/API Key 管理,智能配置合并,WebDAV 云端备份,无需手动修改配置文件。

📑 目录

✨ 核心功能

🎯 三端统一管理

  • 📡 Claude Code API - 完整的 Claude Code 配置管理
    • 多站点、多 Token 切换
    • 智能配置合并
    • YOLO 模式支持
  • 💻 Codex API - Claude Code Codex 配置管理
    • 多服务提供商支持
    • Model Providers 管理
    • 官方 OAuth 认证切换
    • YOLO 模式开关
  • 🌟 Gemini CLI - Google Gemini 配置管理
    • 多 API Key 管理
    • 自定义 Base URL
    • Model 选择

🚀 强大功能

  • 🔄 一键切换 - 快速切换不同的 API 站点和 Token/API Key
  • 📋 配置管理 - 查看、添加、编辑、删除配置,完整的 CRUD 操作
  • 🔗 智能合并 - 自动与目标 CLI 配置文件深度合并,保留原有设置
  • ⚙️ 完整支持 - 支持所有官方配置项,无缝集成
  • 🚀 YOLO 模式 - 最宽松配置模式(approval_policy=never, sandbox_mode=danger-full-access
  • 🔔 智能通知 - 响应完成、工具批准等事件自动推送系统通知
  • ☁️ WebDAV 备份 - 配置文件云端备份与恢复(坚果云、标准 WebDAV 服务)
    • 📁 CC-CLI 配置:~/.cc-cli/api_configs.json
    • 📁 Claude Code 配置:settings.jsonCLAUDE.mdagents/commands/skills/
    • 📁 Codex 配置:config.tomlauth.jsonAGENTS.md
    • 📁 Gemini 配置:.envsettings.json

📦 安装使用

# 全局安装
npm install -g @moguw/cc-cli

🚀 使用方法

启动主菜单

# 启动交互式主菜单
cc-cli

主菜单提供以下功能模块:

  • 📡 Claude Code API - Claude Code 配置管理
  • 💻 Codex API - Codex 配置管理
  • 🌟 Gemini API - Gemini CLI 配置管理
  • 🔄 Backup - WebDAV 备份与恢复
  • 📊 Status - 查看当前配置状态
  • Help - 帮助文档

Claude Code API 管理

# 通过主菜单访问(推荐)
cc-cli  # 选择 "📡 Claude Code API"

# 或使用快捷命令
cc-cli api       # Claude 配置管理
cc-cli apiuse    # 快速切换配置

功能包括:

  • 🔄 切换配置 - 选择不同站点和 Token
  • 📋 查看配置 - 列出所有配置
  • ➕ 添加配置 - 添加新的 API 配置
  • 📝 编辑配置 - 编辑配置文件
  • 🗑️ 删除配置 - 删除站点或 Token
  • 🚀 YOLO 模式 - 开启/关闭最宽松模式

Codex API 管理

# 通过主菜单访问
cc-cli  # 选择 "💻 Codex API"

功能包括:

  • 🔄 切换配置 - 选择 Codex 服务提供商
  • 📋 查看配置 - 列出所有 Codex 配置
  • ➕ 添加配置 - 添加新的 Codex 配置
  • 📝 编辑配置 - 编辑 config.toml 和 auth.json
  • 🗑️ 删除配置 - 删除 Codex 配置
  • 🔐 官方认证 - 切换到 OAuth 认证
  • 🚀 YOLO 模式 - 开启/关闭最宽松模式

Gemini CLI 管理

# 通过主菜单访问
cc-cli  # 选择 "🌟 Gemini API"

功能包括:

  • 🔄 切换配置 - 选择 Gemini 站点和 API Key
  • 📋 查看配置 - 列出所有 Gemini 配置
  • ➕ 添加配置 - 添加新的 Gemini 配置
  • 📝 编辑配置 - 编辑 .env 和 settings.json
  • 🗑️ 删除配置 - 删除 Gemini 配置

其他命令

# 查看当前配置状态
cc-cli status

# 查看帮助信息
cc-cli --help

📋 配置文件说明

配置文件位置

  • CC-CLI 主配置~/.cc-cli/api_configs.json~/.claude/api_configs.json(兼容旧版)
  • Claude Code 配置~/.claude/settings.json
  • Codex 配置~/.codex/config.toml~/.codex/auth.json
  • Gemini 配置~/.gemini/.env~/.gemini/settings.json

智能配置合并机制

工具采用深度合并策略,自动将你选择的 API 配置与现有的 CLI 设置合并:

  1. 保留原有配置 - 所有非 API 相关的配置项保持不变
  2. 更新 API 设置 - 仅更新 API 端点、认证信息等
  3. 多 Token/Key 支持 - 自动处理单个或多个 Token/API Key
  4. 格式规范化 - 自动清理冗余配置,迁移老格式

api_configs.json 配置格式

{
  "sites": {
    "示例站点": {
      "url": "https://api.example.com",
      "description": "支持 Claude Code、Codex 和 Gemini",

      // Claude Code API 配置
      "claude": {
        "env": {
          "ANTHROPIC_BASE_URL": "https://api.example.com",
          "ANTHROPIC_AUTH_TOKEN": {
            "主力Token": "sk-ant-xxxxxxxxxxxxxx",
            "备用Token": "sk-ant-yyyyyyyyyyyyyy"
          }
        }
      },

      // Codex API 配置
      "codex": {
        "OPENAI_API_KEY": {
          "主要Key": "sk-xxxxxxxxxxxxxx",
          "测试Key": "sk-yyyyyyyyyyyyyy"
        },
        "model": "gpt-5",
        "model_reasoning_effort": "high",
        "model_providers": {
          "custom_provider": {
            "name": "custom_provider",
            "base_url": "https://api.example.com/v1"
          }
        }
      },

      // Gemini CLI 配置
      "gemini": {
        "GOOGLE_GEMINI_BASE_URL": "https://jp.duckcoding.com",
        "GEMINI_API_KEY": {
          "Key1": "AIzaSyxxxxxxxxxxxxxx",
          "Key2": "AIzaSyyyyyyyyyyyyyyyyy"
        },
        "GEMINI_MODEL": "gemini-2.5-pro"
      }
    }
  },

  // 当前使用的配置(自动管理,无需手动编辑)
  "currentConfig": {
    "site": "示例站点",
    "token": "sk-ant-xxxxxxxxxxxxxx",
    "tokenName": "主力Token",
    "updatedAt": "2025-01-01T00:00:00.000Z"
  },
  "currentCodexConfig": {
    "site": "示例站点",
    "key": "sk-xxxxxxxxxxxxxx",
    "keyName": "主要Key",
    "updatedAt": "2025-01-01T00:00:00.000Z"
  },
  "currentGeminiConfig": {
    "siteName": "示例站点",
    "model": "gemini-2.5-pro",
    "apiKey": "AIzaSyxxxxxxxxxxxxxx",
    "apiKeyName": "Key1",
    "baseUrl": "https://jp.duckcoding.com",
    "updatedAt": "2025-01-01T00:00:00.000Z"
  }
}

Token/API Key 格式支持

所有 API 配置都支持两种 Token/Key 格式:

对象格式(推荐,支持多个):

"ANTHROPIC_AUTH_TOKEN": {
  "Token1": "sk-ant-xxxxxxxxxxxxxx",
  "Token2": "sk-ant-yyyyyyyyyyyyyy"
}

字符串格式(单个,自动命名为"默认Token"):

"ANTHROPIC_AUTH_TOKEN": "sk-ant-xxxxxxxxxxxxxx"

⭐ Star History

Star History Chart