跳到主要内容
    ↑↓ 选择↵ 打开esc 关闭
    中文English
    zaniluca

    Codex Usage

    v0.0.3代码智能
    opencode-codex-usage-plugin

    OpenCode TUI plugin that shows Codex usage and reset times.

    GitHub 星标

    0

    月装机量

    205

    近 7 天 10

    综合评分SCORE

    33.6

    生态多维模型

    最近提交

    17 天前

    2026-08-02

    快速安装与配置

    opencode.json

    写入当前项目的 opencode.json,只对这个仓库生效。

    opencode.json

    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["opencode-codex-usage-plugin@0.0.3"]
    }

    opencode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。

    Show your Codex usage and reset times directly in the OpenCode sidebar.

    opencode-codex-usage-plugin demo

    This plugin reads Codex usage from Codex App or the Codex CLI and renders the current 5-hour and weekly limits inside OpenCode, so you can keep an eye on quota without leaving the TUI.

    Install

    Use OpenCode's native plugin installer:

    opencode plugin opencode-codex-usage-plugin@latest --global
    

    This installs the plugin and updates your global OpenCode TUI config automatically.

    Alternatively, add the plugin manually to your OpenCode TUI config (~/.config/opencode/tui.json):

    // tui.json
    {
      "$schema": "https://opencode.ai/tui.json",
      "plugin": ["opencode-codex-usage-plugin@latest"]
    }
    

    Restart OpenCode after changing the config.

    [!IMPORTANT] This is a TUI plugin, so configure it in tui.json, not in opencode.json. The plugin field in opencode.json is for server/runtime plugins and will not load this sidebar plugin.

    Requirements

    Install either Codex App or the Codex CLI. The plugin looks for Codex in common locations and on your PATH.

    If your Codex command lives somewhere else, set OPENCODE_CODEX_USAGE_COMMAND in your shell config:

    # ~/.zshrc or ~/.bashrc
    export OPENCODE_CODEX_USAGE_COMMAND="/path/to/codex"
    

    Then reload your shell config or open a new terminal before starting OpenCode.

    Contributing

    Contributions are welcome! Please open an issue or submit a pull request on GitHub. To get started fork the repo, install the dependencies and in your OpenCode TUI config add the local path to the output of the plugin like so:

    // tui.json
    {
      "$schema": "https://opencode.ai/tui.json",
      "plugin": ["file:///Users/<your_username>/path/to/your-clone/opencode-codex-usage-plugin/dist/tui.js"]
    }
    

    The plugin logic is made with Effect. There is no particular reason I chose it, it was simply an excuse to try it out.