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

aicccnf

v1.0.0

Published

一键配置 Claude Code 的 AICC 连接信息,支持 Windows、Mac 和 Linux

Readme

AICC 配置工具

一键配置 Claude Code 的 AICC 连接信息,支持 Windows、Mac 和 Linux。

功能特性

  • 🚀 交互式配置界面,简单易用
  • 📝 自动创建 .claude/settings.json 配置文件
  • 🔧 自动配置系统环境变量
    • Windows: 自动设置用户环境变量
    • Mac: 自动写入 ~/.zshrc
    • Linux: 自动写入 ~/.bashrc
  • ✅ 跨平台支持,兼容 Node.js 14+

快速开始

通过 npx 使用(推荐)

无需安装,直接运行:

npx aicccnf

本地测试

在开发阶段,你可以在本地测试这个 CLI 工具:

# 1. 进入项目目录
cd my-cli-tool

# 2. 安装依赖
npm install

# 3. 全局链接(将 my-cli 链接到全局)
npm link

# 4. 现在可以在任何地方使用
my-cli

使用说明

运行工具后,按照提示操作:

  1. 输入 Base URL: 输入你的 AICC API 地址(如:https://api.example.com
  2. 输入 Auth Token: 输入你的 API Key(输入时会隐藏为 *****
  3. 确认配置: 检查信息是否正确
  4. 自动配置: 工具会自动完成以下操作:
    • 创建 ~/.claude/settings.json 配置文件
    • 设置系统环境变量

Windows 平台

配置完成后:

  • 环境变量已永久设置到用户环境变量
  • 重启命令行窗口即可生效
  • 重启 Claude Code 使配置生效

验证环境变量:

# 重新打开命令行窗口后运行
echo %ANTHROPIC_BASE_URL%
echo %ANTHROPIC_AUTH_TOKEN%

Mac 平台

配置完成后:

  • 环境变量已添加到 ~/.zshrc
  • 运行 source ~/.zshrc 使环境变量立即生效
  • 或者重启终端
  • 重启 Claude Code 使配置生效

验证环境变量:

# 使环境变量生效
source ~/.zshrc

# 验证
echo $ANTHROPIC_BASE_URL
echo $ANTHROPIC_AUTH_TOKEN

Linux 平台

配置完成后:

  • 环境变量已添加到 ~/.bashrc
  • 运行 source ~/.bashrc 使环境变量立即生效
  • 或者重启终端
  • 重启 Claude Code 使配置生效

验证环境变量:

# 使环境变量生效
source ~/.bashrc

# 验证
echo $ANTHROPIC_BASE_URL
echo $ANTHROPIC_AUTH_TOKEN

系统要求

  • Node.js: >= 14.0.0
  • 操作系统: Windows / macOS / Linux
  • 权限:
    • Windows: 普通用户权限即可
    • Mac/Linux: 可能需要写入 ~/.zshrc~/.bashrc 的权限

发布到 npm

如果你想发布自己的版本:

1. 注册 npm 账号

访问 https://www.npmjs.com/ 注册账号

2. 登录 npm

npm login

3. 修改包名

修改 package.json 中的 name 字段为你的包名:

{
  "name": "your-package-name"
}

4. 发布

npm publish

5. 更新版本

# 更新补丁版本(1.0.0 -> 1.0.1)
npm version patch

# 更新次要版本(1.0.0 -> 1.1.0)
npm version minor

# 更新主要版本(1.0.0 -> 2.0.0)
npm version major

# 发布新版本
npm publish

技术细节

项目结构

my-cli-tool/
├── index.js          # 主程序入口
├── package.json      # 项目配置
└── README.md         # 说明文档

依赖包

配置文件格式

生成的 ~/.claude/settings.json 格式:

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.example.com",
    "ANTHROPIC_AUTH_TOKEN": "your-api-key"
  }
}

环境变量

工具会设置以下环境变量:

  • ANTHROPIC_BASE_URL: API 基础地址
  • ANTHROPIC_AUTH_TOKEN: API 认证令牌

常见问题

1. 环境变量未生效

Windows:

  • 必须重启命令行窗口(关闭后重新打开)
  • 或者注销并重新登录 Windows

Mac/Linux:

  • 运行 source ~/.zshrcsource ~/.bashrc
  • 或者重启终端

2. npm link 权限错误

Windows:

  • 以管理员身份运行命令行

Mac/Linux:

sudo npm link

3. 找不到配置文件

配置文件位置:

  • Windows: C:\Users\你的用户名\.claude\settings.json
  • Mac/Linux: ~/.claude/settings.json

可以手动检查文件是否存在。

4. Node.js 版本过低

确保 Node.js 版本 >= 14.0.0:

node --version

如果版本过低,请从 https://nodejs.org/ 下载最新版本。

故障排除

如果自动配置失败,可以手动配置:

手动创建配置文件

  1. 创建目录(如果不存在):

    # Windows
    mkdir %USERPROFILE%\.claude
    
    # Mac/Linux
    mkdir -p ~/.claude
  2. 创建 settings.json 文件:

    {
      "env": {
        "ANTHROPIC_BASE_URL": "你的URL",
        "ANTHROPIC_AUTH_TOKEN": "你的Token"
      }
    }

手动设置环境变量

Windows:

  1. 右键"此电脑" → "属性"
  2. 点击"高级系统设置"
  3. 点击"环境变量"
  4. 在"用户变量"中点击"新建"
  5. 添加:
    • 变量名: ANTHROPIC_BASE_URL,值: 你的URL
    • 变量名: ANTHROPIC_AUTH_TOKEN,值: 你的Token

Mac (zsh):

echo 'export ANTHROPIC_BASE_URL="你的URL"' >> ~/.zshrc
echo 'export ANTHROPIC_AUTH_TOKEN="你的Token"' >> ~/.zshrc
source ~/.zshrc

Linux (bash):

echo 'export ANTHROPIC_BASE_URL="你的URL"' >> ~/.bashrc
echo 'export ANTHROPIC_AUTH_TOKEN="你的Token"' >> ~/.bashrc
source ~/.bashrc

许可证

MIT