Hi, thanks for this project — it is very useful for managing multiple Codex accounts.
I would like to request a one-shot auto-switch command, for example:
codex-auth switch --auto
or alternatively:
codex-auth auto-switch --once
Use case
I want to integrate codex-auth into a Codex hook/script.
The script should be able to trigger an account switch on demand without knowing:
- which accounts are currently logged in
- which accounts are available
- which account still has free usage limits
- which concrete account name/email should be passed to
codex-auth switch
Desired behavior
The command should check the locally known accounts and switch once to the next account that still has available/free limits.
Important: this should not enable automatic background switching or start a daemon. It should only perform a single switch when explicitly called.
So the behavior would be:
- User/script calls
codex-auth switch --auto
codex-auth checks available accounts / usage state
- It selects the next suitable account with remaining limits
- It switches the active Codex session once
- The command exits
Why this is useful
This would make codex-auth much easier to use in automation hooks.
For example, a Codex hook could simply call:
codex-auth switch --auto
without needing to parse account names, emails, aliases, or usage status manually.
This would provide the benefits of automatic account selection, but only as an explicit one-time action, without background behavior.
Possible command names
Possible options could be:
codex-auth switch --auto
codex-auth switch --auto --once
codex-auth auto-switch --once
codex-auth auto --once
The main point is: automatic account selection, but only for one explicit command execution.
This would be especially useful for scripting hooks that just want to switch to any currently usable account without having to know the concrete account name in advance.
Thanks!
Hi, thanks for this project — it is very useful for managing multiple Codex accounts.
I would like to request a one-shot auto-switch command, for example:
codex-auth switch --autoor alternatively:
codex-auth auto-switch --onceUse case
I want to integrate
codex-authinto a Codex hook/script.The script should be able to trigger an account switch on demand without knowing:
codex-auth switchDesired behavior
The command should check the locally known accounts and switch once to the next account that still has available/free limits.
Important: this should not enable automatic background switching or start a daemon. It should only perform a single switch when explicitly called.
So the behavior would be:
codex-auth switch --autocodex-authchecks available accounts / usage stateWhy this is useful
This would make
codex-authmuch easier to use in automation hooks.For example, a Codex hook could simply call:
codex-auth switch --autowithout needing to parse account names, emails, aliases, or usage status manually.
This would provide the benefits of automatic account selection, but only as an explicit one-time action, without background behavior.
Possible command names
Possible options could be:
codex-auth switch --autocodex-auth switch --auto --oncecodex-auth auto-switch --oncecodex-auth auto --onceThe main point is: automatic account selection, but only for one explicit command execution.
This would be especially useful for scripting hooks that just want to switch to any currently usable account without having to know the concrete account name in advance.
Thanks!