@wangxt0223/codex-switcher 0.6.2 → 0.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.3 - 2026-04-12
4
+
5
+ - Changed `list` email rendering to show plain email only (removed `(account)` prefix).
6
+ - Reworked root Chinese/English README command reference into full command tables based on current capabilities.
7
+ - Updated smoke-test assertions for the new email column format.
8
+
3
9
  ## 0.6.2 - 2026-04-12
4
10
 
5
11
  - Added usage-API proxy auto-detection (manual proxy > env proxy > macOS system proxy).
package/README.en.md CHANGED
@@ -63,7 +63,49 @@ codex-switcher account use corp --env project-a
63
63
 
64
64
  ## Command reference
65
65
 
66
- See plugin guide:
66
+ Commands below use `codex-sw` (all are equivalent under `codex-switcher`):
67
+
68
+ | Category | Command | Description |
69
+ | --- | --- | --- |
70
+ | Env | `codex-sw env list` | List all envs with CLI/App current markers |
71
+ | Env | `codex-sw env create <env> [--empty\|--from-default\|--from-env <src>]` | Create env from empty/default/another env |
72
+ | Env | `codex-sw env use <env> [--target cli\|app\|both]` | Switch env pointer for CLI/App |
73
+ | Env | `codex-sw env remove <env> [--force]` | Remove env |
74
+ | Env | `codex-sw env current [cli\|app]` | Show current env pointer |
75
+ | Env | `codex-sw env path [env]` | Print exportable `CODEX_HOME` path |
76
+ | Account | `codex-sw account list [--env <env>]` | List accounts in env with current markers |
77
+ | Account | `codex-sw account add <account> [--env <env>]` | Add account slot |
78
+ | Account | `codex-sw account remove <account> [--env <env>] [--force]` | Remove account slot |
79
+ | Account | `codex-sw account login <account> [--env <env>] [--target cli\|app\|both] [--sync\|--no-sync]` | Login account and persist auth |
80
+ | Account | `codex-sw account use <account> [--env <env>] [--target cli\|app\|both] [--sync\|--no-sync]` | Switch to account |
81
+ | Account | `codex-sw account logout [account] [--env <env>] [--target cli\|app\|both]` | Logout account |
82
+ | Account | `codex-sw account current [cli\|app]` | Show current env/account pointer |
83
+ | Usage proxy | `codex-sw proxy [<host:port>\|off\|test]` | Configure/test usage API proxy (only affects `list`) |
84
+ | Query/Run | `codex-sw list` | Show `ENV/ACCOUNT/EMAIL/PLAN/5H/WEEKLY/LAST ACTIVITY` |
85
+ | Query/Run | `codex-sw status` | Show login status for current CLI/App pointers |
86
+ | Query/Run | `codex-sw current [cli\|app]` | Show current env/account |
87
+ | Query/Run | `codex-sw exec -- <codex args...>` | Run `codex` under current CLI env/account |
88
+ | Compat | `codex-sw login [account] [--sync\|--no-sync]` | Compatibility alias for CLI login |
89
+ | Compat | `codex-sw logout [account]` | Compatibility alias for CLI logout |
90
+ | Compat | `codex-sw use <account> [--sync\|--no-sync] [--launch\|--no-launch] [-- <codex args...>]` | Compatibility alias for CLI switch |
91
+ | Compat | `codex-sw switch <account> [--sync\|--no-sync] [--launch\|--no-launch] [-- <codex args...>]` | Same as `use` |
92
+ | Compat | `codex-sw add <account>` | Compatibility alias for `account add` |
93
+ | Compat | `codex-sw remove <account> [--force]` | Compatibility alias for `account remove` |
94
+ | Compat | `codex-sw import-default <env> [--with-auth] [--force]` | Import default env data into target env |
95
+ | App | `codex-sw app open [account] [-- <app args...>]` | Open Codex App under account |
96
+ | App | `codex-sw app use <account> [-- <app args...>]` | Switch App account (alias of open) |
97
+ | App | `codex-sw app logout [account]` | Logout App account |
98
+ | App | `codex-sw app status` | Show managed App process status |
99
+ | App | `codex-sw app stop` | Stop managed App process |
100
+ | App | `codex-sw app current` | Show current App env/account |
101
+ | Maintenance | `codex-sw init [--shell zsh\|bash] [--dry-run]` | Initialize PATH bootstrap |
102
+ | Maintenance | `codex-sw upgrade [--dry-run]` | Upgrade from npm |
103
+ | Maintenance | `codex-sw recover [--dry-run]` | Recover corrupted pointers |
104
+ | Maintenance | `codex-sw check` | Basic health checks |
105
+ | Maintenance | `codex-sw doctor [--fix]` | Deep diagnostics and optional auto-fix |
106
+ | Maintenance | `codex-sw --help` | Show full help |
107
+
108
+ Plugin-level docs:
67
109
  - Chinese: `plugins/codex-switcher/README.md`
