跳到主要内容
    ↑↓ 选择↵ 打开esc 关闭
    中文English
    ter-net-in

    Codex Multiplexer

    v0.1.4认证与凭证
    @ternetin/opencode-codex-multiplexer

    OpenCode TUI plugin for Codex auth profile switching and usage windows.

    GitHub 星标

    0

    月装机量

    206

    近 7 天 21

    综合评分SCORE

    33.7

    生态多维模型

    最近提交

    16 天前

    2026-08-04

    快速安装与配置

    opencode.json

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

    opencode.json

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

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

    OpenCode TUI plugin for switching saved Codex/OpenAI auth profiles and showing Codex usage windows.

    OpenCode Codex usage sidebar

    Install

    Add the TUI plugin to ~/.config/opencode/tui.json:

    {
      "plugin": ["@ternetin/opencode-codex-multiplexer"]
    }
    

    Optional hot-switch hook in ~/.config/opencode/opencode.json:

    {
      "plugin": ["@ternetin/opencode-codex-multiplexer/server"]
    }
    

    Restart OpenCode after changing plugin config.

    OpenCode installs npm plugins from config automatically. You do not need to run bun add unless you want to test or use the package from another JavaScript project.

    For a local unpublished checkout, replace /absolute/path/to/codexmx with the checkout's absolute path:

    {
      "plugin": ["/absolute/path/to/codexmx/src/tui.tsx"]
    }
    
    {
      "plugin": ["/absolute/path/to/codexmx/dist/server.js"]
    }
    

    Commands

    • codexmx:save saves current auth.json and, when present, account.json into a named Codex profile.
    • codexmx:switch switches current live Codex auth to a saved profile.
    • codexmx:show shows redacted debug info about live and selected auth.

    Slash commands:

    • /codexmx-save
    • /codexmx-switch or /codexmx
    • /codexmx-show

    Storage

    Profiles are stored under:

    $OPENCODE_DATA_DIR/codexmx/profiles/
    

    Default OPENCODE_DATA_DIR is ~/.local/share/opencode.

    Profile files:

    • <name>.auth.json
    • <name>.account.json

    The selected profile name is stored at:

    $OPENCODE_DATA_DIR/codexmx/.current
    

    Files are written with 0600 permissions.

    Hot Switch

    The TUI switch copies the selected profile into the live auth.json and, when available, account.json, then updates .current. Usage API data refreshes without restart.

    Model request hot-switch is best effort through the server plugin. It injects the selected profile bearer token in chat.headers for OpenAI/Codex-like providers. This affects new requests only. If OpenCode/provider code overwrites headers after plugin hooks, restart remains required.