Skip to content

Latest commit

ย 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ opencode-codex-oauth-manager

npm version

Dashboard Preview

"Built to make the OpenCode experience even more practical and seamless."

I originally developed opencode-codex-oauth-manager to streamline my own workflow while managing multiple OpenAI Plus, Team, or Business accounts within OpenCode. I decided to share it with the community, hoping it might be useful for others who deal with similar setups.


โšก At a Glance: Why Itโ€™s Critical

Managing several high-tier accounts manually is a productivity killer. Hereโ€™s why this tool is your new unfair advantage:

  • ๐Ÿ”ฅ Zero-Friction Switching: Swap active accounts in under 2 seconds. No config file editing, no logout/login loops.
  • โšก Instant Apply: No restart required! Changes apply to OpenCode in real-time. Just switch and keep working.
  • ๐Ÿ“Š Real-Time Quota Intel: Don't guess. On every startup, it pings OpenAI to show you exactly how many messages you have left and the precise reset time.
  • ๐Ÿง  Smart Auto-Sync: It automatically detects your active OpenCode account and securely clones it into your local database.
  • ๐Ÿ›ก๏ธ Use Responsibly: This tool is built for productivity. Please do not abuse the system.
  • ๐Ÿ’Ž Pro Support: Perfect for Pro account users too. (And if you actually manage to finish your Pro quota, hats off to you! ๐Ÿ˜„)

๐Ÿ”ฅ Why It's a Game Changer

If you're an OpenCode power user, this is your new unfair advantage:

  • ๐Ÿš€ Speed: Switch between personal and business accounts faster than you can type a message.
  • ๐Ÿ“‰ Transparency: See your 5-hour and weekly limits in color-coded ASCII bars.
  • ๐Ÿ“ˆ Insights: Track usage statistics to see which accounts are providing the most value.
  • ๐Ÿ’พ Portability: Easily backup your entire account repository and move it to another machine.
  • ๐ŸŒ Universal: Native, high-performance support for Windows, Linux, and macOS.

๐Ÿ› ๏ธ Features That Actually Matter

  • Interactive Command Center: A sleek, intuitive menu for renames, health checks, and switching.
  • Auto-Health Check: Optional automatic refresh on startup so you're always working with fresh data.
  • Account Labeling: Give your accounts human names like Company-Business or Backup-Plus-2.
  • i18n Ready: Dynamic auto-detection for English and Turkish languages.
  • Local-First Security: Your tokens stay on your machine. We never touch your secrets.
  • OpenCode Sidebar Plugin (NEW): Includes an optional TUI sidebar panel with quick account switching, compact quota view, refresh control, auto-refresh toggle, and saved UI preferences.

๐Ÿš€ Quick Start & Installation

Prerequisites

Setup

  1. Install from npm:
    npm install -g opencode-codex-oauth-manager
  2. Launch: Type oc-hesap in any terminal.
  3. Optional sidebar plugin:
    oc-hesap install-plugin
    Restart OpenCode after installing the sidebar plugin.

Update

npm update -g opencode-codex-oauth-manager

๐ŸŽฎ Interactive Commands

Forget about complex flags. Manage everything with single keystrokes:

  • [Number]: Instantly switch to that account.
  • 0: Force a manual refresh of all account health/quotas.
  • r [N] [Name]: Rename account number N to a custom name.
  • l: Toggle interface language (English/Turkish).
  • b: Create a timestamped backup of your account database.
  • i: Import an existing backup file.
  • q: Exit the manager.

๐Ÿงฉ Optional Sidebar Plugin

This repository now includes an OpenCode TUI sidebar plugin at plugin/oc-hesap-sidebar.

What it provides:

  • Compact quota panel with status badge (OK, MID, LOW, ERR)
  • Manual refresh with cooldown indicator
  • Auto-refresh toggle
  • Accordion account list with one-click account switching
  • Preferences persistence (panel, accounts, auto refresh) via OpenCode KV

Quick setup:

oc-hesap install-plugin

This updates ~/.config/opencode/tui.json automatically. Restart OpenCode after installing the sidebar plugin.


๐Ÿ“ฆ npm Package & Releases

The package is published on npm as opencode-codex-oauth-manager.

Release flow for maintainers:

npm version patch
git push origin master --tags

GitHub Actions publishes tagged releases to npm automatically. The repository must define an Actions secret named NPM_TOKEN with npm publish permissions.

For future AI-assisted maintenance, see AI_CONTEXT.md.


โž• How to Add New Accounts

Adding accounts is 100% automated and friction-free:

  1. Open OpenCode.
  2. Type /connect and select OpenAI.
  3. Log in to your new account.
  4. Run oc-hesap.
  5. Boom! The new account is detected and added to your list automatically.

๐Ÿ—บ๏ธ 2026 Roadmap

Phase 1: Foundations (Completed) โœ…

  • Modular Architecture: Professional code structure for high stability.
  • Cross-Platform Support: Native installers for all OS.
  • Auto-Sync: Automatic detection of new OpenCode logins.
  • Usage Statistics: Tracking account usage counts.
  • i18n Support: Dynamic English/Turkish toggle.
  • Backup System: Export/Import functionality.

Phase 2: Power & Security (In Progress) ๐Ÿ—๏ธ

  • Master Password: AES-256 encryption for stored tokens.
  • Parallel Checks: Refresh all account statuses simultaneously.
  • Manual Management: Add/Remove accounts via CLI directly.

Phase 3: The Future (Coming Soon) ๐ŸŒŸ

  • TUI Dashboard: A fully graphical terminal interface.
  • Desktop Notifications: Alerts when your quota resets.
  • Cloud Sync: Securely sync across multiple devices.

๐Ÿค Acknowledgments & Community

Special thanks to the OpenCode team for building such an incredible ecosystem.

Stay Connected

Follow the journey and get the latest updates on Twitter: ๐Ÿ‘‰ @FitzGPT


๐Ÿ“„ License

Licensed under the MIT License.

About

๐Ÿš€ The ultimate OpenAI account manager for OpenCode power users. Switch Free/Plus/Business/Team/Pro accounts in seconds, track live quotas, and manage your workflow like a pro. Cross-platform & Secure.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages