|
| 1 | +# Plan — opencodex developer docs site (Astro Starlight) + README + GitHub Pages |
| 2 | + |
| 3 | +**Goal:** A jawcode-grade, very detailed developer-documentation site for opencodex, built as an |
| 4 | +**Astro + Starlight** static site, deployed to **GitHub Pages**, plus a rewritten accurate README. |
| 5 | +Push to a new public GitHub repo `lidge-jun/opencodex` (no remote exists yet; gh authed as lidge-jun). |
| 6 | + |
| 7 | +## Part 1 — Plain explanation |
| 8 | +opencodex currently has only a 151-line README (partly stale). We add a full documentation website — |
| 9 | +like the jawcode docs site, but built with Astro Starlight (the standard Astro docs framework, static, |
| 10 | +free on GitHub Pages). It explains every part of the proxy: install, how it routes Codex to any LLM, |
| 11 | +every provider/adapter, the config + CLI reference, Codex injection, and the web-search/vision |
| 12 | +sidecars. We also rewrite the README to be accurate and link to the site, and add a GitHub Actions |
| 13 | +workflow that builds and publishes the site to GitHub Pages on every push to main. |
| 14 | + |
| 15 | +## Tech decision |
| 16 | +- **Astro + Starlight** (`@astrojs/starlight`): the user asked for an Astro static page; Starlight is |
| 17 | + the official Astro docs theme — content in MD/MDX, built-in sidebar/search/dark-mode, GH-Pages ready. |
| 18 | +- Lives in a new top-level `docs-site/` dir (mirrors jawcode's `docs-site/`; isolated from the `src/` |
| 19 | + proxy package so `bun run build`/publish of the proxy is unaffected). Matches existing repo |
| 20 | + convention of decade-numbered `devlog/NN_*` (this plan = `devlog/60_docs-site/`). |
| 21 | + |
| 22 | +## File change map |
| 23 | + |
| 24 | +### NEW — Astro Starlight site under `docs-site/` |
| 25 | +| Path | Purpose | |
| 26 | +|------|---------| |
| 27 | +| `docs-site/package.json` | astro + @astrojs/starlight + sharp; scripts dev/build/preview | |
| 28 | +| `docs-site/astro.config.mjs` | Starlight config: title, `site`/`base` for GH Pages (`/opencodex`), sidebar nav, social links, edit-link | |
| 29 | +| `docs-site/tsconfig.json` | extends astro/tsconfigs/strict | |
| 30 | +| `docs-site/.gitignore` | dist/, node_modules/, .astro/ | |
| 31 | +| `docs-site/src/content.config.ts` | Starlight docs loader/collection | |
| 32 | +| `docs-site/src/content/docs/index.mdx` | Landing: hero, "what is opencodex", the Codex↔provider diagram, quick links | |
| 33 | +| `docs-site/src/content/docs/getting-started/installation.mdx` | Install (bun/npm), prerequisites, verify | |
| 34 | +| `docs-site/src/content/docs/getting-started/quickstart.mdx` | `ocx init` → `ocx start` → use Codex; first provider | |
| 35 | +| `docs-site/src/content/docs/getting-started/how-it-works.mdx` | Request lifecycle: Responses→parse→route→adapter→bridge→SSE (diagram) | |
| 36 | +| `docs-site/src/content/docs/guides/providers.mdx` | OAuth (xai/anthropic/kimi), API-key catalog (incl. Ollama Cloud), forward/passthrough, full table | |
| 37 | +| `docs-site/src/content/docs/guides/model-routing.mdx` | The 5-step routing precedence, `provider/model` syntax, prefix patterns | |
| 38 | +| `docs-site/src/content/docs/guides/codex-integration.mdx` | config.toml injection, model catalog sync, subagent picker (≤5 routed), restore/eject | |
| 39 | +| `docs-site/src/content/docs/guides/sidecars.mdx` | Web-search sidecar + vision sidecar: why, how, config, the gpt-mini path | |
| 40 | +| `docs-site/src/content/docs/guides/web-dashboard.mdx` | GUI: status, provider mgmt, request log, add-provider flow | |
| 41 | +| `docs-site/src/content/docs/reference/cli.mdx` | Every `ocx` command + flags (init/start/stop/restore/sync/status/login/logout/gui/service) | |
| 42 | +| `docs-site/src/content/docs/reference/configuration.mdx` | Full OcxConfig + OcxProviderConfig + sidecar config field reference (tables) | |
| 43 | +| `docs-site/src/content/docs/reference/adapters.mdx` | Each adapter (openai-chat, openai-responses, anthropic, google, azure, image utils) + quirks | |
| 44 | +| `docs-site/src/content/docs/reference/architecture.mdx` | Module map, AdapterEvent/bridge event table, parser, cache, types | |
| 45 | +| `docs-site/src/content/docs/contributing.mdx` | Dev setup, project layout, conventions (ESM, 500-line, devlog), tsc gate | |
| 46 | +| `docs-site/public/favicon.svg` | Simple favicon | |
| 47 | + |
| 48 | +### NEW — CI |
| 49 | +| Path | Purpose | |
| 50 | +|------|---------| |
| 51 | +| `.github/workflows/deploy-docs.yml` | Build Starlight (bun) + deploy to GitHub Pages via actions/deploy-pages | |
| 52 | + |
| 53 | +### MODIFY |
| 54 | +| Path | Change | |
| 55 | +|------|--------| |
| 56 | +| `README.md` | Rewrite: accurate provider/adapter tables, OAuth + Ollama Cloud, sidecars, subagent picker, docs-site link/badge, correct `src/adapters/azure.ts` (already correct), full CLI list | |
| 57 | + |
| 58 | +## Accuracy anchors (verified against code this session) |
| 59 | +- Adapters dir: `anthropic.ts, azure.ts, base.ts, google.ts, image.ts, openai-chat.ts, openai-responses.ts`. |
| 60 | +- CLI cmds: init, start, stop, restore/eject, sync, status, login, logout, gui, service{install|start|stop|status|uninstall}. |
| 61 | +- Routing precedence: `provider/model` → provider.defaultModel → provider.models[] → prefix patterns (claude-/gpt-/o1-/o3-/o4-/llama-/…) → defaultProvider. |
| 62 | +- Config path `~/.opencodex/config.json`; default provider = openai forward (ChatGPT passthrough). |
| 63 | +- Sidecars: web-search (gpt-5.4-mini real web_search via forward) + vision (describe images for noVisionModels). |
| 64 | + |
| 65 | +## GitHub Pages deploy |
| 66 | +- `astro.config.mjs`: `site: "https://lidge-jun.github.io"`, `base: "/opencodex"`. |
| 67 | +- Repo: create public `lidge-jun/opencodex`, push `main`. Enable Pages (source = GitHub Actions). |
| 68 | +- Workflow triggers on push to main affecting `docs-site/**`; builds with bun; publishes `docs-site/dist`. |
| 69 | + |
| 70 | +## Phases (compact PABCD, push is pre-authorized; multiple rounds OK) |
| 71 | +- **B1**: scaffold + all pages + README + workflow. **C**: `bun install` + `astro build` (must pass) + `tsc` of main unaffected. **D**: create repo, push, enable Pages, verify Actions run + live URL. |
0 commit comments