Skip to content

Commit 102f8c6

Browse files
lidge-junclaude
andcommitted
docs(site): Astro Starlight developer documentation site
jawcode-grade developer docs under docs-site/ (Astro 6 + Starlight 0.40), 15 pages: - Getting Started: installation, quickstart, how-it-works (request lifecycle) - Guides: providers, model-routing, codex-integration, sidecars, web-dashboard - Reference: cli, configuration, adapters, architecture (AdapterEvent→SSE bridge) - Contributing Content verified against source via two code-mapping passes + a read-only plan audit (AUDIT: PASS). Configured for GitHub Pages (site + base=/opencodex); build is green, internal links resolve correctly. Plan in devlog/60_docs-site/00_plan.md. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent b333e83 commit 102f8c6

22 files changed

Lines changed: 2228 additions & 0 deletions

devlog/60_docs-site/00_plan.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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.

docs-site/.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# build output
2+
dist/
3+
# generated types
4+
.astro/
5+
# dependencies
6+
node_modules/
7+
# logs
8+
npm-debug.log*
9+
yarn-debug.log*
10+
yarn-error.log*
11+
pnpm-debug.log*
12+
# environment variables
13+
.env
14+
.env.production
15+
# macOS
16+
.DS_Store

docs-site/astro.config.mjs

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// @ts-check
2+
import { defineConfig } from "astro/config";
3+
import starlight from "@astrojs/starlight";
4+
5+
// Project GitHub Pages site: https://lidge-jun.github.io/opencodex
6+
// `site` + `base` make Starlight emit correct absolute URLs and asset paths under the repo subpath.
7+
export default defineConfig({
8+
site: "https://lidge-jun.github.io",
9+
base: "/opencodex",
10+
integrations: [
11+
starlight({
12+
title: "opencodex",
13+
description:
14+
"Universal provider proxy for OpenAI Codex — use any LLM with Codex CLI, App, and SDK.",
15+
tagline: "Use any LLM with OpenAI Codex.",
16+
favicon: "/favicon.svg",
17+
social: [
18+
{ icon: "github", label: "GitHub", href: "https://github.com/lidge-jun/opencodex" },
19+
],
20+
editLink: {
21+
baseUrl: "https://github.com/lidge-jun/opencodex/edit/main/docs-site/",
22+
},
23+
lastUpdated: true,
24+
sidebar: [
25+
{
26+
label: "Getting Started",
27+
items: [
28+
{ label: "Installation", slug: "getting-started/installation" },
29+
{ label: "Quickstart", slug: "getting-started/quickstart" },
30+
{ label: "How It Works", slug: "getting-started/how-it-works" },
31+
],
32+
},
33+
{
34+
label: "Guides",
35+
items: [
36+
{ label: "Providers", slug: "guides/providers" },
37+
{ label: "Model Routing", slug: "guides/model-routing" },
38+
{ label: "Codex Integration", slug: "guides/codex-integration" },
39+
{ label: "Sidecars: Web Search & Vision", slug: "guides/sidecars" },
40+
{ label: "Web Dashboard", slug: "guides/web-dashboard" },
41+
],
42+
},
43+
{
44+
label: "Reference",
45+
items: [
46+
{ label: "CLI", slug: "reference/cli" },
47+
{ label: "Configuration", slug: "reference/configuration" },
48+
{ label: "Adapters", slug: "reference/adapters" },
49+
{ label: "Architecture", slug: "reference/architecture" },
50+
],
51+
},
52+
{ label: "Contributing", slug: "contributing" },
53+
],
54+
}),
55+
],
56+
});

0 commit comments

Comments
 (0)