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 🙏

© 2026 – Pkg Stats / Ryan Hefner

ai-config-manager

v1.0.3

Published

AI Configuration Manager - A CLI tool to manage AI configurations

Readme

ACM (AI Configuration Manager)

类似 nvm、nrm 的 AI API 配置切换工具,让您轻松管理和切换多个 Claude API 配置。

特性

  • 🚀 一键切换多个 AI API 配置
  • 📝 简单的命令行界面
  • 🔧 支持添加、删除、列表和当前配置管理
  • 💾 自动配置文件管理
  • 🔄 环境变量自动设置
  • 🌍 多语言支持 (中文/English)
  • 🎯 自动语言检测

Claude 中转推荐

快速开始

安装方式

方式1: NPM 全局安装 (推荐)

npm install -g ai-config-manager

方式2: 手动安装

维护可能不及时

git clone <repository-url>
cd ai-config-manager
./install.sh

基本用法

# 查看所有可用配置
acm list 
或 acm ls

# 切换到指定配置
acm use Alias
eg.
acm use openai

# 添加新配置
acm add [Alias] [key] [api url] [type]
type: 
key = ANTHROPIC_AUTH_TOKEN
token = ANTHROPIC_BASE_URL
eg.
acm add Claudecode sk-xxx https://api.claudecode.com key

# 删除配置
acm remove Claudecode

# 查看当前配置
acm current

# 切换语言
acm lang en
切换界面语言或显示当前语言。
- 无参数:显示当前语言
- `zh`:切换到中文
- `en`:切换到英文

# 查看帮助
acm help

配置文件

配置文件位于 ~/.claude_config

环境变量

ACM 会自动设置以下环境变量:

  • ANTHROPIC_AUTH_TOKEN: API 认证令牌
  • ANTHROPIC_BASE_URL: API 基础 URL

多语言支持

ACM 支持中文和英文界面,具有以下特性:

  1. 自动检测:根据系统环境变量自动选择语言
  2. 手动切换:使用 acm lang <zh|en> 命令切换
  3. 持久化:语言设置保存在 ~/.acm_lang 文件
  4. 实时生效:切换后立即生效,无需重启

语言切换示例

# 查看当前语言
acm lang

# 切换到英文
acm lang en

# 切换到中文  
acm lang zh

卸载

NPM 安装的版本

npm uninstall -g ai-config-manager

手动安装的版本

./uninstall.sh

工作原理

  1. 配置存储: 所有配置存储在 ~/.claude_config 文件中
  2. 当前配置跟踪: 当前使用的配置记录在 ~/.claude_current 文件中(待改进)
  3. 环境变量设置: 使用 acm use 命令时自动导出相应的环境变量
  4. 配置验证: 提供完整的错误处理和配置验证机制

故障排除

如果遇到问题,请检查:

  1. 配置文件 ~/.claude_config 是否存在且格式正确
  2. API 密钥是否有效
  3. 网络连接是否正常
  4. 环境变量是否正确设置

使用 acm current 命令可以查看当前配置状态和诊断信息。

NPM 包发布

如果您想发布到 npm:

  1. 更新 package.json 中的包名和仓库信息
  2. 登录 npm:npm login
  3. 发布包:npm publish

开发

本地开发

# 安装依赖
npm install

# 编译 TypeScript
npm run build

# 监听模式编译
npm run dev

# 链接到全局测试
npm link

# 测试命令
acm help

# 取消链接
npm unlink -g ai-config-manager

项目结构

acm/
├── src/                # TypeScript 源代码
│   ├── bin/
│   │   └── acm.ts      # CLI 入口文件
│   ├── lib/
│   │   ├── index.ts    # 主模块导出
│   │   ├── config.ts   # 配置文件管理
│   │   └── commands.ts # 命令实现
│   └── types/
│       └── index.ts    # 类型定义
├── dist/               # 编译后的 JavaScript 文件
├── package.json        # NPM 包配置
├── tsconfig.json       # TypeScript 配置
├── install.sh          # 手动安装脚本
├── uninstall.sh        # 手动卸载脚本
├── acm                 # Bash 版本脚本
└── README.md           # 文档