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

codex-acm

v1.1.1

Published

Codex 多账号切换管理工具,支持 Team 账号和自定义 API

Readme

codex-acm

codex-acm / codex-switcher 是一个管理 Codex 多账号的命令行工具。

它做的事情比较直接:

  • 保存多个 Team 账号和自定义 API 账号
  • 在切换账号时同步更新 ~/.codex/auth.json~/.codex/config.toml
  • 保留每个账号自己的认证快照,避免反复手改配置

安装

npm install -g codex-acm

安装后可使用两个命令名:

codex-acm
codex-switcher

如果只想在当前目录运行:

npm install
node bin/cli.js

常用命令

# 导入当前 Team 登录态
codex-switcher add --team

# 添加自定义 API 账号
codex-switcher add --custom

# 查看账号列表
codex-switcher list

# 切换账号
codex-switcher switch
codex-switcher switch 1
codex-switcher switch "facai"

# 查看当前账号
codex-switcher current

# 删除账号
codex-switcher remove

# 导入单个 auth.json
codex-switcher import ./auth.json --alias "备用账号"

# 导出 / 导入账号配置包
codex-switcher export-config ./codex-switcher-config.json
codex-switcher import-config ./codex-switcher-config.json

支持的账号类型

Team 账号

适用于通过 codex login 获取的 ChatGPT / Team 登录态。

切换时会:

  1. 恢复该账号保存的 auth.json
  2. 移除工具管理的自定义 provider,回到默认 OpenAI provider

自定义 API 账号

适用于 OpenAI 兼容接口或中转服务。

切换时会:

  1. 将该账号的 API Key 写入 ~/.codex/auth.json
  2. ~/.codex/config.toml 中写入对应的 model_providerbase_urlwire_api 等配置

当前版本中,Codex 的自定义 API 切换统一依赖 auth.json 中的 OPENAI_API_KEY,不再要求运行时额外提供 CODEX_KEY_* 环境变量。

数据位置

默认写入 ~/.codex

  • ~/.codex/auth.json
  • ~/.codex/config.toml
  • ~/.codex/accounts/registry.json
  • ~/.codex/accounts/<account>/auth.json

如果设置了 CODEX_HOME,则使用对应目录。

命令说明

| 命令 | 说明 | | --- | --- | | list | 列出已保存账号 | | add --team | 添加 Team 账号 | | add --custom | 添加自定义 API 账号 | | switch [别名\|序号] | 切换账号 | | model [模型名] | 修改当前模型和推理强度 | | remove | 删除账号 | | import <path> [--alias] | 导入单个 auth.json | | export-config <path> | 导出账号配置包 | | import-config <path> | 导入账号配置包 | | current | 查看当前账号 |

设计边界

  • 工具只管理 CODEX_HOME 下的配置文件,不修改 shell 启动文件
  • 删除账号时只清理工具管理的 live 状态和账号目录
  • 导入配置包不会直接覆盖当前 live auth.jsonconfig.toml
  • 切换过程按事务处理,写入失败时会回滚已修改的 live 文件

开发

npm install
npm test

本地调试:

node bin/cli.js list
node bin/cli.js switch facai

License

MIT