68
110
  - English: `plugins/codex-switcher/README.en.md`
69
111
 
package/README.md CHANGED
@@ -60,7 +60,49 @@ codex-switcher account use corp --env project-a
60
60
 
61
61
  ## 命令参考
62
62
 
63
- 完整命令说明请查看插件文档:
63
+ 以下以 `codex-sw` 为例(`codex-switcher` 为等价兼容命令):
64
+
65
+ | 分类 | 命令 | 说明 |
66
+ | --- | --- | --- |
67
+ | Env 管理 | `codex-sw env list` | 列出所有 env,并标记 CLI/App 当前 env |
68
+ | Env 管理 | `codex-sw env create <env> [--empty\|--from-default\|--from-env <src>]` | 创建 env(空目录或从已有 env 同步数据) |
69
+ | Env 管理 | `codex-sw env use <env> [--target cli\|app\|both]` | 切换 CLI/App 使用的 env |
70
+ | Env 管理 | `codex-sw env remove <env> [--force]` | 删除 env(必要时强制) |
71
+ | Env 管理 | `codex-sw env current [cli\|app]` | 查看当前 env 指针 |
72
+ | Env 管理 | `codex-sw env path [env]` | 输出 env 对应 `CODEX_HOME` 导出语句 |
73
+ | 账号管理 | `codex-sw account list [--env <env>]` | 列出 env 下账号并标记当前账号 |
74
+ | 账号管理 | `codex-sw account add <account> [--env <env>]` | 创建账号槽位(不登录) |
75
+ | 账号管理 | `codex-sw account remove <account> [--env <env>] [--force]` | 删除账号槽位 |
76
+ | 账号管理 | `codex-sw account login <account> [--env <env>] [--target cli\|app\|both] [--sync\|--no-sync]` | 在目标 env 登录并保存账号 `auth.json` |
77
+ | 账号管理 | `codex-sw account use <account> [--env <env>] [--target cli\|app\|both] [--sync\|--no-sync]` | 切换到目标账号 |
78
+ | 账号管理 | `codex-sw account logout [account] [--env <env>] [--target cli\|app\|both]` | 注销账号(删除对应 auth) |
79
+ | 账号管理 | `codex-sw account current [cli\|app]` | 查看当前 env/account 指针 |
80
+ | 用量代理 | `codex-sw proxy [<host:port>\|off\|test]` | 设置/关闭/测试“用量 API”代理(仅影响 `list`) |
81
+ | 查询执行 | `codex-sw list` | 展示 `ENV/ACCOUNT/EMAIL/PLAN/5H/WEEKLY/LAST ACTIVITY` |
82
+ | 查询执行 | `codex-sw status` | 检查 CLI/App 当前登录状态 |
83
+ | 查询执行 | `codex-sw current [cli\|app]` | 查看当前 env/account |
84
+ | 查询执行 | `codex-sw exec -- <codex args...>` | 在当前 CLI env/account 下执行 `codex` |
85
+ | 兼容命令 | `codex-sw login [account] [--sync\|--no-sync]` | 登录当前 CLI 账号(兼容入口) |
86
+ | 兼容命令 | `codex-sw logout [account]` | 注销当前 CLI 账号(兼容入口) |
87
+ | 兼容命令 | `codex-sw use <account> [--sync\|--no-sync] [--launch\|--no-launch] [-- <codex args...>]` | 切换 CLI 账号(兼容入口) |
88
+ | 兼容命令 | `codex-sw switch <account> [--sync\|--no-sync] [--launch\|--no-launch] [-- <codex args...>]` | `use` 的等价命令 |
89
+ | 兼容命令 | `codex-sw add <account>` | `account add` 的兼容入口 |
90
+ | 兼容命令 | `codex-sw remove <account> [--force]` | `account remove` 的兼容入口 |
91
+ | 兼容命令 | `codex-sw import-default <env> [--with-auth] [--force]` | 从默认 env 导入数据到指定 env |
92
+ | App 管理 | `codex-sw app open [account] [-- <app args...>]` | 以指定账号打开 Codex App |
93
+ | App 管理 | `codex-sw app use <account> [-- <app args...>]` | 切换 App 到指定账号(内部等价于 open) |
94
+ | App 管理 | `codex-sw app logout [account]` | 注销 App 当前账号 |
95
+ | App 管理 | `codex-sw app status` | 查看 App 管理进程状态 |
96
+ | App 管理 | `codex-sw app stop` | 停止由工具托管启动的 App 进程 |
97
+ | App 管理 | `codex-sw app current` | 查看 App 当前 env/account |
98
+ | 维护命令 | `codex-sw init [--shell zsh\|bash] [--dry-run]` | 初始化 PATH 快捷命令 |
99
+ | 维护命令 | `codex-sw upgrade [--dry-run]` | 升级到最新 npm 版本 |
100
+ | 维护命令 | `codex-sw recover [--dry-run]` | 自动恢复损坏指针 |
101
+ | 维护命令 | `codex-sw check` | 基础健康检查 |
102
+ | 维护命令 | `codex-sw doctor [--fix]` | 深度检查并可选自动修复 |
103
+ | 维护命令 | `codex-sw --help` | 查看完整帮助 |
104
+
105
+ 插件侧详细说明:
64
106
 
