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

@eruoxi/csm-test

v0.0.1

Published

Claude Code Settings Manager - 管理多个 Claude Code 配置档案

Readme

CSM - Claude Code Settings Manager

管理多个 Claude Code 配置档案的 CLI 工具,支持在不同模型厂商配置之间一键切换。

安装

npm 安装

npm install -g @eruoxi/csm

直接下载

GitHub Releases 下载适合你系统的可执行文件。

快速开始

# 创建配置档案 (从当前配置复制)
csm create baidu-qianfan --copy-current

# 创建空配置
csm create anthropic-official --empty

# 列出所有配置
csm list

# 切换配置
csm use baidu-qianfan

# 查看当前配置
csm current

# 交互式切换 (use 无参数时的别名)
csm switch

# 或直接使用 use 无参数
csm use

命令列表

配置管理

| 命令 | 说明 | |-----------------------|-------------| | csm create <name> | 创建新配置档案 | | csm show <name> | 显示配置详情 | | csm edit <name> | 用编辑器打开配置文件 | | csm rename <old> <new> | 重命名配置档案 | | csm delete <name> | 删除配置 | | csm list / csm ls | 列出所有配置 |

配置切换

| 命令 | 说明 | |------------------|----------| | csm use <name> | 切换到指定配置 (无参数时交互式选择) | | csm switch | 交互式选择切换 (use 的别名) | | csm current | 显示当前激活配置 |

导入导出

| 命令 | 说明 | |-------------------------|---------------| | csm import <file> | 从 JSON 文件导入配置 | | csm export <name> | 导出配置为 JSON 文件 | | csm copy <src> <dest> | 复制配置 |

备份恢复

| 命令 | 说明 | |------------------------|----------------| | csm backup | 备份所有配置到 zip 文件 | | csm restore <backup> | 从备份恢复配置 | | csm backups | 列出所有备份文件 |

配置合并策略

切换配置时支持部分字段继承:

# 完全替换 (默认)
csm use anthropic-official

# 保留当前权限配置
csm use openai-proxy --keep-permissions

# 保留当前插件配置
csm use baidu-qianfan --keep-plugins

# 保留多个字段
csm use custom --keep-permissions --keep-plugins

# 指定合并字段
csm use custom --merge permissions,enabledPlugins,env

# 完全替换,不合并任何字段
csm use custom --no-merge

选项说明

create 命令选项

-c, --copy-current        从当前 settings.json 复制配置
-e, --empty               创建空配置,跳过交互式设置

use 命令选项

--merge <fields>          指定要合并的字段 (逗号分隔)
--no-merge                完全替换,不合并任何字段
--keep-permissions        保留当前权限配置
--keep-plugins            保留当前插件配置
--dry-run                 预览切换结果,不实际执行

list 命令选项

-j, --json                以 JSON 格式输出

current 命令选项

-s, --show-settings       同时显示当前 settings 内容

edit 命令选项

--no-open                仅显示文件路径,不打开编辑器

delete 命令选项

-f, --force               强制删除,不询问确认

import 命令选项

-n, --name <name>         指定导入后的配置名称
-f, --force               覆盖已存在的同名配置

export 命令选项

-o, --output <dir>        输出目录 (默认当前目录)
-f, --filename <name>     输出文件名 (默认使用配置名)

restore 命令选项

-f, --force               覆盖现有配置,不询问
--skip-validation         跳过备份验证
--no-auto-backup          恢复前不自动备份当前配置

backup 命令选项

-n, --name <name>         指定备份文件名(默认自动生成)

backups 命令选项

-j, --json                以 JSON 格式输出

数据存储

所有数据存储在 ~/.claude/ 目录下:

~/.claude/
├── settings.json          # 当前生效配置
├── csm/                   # CSM 数据目录
│   ├── profiles/          # 配置档案存储目录
│   │   ├── baidu-qianfan.json
│   │   └── anthropic-official.json
│   ├── backups/           # 备份存储目录
│   │   └── csm-backup-*.zip
│   └── csm-state.json     # 工具状态 (当前激活配置)

开发

# 安装依赖
npm install

# 开发模式运行
npm run dev

# 构建
npm run build

# 测试
npm test

# 打包可执行文件 (Windows/macOS/Linux)
npm run pkg

License

MIT