Skip to content

Commit ef2cf1c

Browse files
committed
docs: refresh opencodex documentation
1 parent 1d48963 commit ef2cf1c

26 files changed

Lines changed: 586 additions & 136 deletions

README.ko.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,13 @@ codex -m "ollama-cloud/glm-5.2" "Write a SQL migration"
7777
- **OAuth, API 키, 또는 ChatGPT forward.** xAI / Anthropic / Kimi 계정으로 로그인하거나(토큰은
7878
자동 갱신됩니다), `codex login`을 forward 하거나, 키를 붙여넣으세요(`${ENV_VARS}` 지원). 18개 프로바이더의
7979
API 키 카탈로그(**Ollama Cloud** 포함)가 기본 내장되어 있습니다.
80-
- **Codex에 바로 통합.** `$CODEX_HOME/config.toml`(기본값 `~/.codex/config.toml`)에 `[model_providers.opencodex]` 테이블을 주입하고
81-
라우팅된 모델을 Codex의 카탈로그와 서브에이전트 선택기에 병합합니다 — 완전히 되돌릴 수 있습니다.
80+
- **Codex CLI, TUI, App, SDK에 바로 통합.** `$CODEX_HOME/config.toml`(기본값 `~/.codex/config.toml`)에
81+
`[model_providers.opencodex]` 테이블을 주입하고 공유 Codex 모델 카탈로그를 작성하여 라우팅된 모델이
82+
Codex 모델 선택기에 표시되게 합니다.
83+
- **서브에이전트 제어.** `subagentModels` 또는 웹 대시보드에서 최대 5개의 라우팅/네이티브 모델을
84+
Codex `spawn_agent` 선택기에 우선 노출할 수 있습니다.
85+
- **기본은 HTTP/SSE, WebSocket은 opt-in.** 프록시는 Responses WebSocket 엔드포인트를 갖고 있지만,
86+
`"websockets": true`일 때만 `supports_websockets`를 광고합니다.
8287
- **Sidecar.** OpenAI가 아닌 모델에도 ChatGPT 로그인을 통한 `gpt-5.4-mini`를 사용해 실제 **웹 검색**
8388
**이미지 이해** 기능을 제공합니다.
8489
- 프로바이더, OAuth 로그인, 모델 선택, 요청 로그를 위한 **웹 대시보드**.
@@ -111,6 +116,7 @@ ocx login <xai|anthropic|kimi> # OAuth login
111116
ocx logout <provider> # remove a stored login
112117
ocx gui # open the web dashboard
113118
ocx service <install|start|stop|status|uninstall> # run as a background service
119+
ocx update # update opencodex to the latest published version
114120
```
115121

116122
## 설정
@@ -138,15 +144,21 @@ ocx service <install|start|stop|status|uninstall> # run as a background servic
138144
}
139145
```
140146

