Skip to content

SHAREN/codex-account-switcher-skill

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

codex-account-switcher

Manage multiple OpenAI Codex accounts by swapping authentication tokens.

⚠️ Sensitive: This skill reads and writes ~/.codex/auth.json and ~/.codex/accounts/*.json (authentication tokens).

ClawHub

Published on ClawHub.

Usage

See SKILL.md for full documentation.

./codex-accounts.py list          # List saved accounts
./codex-accounts.py add           # Add a new account (interactive)
./codex-accounts.py use <name>    # Switch to an account
./codex-accounts.py auto          # Switch to account with best quota
./codex-accounts.py ensure        # Switch only when active account is below quota thresholds

ensure command

ensure checks the currently active account and switches only if remaining quota is below thresholds. Thresholds are remaining percent, not used percent.

# Default thresholds (2% daily remaining, 2% weekly remaining)
./codex-accounts.py ensure

# Custom thresholds
./codex-accounts.py ensure --min-daily-remaining 5 --min-weekly-remaining 10

# JSON output
./codex-accounts.py ensure --json

Recommended systemd user timer

Use a periodic user timer to run ensure automatically:

~/.config/systemd/user/codex-switcher.service

[Unit]
Description=Codex account ensure-switcher

[Service]
Type=oneshot
ExecStart=/usr/bin/python3 /home/renat/.agents/skills/codex-account-switcher/codex-accounts.py ensure --min-daily-remaining 2 --min-weekly-remaining 2 --max-cache-age-hours 6

~/.config/systemd/user/codex-switcher.timer

[Unit]
Description=Run codex ensure-switch periodically

[Timer]
OnBootSec=30s
OnUnitActiveSec=300s

[Install]
WantedBy=timers.target
systemctl --user daemon-reload
systemctl --user enable --now codex-switcher.timer
systemctl --user start codex-switcher.service
journalctl --user -u codex-switcher.service -n 100 --no-pager

Documentation

  • SKILL.md — agent-facing reference (commands, behavior, limitations)
  • SETUP.md — prerequisites, configuration, and setup instructions
  • ClawHub — install via ClawHub registry

License

MIT

About

OpenClaw skill: Codex account switcher

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Python 100.0%