@carlosgtrz/pi-codex-aliases
v0.1.4
Published
Pi extension that adds personal and work aliases for the built-in OpenAI Codex provider.
Maintainers
Readme
@carlosgtrz/pi-codex-aliases
Pi extension that registers two aliases for Pi's built-in OpenAI Codex provider:
openai-codex-personal— shown in/loginasChatGPT Plus/Pro (Codex Subscription) - Personalopenai-codex-work— shown in/loginasChatGPT Plus/Pro (Codex Subscription) - Work
This is useful when you have both a personal ChatGPT account and a work ChatGPT account. You can keep both logged in at the same time, then switch between them using Pi's provider/model selection instead of logging in and out.
Install
pi install npm:@carlosgtrz/pi-codex-aliasesTry without installing permanently:
pi -e npm:@carlosgtrz/pi-codex-aliasesFor one-off testing from this repo:
pi -e ./packages/codex-aliasesUsage
After installation, start Pi:
piUse /login to authenticate each alias separately. In the provider list, choose:
ChatGPT Plus/Pro (Codex Subscription) - Personalfor your personal ChatGPT account.ChatGPT Plus/Pro (Codex Subscription) - Workfor your work ChatGPT account.
For example, /login shows entries like:
Select provider to configure:
→ ChatGPT Plus/Pro (Codex Subscription) • unconfigured
ChatGPT Plus/Pro (Codex Subscription) - Personal ✓ configured
ChatGPT Plus/Pro (Codex Subscription) - Work ✓ configuredThen use Pi's provider/model selection UI or command to choose a Codex model under either alias:
openai-codex-personalopenai-codex-work
Each alias uses the same built-in OpenAI Codex model list, but stores separate OAuth credentials.
The extension also syncs the selected alias token into Codex-related environment variables for compatible extensions/tools during the active session.
Sub-bar compatibility
This extension is compatible with sub-bar, the Pi usage/status bar extension.
When you select either openai-codex-personal or openai-codex-work, this extension exposes the selected alias credentials through Codex-compatible environment variables and asks sub-bar's shared sub-core to refresh. This lets sub-bar show usage for the currently selected Codex alias instead of only Pi's default Codex provider.
Note
You can log out of Pi's default OpenAI Codex provider if you only want to use the aliases, or keep the default provider logged in and use it for a third ChatGPT account.
License
MIT
