@victor-software-house/pi-multicodex 2.0.3 → 2.0.5
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
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
MultiCodex is a [pi](https://github.com/badlogic/pi-mono) extension that manages multiple ChatGPT Codex accounts and rotates between them automatically when you hit quota limits.
|
|
6
6
|
|
|
7
|
-
You add your Codex accounts once. After that, MultiCodex transparently picks the
|
|
7
|
+
You add your Codex accounts once. After that, MultiCodex transparently picks the best available account for every request. When one account runs dry mid-session, it switches to another and retries — no manual intervention needed.
|
|
8
8
|
|
|
9
9
|
## Getting started
|
|
10
10
|
|
|
@@ -24,9 +24,11 @@ When you start a session, MultiCodex:
|
|
|
24
24
|
|
|
25
25
|
1. Imports your existing pi Codex auth automatically (if present).
|
|
26
26
|
2. Checks usage data across all managed accounts.
|
|
27
|
-
3. Picks the
|
|
27
|
+
3. Picks the best available account — untouched accounts first, then the one whose weekly reset window ends soonest, then a random available account as fallback.
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
If you pin a specific account with `/multicodex use`, that account is used until it hits quota or you clear the override.
|
|
30
|
+
|
|
31
|
+
When a request hits a quota or rate limit **before** any output is streamed, MultiCodex marks that account exhausted, picks the next available one, and retries. This happens up to 5 times transparently. If the manual override account fails, the override is cleared and rotation continues with the remaining accounts. Once output has started streaming, the error is surfaced as-is — no mid-stream account switching.
|
|
30
32
|
|
|
31
33
|
## Commands
|
|
32
34
|
|
|
@@ -67,6 +69,8 @@ MultiCodex adds a live footer to your session showing the active account, 5-hour
|
|
|
67
69
|
|
|
68
70
|
You can customize which fields appear and their ordering with `/multicodex footer`.
|
|
69
71
|
|
|
72
|
+

|
|
73
|
+
|
|
70
74
|
## What it does under the hood
|
|
71
75
|
|
|
72
76
|
- **Provider override.** MultiCodex registers itself as the `openai-codex` provider. You do not need to select a different provider or change your model — it works with whatever Codex model you already use.
|
|
@@ -113,8 +117,32 @@ Local push protection via `lefthook` runs the same checks as CI before every pus
|
|
|
113
117
|
|
|
114
118
|
See [ROADMAP.md](ROADMAP.md) for planned work including configurable rotation settings, a shared controller architecture, and immediate footer persistence.
|
|
115
119
|
|
|
116
|
-
##
|
|
120
|
+
## Prior art and how this project differs
|
|
121
|
+
|
|
122
|
+
This extension builds on ideas from two earlier pi extensions. Both deserve credit for establishing the patterns that made this project possible.
|
|
123
|
+
|
|
124
|
+
### [kim0/pi-multicodex](https://github.com/kim0/pi-multicodex)
|
|
125
|
+
|
|
126
|
+
The original MultiCodex extension by [kim0](https://github.com/kim0). It introduced the core concept: manage multiple Codex OAuth accounts and rotate between them on quota failures. The original shipped as a single `index.ts` file (~990 lines) with three top-level commands (`/multicodex-login`, `/multicodex-use`, `/multicodex-status`), a stream wrapper for transparent retries, and account selection logic that prefers untouched accounts and earliest weekly resets.
|
|
127
|
+
|
|
128
|
+
This fork diverged significantly:
|
|
129
|
+
|
|
130
|
+
- **Modular architecture.** Split into 16 focused modules (~2,400 lines of runtime code, ~1,200 lines of tests) instead of one monolithic file.
|
|
131
|
+
- **Command family.** One `/multicodex` command with subcommands and dynamic autocomplete, replacing three separate top-level commands.
|
|
132
|
+
- **Account removal.** In-session account deletion from the picker via `Backspace` with confirmation — the original had no way to remove accounts without editing the JSON file.
|
|
133
|
+
- **Non-interactive mode.** All inspection and recovery subcommands (`show`, `verify`, `path`, `reset`, `help`) work without a UI panel.
|
|
134
|
+
- **Auth import.** Automatically imports pi's stored `openai-codex` credentials when they change, so existing pi logins work without re-entering them.
|
|
135
|
+
- **Token refresh.** Proactively refreshes OAuth tokens before expiry instead of failing on stale credentials.
|
|
136
|
+
- **Automated releases.** semantic-release with npm trusted publishing, commitlint, lefthook pre-push checks, and CI validation on every push.
|
|
137
|
+
|
|
138
|
+
### [calesennett/pi-codex-usage](https://github.com/calesennett/pi-codex-usage)
|
|
139
|
+
|
|
140
|
+
A footer-only extension by [calesennett](https://github.com/calesennett) that shows Codex usage windows in the pi status bar. It introduced the idea of a live footer displaying 5-hour and 7-day usage percentages with reset countdowns, and offered two commands to toggle display mode and reset window.
|
|
117
141
|
|
|
118
|
-
This project
|
|
142
|
+
This project incorporated and extended that footer concept:
|
|
119
143
|
|
|
120
|
-
The usage footer
|
|
144
|
+
- **Integrated footer.** The usage footer is part of the rotation extension rather than a separate install, so it always reflects the active rotated account.
|
|
145
|
+
- **More settings.** Five configurable fields (usage mode, reset window, show account, show reset countdown, footer order) compared to two toggles.
|
|
146
|
+
- **Settings panel.** Interactive `SettingsList` modal with live preview instead of separate toggle commands.
|
|
147
|
+
- **Colored segments.** Footer renders usage percentages, separators, and account labels in distinct colors matched to the terminal theme.
|
|
148
|
+
- **Model-aware display.** Footer clears when switching to non-Codex models and debounces rapid model changes.
|
|
Binary file
|