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-account-orchestrator

v1.4.2

Published

Codex OAuth account fallback orchestrator with seamless gateway mode

Downloads

922

Readme

codex-account-orchestrator (CAO)

CI npm version npm downloads license node typescript

Codex OAuth 账号编排工具。CAO 为每个账号创建独立的 CODEX_HOME,当额度用尽时自动切换到下一个账号。

Language: English | 한국어 | 日本語 | 中文 | Español

CAO 的优势

  • 额度耗尽时自动切换
  • 网关模式,长会话不中断
  • 状态摘要与健康检查
  • 可分享的 Markdown/JSON 报告
  • 账号级隔离,互不影响

环境要求

  • Node.js 18+
  • 已安装 Codex CLI,并在 PATH 中可用

安装

npm install -g codex-account-orchestrator

CLI 可用 caocodex-account-orchestrator 运行。

快速开始

  1. 添加账号
cao add accountA
cao add accountB
  1. 选择默认账号
cao switch
  1. 启动自动切换
cao run

要传递参数给 Codex,请放在 -- 后面:

cao run -- exec "summarize README"

主要命令

| 命令 | 说明 | | --- | --- | | cao add <name> | 添加账号并登录 | | cao switch | 交互式切换账号 | | cao current | 显示当前默认账号 | | cao list | 账号列表(简版) | | cao status | 状态仪表盘(TTY)或简洁摘要 | | cao status --full | 详细完整输出 | | cao status --compact | 一行摘要 | | cao status --doctor | 健康检查 | | cao status --report [md|json] | 生成报告 | | cao run | 自动切换运行 | | cao run --gateway | 通过网关运行 |

可观测性

cao status                 # TTY 显示仪表盘,非 TTY 输出摘要
cao status --full          # 详细完整输出
cao status --compact       # 一行摘要
cao status --pretty        # 强制仪表盘输出

健康检查(0=ok, 1=warn, 2=error):

cao status --doctor
cao status --doctor --json

报告:

cao status --report        # Markdown 报告
cao status --report json   # JSON 报告

网关模式(不中断会话)

启动网关:

cao gateway start

在 macOS 上,cao gateway start 也会通过 launchctl 导出 OPENAI_BASE_URL(这样从 Dock/Finder 启动的 Codex 桌面版也会走网关)。如需关闭:

cao gateway start --no-app-env

通过网关运行(CLI 自动切换关闭):

cao run --gateway

工作原理

每个账号有独立目录:

~/.codex-account-orchestrator/<account>/

每个账号都会生成 config.toml

cli_auth_credentials_store = "file"
forced_login_method = "chatgpt"

数据布局

~/.codex-account-orchestrator/
  registry.json
  account_status.json
  <account>/auth.json
  <account>/config.toml

快照导入(可选)

cao import codex-auth
cao import codex-auth --source ~/.codex/accounts
cao import codex-auth --overwrite

开发

npm install
npm run test

备注

  • 自动切换会捕获输出,可能让 Codex 认为非 TTY。需要纯 TTY 时使用 --no-fallback
  • 额度检测基于关键字,可在 src/constants.ts 扩展。

更新记录

详见 CHANGELOG.md