147+
WebSocket 전송은 기본적으로 꺼져 있습니다. Codex가 HTTP/SSE 대신 Responses WebSocket 경로를 광고하고
148+
사용하게 하려면 `"websockets": true`를 명시하세요.
149+
141150
모든 필드에 대한 자세한 내용은 **[설정 레퍼런스](https://lidge-jun.github.io/opencodex/ko/reference/configuration/)**
142151
를 참고하세요.
143152

144153
## 문서
145154

146-
전체 개발자 문서 — 아키텍처, 모든 adapter, 요청 라이프사이클, sidecar,
147-
Codex 통합, CLI/설정 레퍼런스 — 는 [`docs-site/`](./docs-site) 아래의 Astro 사이트이며
155+
공개 문서 — 설치, 프로바이더, 라우팅, sidecar, Codex 통합, Codex App 모델 선택기,
156+
CLI/설정 레퍼런스 — 는 [`docs-site/`](./docs-site) 아래의 Astro 사이트이며
148157
**[lidge-jun.github.io/opencodex](https://lidge-jun.github.io/opencodex/ko/)**에 게시됩니다.
149158

159+
유지보수용 source of truth는 [`structure/`](./structure)에 있고, 과거 조사/진단 노트는
160+
[`docs/`](./docs)에 남아 있습니다.
161+
150162
## 개발
151163

152164
```bash

README.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,13 @@ codex -m "ollama-cloud/glm-5.2" "Write a SQL migration"
8787
- **OAuth, API key, or ChatGPT forward.** Log in with your xAI / Anthropic / Kimi account (tokens
8888
auto-refresh), forward your `codex login`, or paste a key (`${ENV_VARS}` supported). An 18-provider
8989
API-key catalog (incl. **Ollama Cloud**) is built in.
90-
- **Drops into Codex.** Injects a `[model_providers.opencodex]` table into
91-
`$CODEX_HOME/config.toml` (default `~/.codex/config.toml`) and merges routed models into Codex's
92-
catalog and subagent picker — fully reversible.
90+
- **Drops into Codex CLI, TUI, App, and SDK.** Injects a `[model_providers.opencodex]` table into
91+
`$CODEX_HOME/config.toml` (default `~/.codex/config.toml`) and writes a shared Codex model catalog
92+
so routed models appear in Codex model pickers.
93+
- **Subagent control.** Feature up to five routed or native models in Codex's `spawn_agent` picker
94+
from `subagentModels` or the web dashboard.
95+
- **HTTP/SSE by default, WebSocket opt-in.** The proxy has a Responses WebSocket endpoint, but it
96+
only advertises `supports_websockets` when `"websockets": true` is set.
9397
- **Sidecars.** Give non-OpenAI models real **web search** and **image understanding** via a
9498
`gpt-5.4-mini` over your ChatGPT login.
9599
- **Web dashboard** for providers, OAuth login, model selection, and request logs.
@@ -104,7 +108,7 @@ codex -m "ollama-cloud/glm-5.2" "Write a SQL migration"
104108
| xAI Grok | `openai-chat` | oauth / key |
105109
| Kimi (Moonshot) | `openai-chat` | oauth / key |
106110
| Google Gemini | `google` | key |
107-
| Azure OpenAI | `azure-openai` | key |
111+
| Azure OpenAI | `azure` | key |
108112
| Ollama Cloud + 17-provider catalog | `openai-chat` | key |
109113
| Ollama / vLLM / LM Studio (local) | `openai-chat` | key (usually blank) |
110114
| Any OpenAI-compatible endpoint | `openai-chat` | key |
@@ -150,16 +154,20 @@ Config lives at `~/.opencodex/config.json`. Minimal example:
150154
}
151155
```
152156

157+
WebSocket transport is off by default. Set `"websockets": true` only if you want Codex to advertise
158+
and use the Responses WebSocket path instead of HTTP/SSE.
159+
153160
See the **[Configuration reference](https://lidge-jun.github.io/opencodex/reference/configuration/)**
154161
for every field.
155162

156163
## Documentation
157164

158-
The full developer documentation — architecture, every adapter, the request lifecycle, the sidecars,
159-
Codex integration, and the CLI/config reference — is an Astro site under [`docs-site/`](./docs-site)
160-
and published to **[lidge-jun.github.io/opencodex](https://lidge-jun.github.io/opencodex/)**.
161-
Deep implementation notes live under [`docs/`](./docs), including the Codex App/model catalog path
162-
that makes routed opencodex models appear in the Codex App picker.
165+
The public docs — install, providers, routing, sidecars, Codex integration, Codex App model picker,
166+
and CLI/config reference — are built from [`docs-site/`](./docs-site) and published to
167+
**[lidge-jun.github.io/opencodex](https://lidge-jun.github.io/opencodex/)**.
168+
169+
Maintainer source-of-truth notes live under [`structure/`](./structure). Historical investigations
170+
remain under [`docs/`](./docs).
163171

164172
## Development
165173

README.zh-CN.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,13 @@ codex -m "ollama-cloud/glm-5.2" "Write a SQL migration"
7777
- **OAuth、API key 或 ChatGPT 转发(forward)。** 用你的 xAI / Anthropic / Kimi 账户登录(token
7878
自动刷新)、转发你的 `codex login`,或直接粘贴一个 key(支持 `${ENV_VARS}`)。内置一份 18 家 provider 的
7979
API-key 目录(含 **Ollama Cloud**)。
80-
- **无缝接入 Codex。**`$CODEX_HOME/config.toml`(默认 `~/.codex/config.toml`)注入一个 `[model_providers.opencodex]` 表,并
81-
将已路由的模型合并进 Codex 的目录和 subagent 选择器 —— 完全可逆。
80+
- **无缝接入 Codex CLI、TUI、App 和 SDK。**`$CODEX_HOME/config.toml`(默认 `~/.codex/config.toml`
81+
注入一个 `[model_providers.opencodex]` 表,并写入共享的 Codex 模型目录,让已路由的模型出现在
82+
Codex 模型选择器中。
83+
- **Subagent 控制。** 通过 `subagentModels` 或 Web 仪表盘,将最多 5 个路由或原生模型优先展示在
84+
Codex 的 `spawn_agent` 选择器中。
85+
- **默认 HTTP/SSE,WebSocket 需要显式开启。** 代理有 Responses WebSocket 端点,但只有设置
86+
`"websockets": true` 时才会广告 `supports_websockets`
8287
- **Sidecars。** 通过基于你 ChatGPT 登录的 `gpt-5.4-mini`,为非 OpenAI 模型提供真正的**网页搜索****图像理解**能力。
8388
- **Web 仪表盘**,用于管理 provider、OAuth 登录、模型选择和请求日志。
8489

@@ -110,6 +115,7 @@ ocx login <xai|anthropic|kimi> # OAuth login
110115
ocx logout <provider> # remove a stored login
111116
ocx gui # open the web dashboard
112117
ocx service <install|start|stop|status|uninstall> # run as a background service
118+
ocx update # update opencodex to the latest published version
113119
```
114120

115121
## 配置
@@ -137,14 +143,19 @@ ocx service <install|start|stop|status|uninstall> # run as a background servic
137143
}
138144
```
139145

146+
WebSocket 传输默认关闭。只有当你希望 Codex 广告并使用 Responses WebSocket 路径而不是 HTTP/SSE 时,
147+
才需要设置 `"websockets": true`
148+
140149
每个字段的说明请参阅 **[配置参考](https://lidge-jun.github.io/opencodex/zh-cn/reference/configuration/)**
141150

142151
## 文档
143152

144-
完整的开发者文档 —— 架构、每个 adapter、请求生命周期、sidecars、
145-
Codex 集成,以及 CLI/配置参考 —— 是位于 [`docs-site/`](./docs-site) 下的一个 Astro 站点,
153+
公开文档 —— 安装、providers、路由、sidecars、Codex 集成、Codex App 模型选择器,
154+
以及 CLI/配置参考 —— 是位于 [`docs-site/`](./docs-site) 下的一个 Astro 站点,
146155
并发布于 **[lidge-jun.github.io/opencodex](https://lidge-jun.github.io/opencodex/zh-cn/)**
147156

157+
维护者 source of truth 位于 [`structure/`](./structure),历史调查/诊断笔记保留在 [`docs/`](./docs)
158+
148159
## 开发
149160

150161
```bash

docs-site/astro.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ export default defineConfig({
5050
{ label: "Providers", translations: { ko: "프로바이더", "zh-CN": "提供商" }, slug: "guides/providers" },
5151
{ label: "Model Routing", translations: { ko: "모델 라우팅", "zh-CN": "模型路由" }, slug: "guides/model-routing" },
5252
{ label: "Codex Integration", translations: { ko: "Codex 통합", "zh-CN": "Codex 集成" }, slug: "guides/codex-integration" },
53+
{ label: "Codex App Model Picker", translations: { ko: "Codex App 모델 선택기", "zh-CN": "Codex App 模型选择器" }, slug: "guides/codex-app-models" },
5354
{ label: "Sidecars: Web Search & Vision", translations: { ko: "사이드카: 웹 검색 & 비전", "zh-CN": "边车:网络搜索与视觉" }, slug: "guides/sidecars" },
5455
{ label: "Web Dashboard", translations: { ko: "웹 대시보드", "zh-CN": "网页控制台" }, slug: "guides/web-dashboard" },
5556
],

docs-site/src/content/docs/contributing.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,28 @@ The docs site you're reading lives in `docs-site/` (Astro + Starlight):
2525
cd docs-site && bun install && bun dev
2626
```
2727

28+
## Docs publishing
29+
30+
The public docs publish to GitHub Pages at <https://lidge-jun.github.io/opencodex/>. The
31+
`.github/workflows/deploy-docs.yml` workflow runs on `main` pushes that touch `docs-site/**` or the
32+
workflow itself, builds `docs-site`, and deploys the generated site. Before pushing docs changes,
33+
run:
34+
35+
```bash
36+
cd docs-site
37+
bun install --frozen-lockfile
38+
bun run build
39+
```
40+
2841
## Conventions
2942

3043
- **ES Modules only** (`import`/`export`), TypeScript, `strict` mode. Keep `bun x tsc --noEmit` clean.
3144
- **~500 lines per file max** — split by responsibility (the `web-search/` and `vision/` sidecars are
3245
good examples of small, focused modules behind a single `index.ts`).
3346
- **Handle async errors at boundaries** — sidecars never throw into the request path; they degrade to
3447
a graceful marker.
35-
- **Devlog**design notes live in `devlog/NN_slug/` with decade-range numbering (`00–09` research,
36-
`10–19` phase 1, …). New work gets the next decade.
48+
- **Structure SOT**current maintainer invariants live in `structure/`. Keep public user workflows
49+
in `docs-site/` and historical investigation notes in `docs/`.
3750
- **Preserve exports** — other modules may depend on them.
3851

3952
## Adding a provider to the catalog

docs-site/src/content/docs/guides/codex-app-models.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ wire_api = "responses"
3636
requires_openai_auth = true
3737
```
3838

39+
`websockets` is off by default. opencodex only advertises `supports_websockets = true` in the
40+
provider table and catalog entries when `"websockets": true` is set.
41+
3942
## Why routed models show up
4043

4144
Codex's model picker expects Codex-shaped catalog entries. opencodex builds those entries by cloning
@@ -71,6 +74,12 @@ opencodex preserves that split. Native OpenAI passthrough models keep fast suppo
7174
non-OpenAI models strip service-tier metadata so the fast option is not advertised where it cannot
7275
be honored.
7376

77+
## Subagent selection
78+
79+
Codex's `spawn_agent` advertises the highest-priority first 5 catalog models. Pick up to five
80+
`provider/model` or native ids through `subagentModels` or the web dashboard; opencodex sorts those
81+
entries to the front of the shared catalog.
82+
7483
## Refreshing model state
7584

7685
If the picker still shows stale entries, refresh the catalog and restart the target Codex surface:

docs-site/src/content/docs/guides/codex-integration.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,15 @@ idempotent and reversible.
1414
```toml
1515
# at the document root — Codex reads this as the active provider
1616
model_provider = "opencodex"
17+
model_catalog_json = "/absolute/path/to/opencodex-catalog.json"
1718

1819
# appended at end of file (TOML tables are position-independent)
1920
[model_providers.opencodex]
2021
name = "OpenCodex Proxy"
2122
base_url = "http://localhost:10100/v1"
2223
wire_api = "responses"
24+
requires_openai_auth = true
25+
# supports_websockets = true # only when config.websockets is true
2326
```
2427

2528
It also writes an optional profile at `$CODEX_HOME/opencodex.config.toml` so you can opt in explicitly:
@@ -34,6 +37,22 @@ part of a table and ignores it. The injector guarantees this placement and strip
3437
duplicate copies before re-writing — so re-running `ocx init` / `ocx sync` never produces duplicates.
3538
:::
3639

40+
## Shared model catalog
41+
42+
Codex CLI, TUI, App, and SDK all read the same Codex home. opencodex resolves that directory from
43+
`CODEX_HOME`, falling back to `~/.codex`, and manages:
44+
45+
```text
46+
$CODEX_HOME/config.toml
47+
$CODEX_HOME/opencodex.config.toml
48+
$CODEX_HOME/opencodex-catalog.json
49+
$CODEX_HOME/models_cache.json
50+
```
51+
52+
`requires_openai_auth = true` keeps Codex App/TUI account-gated surfaces aligned with native Codex.
53+
WebSocket transport is different: opencodex serves `/v1/responses` over WebSocket, but only advertises
54+
`supports_websockets = true` when `"websockets": true` is set in `~/.opencodex/config.json`.
55+
3756
## Model catalog sync
3857

3958
Codex shows models from an on-disk catalog (`$CODEX_HOME/opencodex-catalog.json` by default). On

docs-site/src/content/docs/index.mdx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,14 @@ Codex CLI / App / SDK ──/v1/responses──▶ opencodex ──▶ Any provi
4545
</Card>
4646
<Card title="Drops into Codex" icon="rocket">
4747
`ocx init` injects a provider into `$CODEX_HOME/config.toml` (default
48-
`~/.codex/config.toml`) and merges routed models into Codex's catalog and subagent picker.
48+
`~/.codex/config.toml`) and writes a shared Codex catalog, so Codex CLI, TUI, App, and SDK
49+
all see the same routed models and subagent picks.
4950
`ocx stop` restores native Codex cleanly.
5051
</Card>
52+
<Card title="Subagents and transports" icon="puzzle">
53+
Pin up to five routed or native models for Codex `spawn_agent`. HTTP/SSE stays the default;
54+
Responses WebSocket support is advertised only when `websockets: true`.
55+
</Card>
5156
<Card title="Sidecars" icon="magnifier">
5257
Give non-OpenAI models real **web search** and **image understanding** by routing those
5358
capabilities through a `gpt-5.4-mini` sidecar over your ChatGPT login.
@@ -58,7 +63,7 @@ Codex CLI / App / SDK ──/v1/responses──▶ opencodex ──▶ Any provi
5863

5964
```bash
6065
# Install
61-
bun install -g opencx # or: npm install -g opencx
66+
bun install -g @bitkyc08/opencodex # or: npm install -g @bitkyc08/opencodex
6267

6368
# Interactive setup (writes config + injects into Codex)
6469
ocx init
@@ -76,5 +81,7 @@ codex "Write a hello world in Rust"
7681
<LinkCard title="Installation" href="/opencodex/getting-started/installation/" description="Install ocx, prerequisites, and verification." />
7782
<LinkCard title="How It Works" href="/opencodex/getting-started/how-it-works/" description="The full request lifecycle: parse → route → adapter → bridge → SSE." />
7883
<LinkCard title="Providers" href="/opencodex/guides/providers/" description="OAuth, API-key catalog, forward/passthrough, and the full provider table." />
84+
<LinkCard title="Codex App Model Picker" href="/opencodex/guides/codex-app-models/" description="How routed opencodex models show up in Codex App through the shared catalog." />
85+
<LinkCard title="Web Dashboard" href="/opencodex/guides/web-dashboard/" description="Manage providers, OAuth, model visibility, subagents, and logs." />
7986
<LinkCard title="CLI Reference" href="/opencodex/reference/cli/" description="Every ocx command and flag." />
8087
</CardGrid>

docs-site/src/content/docs/ko/contributing.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,19 @@ cd gui && bun install && bun dev
2525
cd docs-site && bun install && bun dev
2626
```
2727

28+
## 문서 배포
29+
30+
공개 문서는 GitHub Pages의 <https://lidge-jun.github.io/opencodex/ko/>에 게시됩니다.
31+
`.github/workflows/deploy-docs.yml` 워크플로는 `main` 브랜치에서 `docs-site/**` 또는 워크플로
32+
자체가 바뀔 때 실행되며, `docs-site`를 빌드한 뒤 배포합니다. 문서 변경을 푸시하기 전에 다음을
33+
실행하세요:
34+
35+
```bash
36+
cd docs-site
37+
bun install --frozen-lockfile
38+
bun run build
39+
```
40+
2841
## 컨벤션
2942

3043
- **ES Modules 전용**(`import`/`export`), TypeScript, `strict` 모드. `bun x tsc --noEmit`을 깨끗하게
@@ -33,8 +46,8 @@ cd docs-site && bun install && bun dev
3346
`index.ts` 뒤에 작고 집중된 모듈을 둔 좋은 예입니다).
3447
- **비동기 에러는 경계에서 처리** — 사이드카는 요청 경로로 절대 throw하지 않으며, 우아한 마커로
3548
성능을 낮춥니다.
36-
- **Devlog**설계 노트는 10단위 범위 번호를 사용해 `devlog/NN_slug/`에 둡니다(`00–09` 리서치,
37-
`10–19` 1단계, …). 새 작업은 다음 10단위를 받습니다.
49+
- **Structure SOT**현재 유지보수 불변식은 `structure/`에 둡니다. 공개 사용자 워크플로는
50+
`docs-site/`, 과거 조사/진단 노트는 `docs/`에 둡니다.
3851
- **익스포트 보존** — 다른 모듈이 이에 의존할 수 있습니다.
3952

4053
## 카탈로그에 프로바이더 추가하기

0 commit comments

Comments
 (0)