Skip to content

Tanwyhang/opencode-codexbar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

opencode-codexbar

OpenCode Codex quota sidebar powered by codexbar. opencode-codexbar adds a small animated CODEX widget to the OpenCode TUI sidebar so you can see Codex usage, Codex quota, session limits, weekly limits, plan details, and reset timers while you code.

This is for people searching for an OpenCode Codex sidebar, OpenCode Codex quota plugin, Codex usage bar for OpenCode, ChatGPT Codex limits in OpenCode, or a codexbar OpenCode TUI integration.

What You Get

  • A fancy CODEX status block inside the OpenCode terminal UI sidebar.
  • Session quota in orange/gold and weekly quota in cyan.
  • Animated glyph chains that update without freezing OpenCode.
  • Last-read time, pace, reset timer, plan, and account details when codexbar --status provides them.
  • Safe architecture: the OpenCode TUI plugin never spawns a process and never runs shell commands.
  • Automatic macOS background updates through a user LaunchAgent, with a background-process fallback elsewhere.
  • Friendly install path even if you do not have codexbar yet.

Quick Install

curl -fsSL https://raw.githubusercontent.com/Tanwyhang/opencode-codexbar/main/install.sh | bash

Then restart OpenCode.

If ~/.local/bin is not on your PATH, the installer prints the exact line to add to your shell profile.

No Codexbar Yet?

You can install opencode-codexbar before installing codexbar.

The sidebar will still load. It will show an Install codexbar message instead of live quota data. Later, when codexbar --status works in your terminal, run:

opencode-codexbar restart

That is it. You do not need to reinstall this plugin.

Requirements

  • OpenCode installed and working.
  • codexbar is optional for install, but required for live Codex quota data.
  • The installer may use npm or bun to install two small OpenCode TUI UI dependencies if they are not already available: solid-js and @opentui/solid.

Commands

opencode-codexbar install   # register the sidebar and enable background updates
opencode-codexbar start     # start or re-enable background status updates
opencode-codexbar stop      # stop background status updates
opencode-codexbar restart   # restart background status updates
opencode-codexbar once      # refresh the cache one time
opencode-codexbar status    # show writer/cache status
opencode-codexbar doctor    # debug your setup

How It Works

opencode-codexbar has two parts.

The OpenCode TUI plugin reads this JSON cache file:

~/.cache/opencode-codexbar-status.json

The external writer updates that cache by running:

codexbar --status

The important safety detail: OpenCode only reads the cache. The TUI plugin does not call codexbar, does not spawn child processes, and does not execute shell commands.

On macOS, opencode-codexbar start installs a user LaunchAgent so updates start again after login. On other systems, it starts the same writer as a normal background process.

Files Installed

~/.config/opencode/plugin/codexbar-sidebar.tsx
~/.config/opencode/opencode-codexbar/bin/codexbar-status-writer
~/.local/bin/opencode-codexbar
~/Library/LaunchAgents/com.tanwyhang.opencode-codexbar.plist  # macOS only
~/.cache/opencode-codexbar-status.json
~/.cache/opencode-codexbar-status-writer.pid
~/.cache/opencode-codexbar-status-writer.log

The installer also adds this plugin entry to ~/.config/opencode/tui.json:

"plugin": ["./plugin/codexbar-sidebar.tsx"]

It creates a timestamped backup before editing an existing tui.json.

Troubleshooting

Run:

opencode-codexbar doctor

If the sidebar does not appear, restart OpenCode completely. OpenCode loads TUI plugins at startup.

If the sidebar says Install codexbar, install codexbar from its upstream project, confirm this works, then restart the writer:

codexbar --status
opencode-codexbar restart

If the sidebar says stale, the background writer stopped or cannot update the cache:

opencode-codexbar restart
opencode-codexbar status

Manual Install

Clone the repo and run the installer locally:

git clone https://github.com/Tanwyhang/opencode-codexbar.git
cd opencode-codexbar
./install.sh

Then restart OpenCode.

Uninstall

Stop the writer:

opencode-codexbar stop

Then remove the plugin entry from ~/.config/opencode/tui.json and delete the installed files listed above. On macOS, stop also unloads the LaunchAgent.

Safety Notes

  • No OpenCode session storage changes.
  • No OpenCode provider or model changes.
  • No OpenCode tool permission changes.
  • The sidebar plugin is read-only and cache-only.
  • The external writer is the only part that runs codexbar --status.

SEO Keywords

OpenCode Codex quota sidebar, OpenCode Codex usage plugin, OpenCode TUI plugin for Codex, codexbar OpenCode integration, ChatGPT Codex usage limits, Codex session quota, Codex weekly quota, OpenCode sidebar status widget, Codex quota terminal UI.

About

OpenCode Codex quota sidebar powered by codexbar: safe TUI plugin for Codex usage, session limits, weekly quota, reset timers, and plan status.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors