"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.
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! ๐)
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.
- 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-BusinessorBackup-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.
- Node.js (v18 or higher)
- Install from npm:
npm install -g opencode-codex-oauth-manager
- Launch: Type
oc-hesapin any terminal. - Optional sidebar plugin:
Restart OpenCode after installing the sidebar plugin.
oc-hesap install-plugin
npm update -g opencode-codex-oauth-managerForget 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 numberNto 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.
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-pluginThis updates ~/.config/opencode/tui.json automatically. Restart OpenCode after installing the sidebar plugin.
The package is published on npm as opencode-codex-oauth-manager.
Release flow for maintainers:
npm version patch
git push origin master --tagsGitHub 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.
Adding accounts is 100% automated and friction-free:
- Open OpenCode.
- Type
/connectand select OpenAI. - Log in to your new account.
- Run
oc-hesap. - Boom! The new account is detected and added to your list automatically.
- 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.
- Master Password: AES-256 encryption for stored tokens.
- Parallel Checks: Refresh all account statuses simultaneously.
- Manual Management: Add/Remove accounts via CLI directly.
- TUI Dashboard: A fully graphical terminal interface.
- Desktop Notifications: Alerts when your quota resets.
- Cloud Sync: Securely sync across multiple devices.
Special thanks to the OpenCode team for building such an incredible ecosystem.
Follow the journey and get the latest updates on Twitter: ๐ @FitzGPT
Licensed under the MIT License.
