# @ternetin/opencode-codex-multiplexer

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

Latest version **0.1.4** (published 2026-08-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install @ternetin/opencode-codex-multiplexer
pnpm add @ternetin/opencode-codex-multiplexer
yarn add @ternetin/opencode-codex-multiplexer
bun add @ternetin/opencode-codex-multiplexer
```

## Health

**Score 60/100 (C)** — status: active.

Positive: esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2026-08-04 |
| First published | 2026-06-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Dependencies | 4 |
| Unpacked size | 42.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | minot0r |
| Keywords | opencode, opencode-plugin, codex, openai, tui |

## Links

- npm: https://www.npmjs.com/package/@ternetin/opencode-codex-multiplexer
- Repository: https://github.com/ter-net-in/codexmx
- Homepage: https://github.com/ter-net-in/codexmx#readme
- Issues: https://github.com/ter-net-in/codexmx/issues
- npm.io page: https://npm.io/package/@ternetin/opencode-codex-multiplexer

## Dependencies (4)

- [solid-js](https://npm.io/package/solid-js.md) 1.9.12
- [@opentui/core](https://npm.io/package/@opentui/core.md) ^0.2.11
- [@opentui/solid](https://npm.io/package/@opentui/solid.md) ^0.2.11
- [@opencode-ai/plugin](https://npm.io/package/@opencode-ai/plugin.md) ^1.15.4

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [jwt-simple](https://npm.io/package/jwt-simple.md) — 259.5K weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads

## Recent versions

- 0.1.4 (latest) — 2026-08-04
- 0.1.3 — 2026-06-30
- 0.1.2 — 2026-06-30
- 0.1.1 — 2026-06-30
- 0.1.0 — 2026-06-30

## README

# @ternetin/opencode-codex-multiplexer

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

![OpenCode Codex usage sidebar](assets/opencode-session.png)

## Install

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

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

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

```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:

```json
{
  "plugin": ["/absolute/path/to/codexmx/src/tui.tsx"]
}
```

```json
{
  "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:

```txt
$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:

```txt
$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.

---
_Source: https://npm.io/package/@ternetin/opencode-codex-multiplexer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
