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

claude-model-manager

v1.0.1

Published

A CLI tool to manage Claude Code model providers and environment variables

Readme

Claude Model Manager (cmm)

Claude Code 模型管理工具 - 一个全局 npm 包,用于管理 Claude Code 的模型供应商和环境变量。

功能特性

  • 📁 配置文件管理 - 通过 JSON 配置文件管理多个模型供应商
  • 🔄 快速切换 - 交互式选择供应商并启动 Claude Code
  • 🔐 环境变量隔离 - 环境变量只对当前窗口生效,不影响其他会话
  • 🎯 支持多供应商 - 预置 Anthropic、OpenRouter、DeepSeek 等供应商模板

安装

npm install -g claude-model-manager

快速开始

1. 初始化配置

cmm init

这将在 ~/.cmm/config.json 创建示例配置文件。

cmm config

这个命令会输出你本地的配置文件目录,你可以自己修改

2. 编辑配置文件

打开配置文件,填入您的 API Key 和其他配置:

{
  "version": "1.0.0",
  "currentProvider": "anthropic",
  "providers": {
    "anthropic": {
      "name": "Anthropic Official",
      "baseUrl": "https://api.anthropic.com",
      "apiKey": "your-api-key-here",
      "model": "claude-sonnet-4-20250514",
      "defaultOpusModel": "claude-opus-4-20250514",
      "defaultSonnetModel": "claude-sonnet-4-20250514",
      "defaultHaikuModel": "claude-haiku-4-20250514",
      "smallFastModel": "claude-sonnet-4-20250514",
      "subagentModel": "claude-sonnet-4-20250514",
      "maxOutputTokens": "100000",
    }
  }
}

3. 启动 Claude Code(推荐方式)

Windows PowerShell:

cmm code

这会让你在启动 claude 之前,先选择一个自己配置的模型

4. 验证环境变量

cmm status

看到你配置的模型, 在claude终端里执行 cmm status 可以看到当前会话窗口设置的环境变量

命令

| 命令 | 说明 | |------|------| | cmm init | 初始化配置文件 | | cmm code | 选择供应商并启动 Claude Code(子进程方式) | | cmm config | 显示配置文件路径 | | cmm status | 显示当前状态和环境变量 | | cmm env | 输出环境变量脚本(用于 Invoke-Expression/eval) | | cmm env -r | 输出环境变量脚本 + 启动 claude | | cmm env -p <id> | 指定供应商 |

配置说明

供应商配置字段

| 字段 | 必填 | 说明 | |------|------|------| | name | ✓ | 供应商显示名称 | | baseUrl | ✓ | API 基础地址 | | apiKey | ✓ | API 密钥 | | model | ✓ | 默认使用的模型 | | defaultOpusModel | - | Opus 模型别名 | | defaultSonnetModel | - | Sonnet 模型别名 | | defaultHaikuModel | - | Haiku 模型别名 | | smallFastModel | - | 快速模型,用于简单任务 | | subagentModel | - | 子代理使用的模型 | | maxOutputTokens | - | 最大输出 token 数 |

环境变量映射

配置字段会映射到以下 Claude Code 环境变量:

| 配置字段 | 环境变量 | |---------|---------| | apiKey | ANTHROPIC_AUTH_TOKEN | | baseUrl | ANTHROPIC_BASE_URL | | model | ANTHROPIC_MODEL | | defaultOpusModel | ANTHROPIC_DEFAULT_OPUS_MODEL | | defaultSonnetModel | ANTHROPIC_DEFAULT_SONNET_MODEL | | defaultHaikuModel | ANTHROPIC_DEFAULT_HAIKU_MODEL | | smallFastModel | ANTHROPIC_SMALL_FAST_MODEL | | subagentModel | CLAUDE_CODE_SUBAGENT_MODEL | | maxOutputTokens | CLAUDE_CODE_MAX_OUTPUT_TOKENS |

许可证

MIT