@imdeadpool/codex-account-switcher 0.1.10 → 0.1.11

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/README.md CHANGED
@@ -123,7 +123,7 @@ codex-auth remove-login-hook
123
123
  - `codex-auth config auto ...` – Enables/disables managed auto-switch and updates threshold percentages.
124
124
  - `codex-auth config api enable|disable` – Chooses usage source mode (`api` or `local`).
125
125
  - `codex-auth daemon --once|--watch` – Runs the auto-switch loop once or continuously.
126
- - `codex-auth setup-login-hook [-f <path>]` – Installs an optional shell hook in your rc file to restore session-pinned snapshot before each `codex` run, auto-sync snapshots after successful official `codex login`, and restore common terminal modes before returning to your prompt.
126
+ - `codex-auth setup-login-hook [-f <path>]` – Installs an optional shell hook in your rc file to restore session-pinned snapshot before each `codex` run, refresh codex-auth session memory after each `codex` exit, and restore common terminal modes before returning to your prompt.
127
127
  - `codex-auth hook-status [-f <path>]` – Shows whether the optional login auto-snapshot hook is installed for the selected rc file.
128
128
  - `codex-auth remove-login-hook [-f <path>]` – Removes the optional shell hook.
129
129
 
@@ -33,7 +33,7 @@ function resolveDefaultShellRcPath() {
33
33
  function renderLoginHookBlock() {
34
34
  return [
35
35
  exports.LOGIN_HOOK_MARK_START,
36
- "# Auto-sync codex-auth snapshots after successful official `codex login`.",
36
+ "# Keep terminal-scoped snapshot memory in sync before/after each `codex` run.",
37
37
  "# Also restore common terminal modes to avoid leaked escape sequences after codex exits.",
38
38
  "__codex_auth_restore_tty() {",
39
39
  " [[ -t 1 ]] || return 0",
@@ -48,19 +48,8 @@ function renderLoginHookBlock() {
48
48
  " fi",
49
49
  " command codex \"$@\"",
50
50
  " local __codex_exit=$?",
51
- " if [[ $__codex_exit -eq 0 ]]; then",
52
- " local __first_non_flag=\"\"",
53
- " local __arg",
54
- " for __arg in \"$@\"; do",
55
- " case \"$__arg\" in",
56
- " --) break ;;",
57
- " -*) ;;",
58
- " *) __first_non_flag=\"$__arg\"; break ;;",
59
- " esac",
60
- " done",
61
- " if [[ \"$__first_non_flag\" == \"login\" ]] && command -v codex-auth >/dev/null 2>&1; then",
62
- " CODEX_AUTH_FORCE_EXTERNAL_SYNC=1 command codex-auth status >/dev/null 2>&1 || true",
63
- " fi",
51
+ " if command -v codex-auth >/dev/null 2>&1; then",
52
+ " CODEX_AUTH_FORCE_EXTERNAL_SYNC=1 command codex-auth status >/dev/null 2>&1 || true",
64
53
  " fi",
65
54
  " if [[ -z \"${CODEX_AUTH_SKIP_TTY_RESTORE:-}\" ]]; then",
66
55
  " __codex_auth_restore_tty",
@@ -70,6 +70,7 @@ async function withTempRcFile(t, fn) {
70
70
  strict_1.default.ok(hook.includes("__codex_auth_restore_tty"));
71
71
  strict_1.default.ok(hook.includes("command codex-auth restore-session"));
72
72
  strict_1.default.ok(hook.includes("CODEX_AUTH_FORCE_EXTERNAL_SYNC=1 command codex-auth status"));
73
+ strict_1.default.ok(!hook.includes("__first_non_flag"));
73
74
  strict_1.default.ok(hook.includes("\\033[>4m"));
74
75
  strict_1.default.ok(hook.includes("\\033[<u"));
75
76
  strict_1.default.ok(hook.includes("\\033[?2026l"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imdeadpool/codex-account-switcher",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "A command-line tool that lets you manage and switch between multiple Codex accounts instantly, no more constant logins and logouts.",
5
5
  "license": "MIT",
6
6
  "bin": {