65
107
  - 中文:`plugins/codex-switcher/README.md`
66
108
  - English:`plugins/codex-switcher/README.en.md`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wangxt0223/codex-switcher",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
4
4
  "description": "Env + account switcher for Codex CLI and Codex App with shared env data and per-account auth.",
5
5
  "license": "MIT",
6
6
  "author": "wangxt",
@@ -378,9 +378,9 @@ def main() -> int:
378
378
  last_activity = format_relative(last_activity_epoch, now_epoch)
379
379
 
380
380
  if email:
381
- display_email = f"({args.account_name}){email}"
381
+ display_email = email
382
382
  else:
383
- display_email = f"({args.account_name})-"
383
+ display_email = "-"
384
384
 
385
385
  out_fields = [
386
386
  display_email,
@@ -180,14 +180,14 @@ grep -q "PLAN" /tmp/codex_sw_list_api
180
180
  grep -q "5H USAGE" /tmp/codex_sw_list_api
181
181
  grep -q "WEEKLY USAGE" /tmp/codex_sw_list_api
182
182
  grep -q "LAST ACTIVITY" /tmp/codex_sw_list_api
183
- grep -q "(personal)personal@example.com" /tmp/codex_sw_list_api
183
+ grep -q "personal@example.com" /tmp/codex_sw_list_api
184
184
  grep -q "(api)" /tmp/codex_sw_list_api
185
185
  grep -q "60% (" /tmp/codex_sw_list_api
186
186
  grep -q "80% (" /tmp/codex_sw_list_api
187
187
  grep -q "proxy=http://127.0.0.1:7899" "$CODEX_SWITCHER_TEST_CURL_LOG"
188
188
 
189
189
  "$SW_LINK" list >/tmp/codex_sw_list_symlink
190
- grep -q "(personal)personal@example.com" /tmp/codex_sw_list_symlink
190
+ grep -q "personal@example.com" /tmp/codex_sw_list_symlink
191
191
  grep -q "(api)" /tmp/codex_sw_list_symlink
192
192
 
193
193
  mkdir -p "$ENVS/project/home/sessions/2026/04/12"