Clarity for every line.
Modern flat minimalist AI-powered IDE on Cloudflare Workers, with Workers AI, GitHub OAuth, and a VS Code–like editor.
Live example: https://lumen.backendku.workers.dev/
- Added VS Code-like save workflow: local Save, split-screen Diff, and commit only saved changes.
- Added multi-file commit support with AI-generated commit messages.
- Added repository search by name, full name, or description.
- Added a dedicated Reviews sidebar tab beside Refresh.
- Added public webapp reviews with 1–5 star ratings and comments for anonymous and GitHub users.
- Added review editing with ownership checks and a pencil button for the review owner.
- Added Cloudflare KV persistence through the
REVIEWSbinding.
| Area | Detail |
|---|---|
| Streaming AI | SSE from Workers AI (@cf/qwen/qwen2.5-coder-32b-instruct) — review, fix, create, chat |
| Editor | Monaco (VS Code engine), multi-tab, dirty indicator, apply AI output |
| GitHub | OAuth Connect GitHub, or manual PAT; list repos, file tree, open/edit, commit |
| GitHub App | Optional JWT (RS256) + installation token for server-side auth |
| Git workflow | Save locally, compare with split-screen diff, commit saved changes, AI commit messages |
| Repository search | Search repositories by name, full name, or description |
| Reviews | Separate review tab with star ratings, comments, anonymous/GitHub authors, and owner editing |
| UI | Dark/light theme, collapsible sidebar & AI panel, mobile drawers |
| Dialogs | Custom alert / confirm / prompt + custom select (no native browser dialogs) |
| Icons | Font Awesome 6 + Lumen SVG mark |
| Commit identity | Commits attributed to Lumen (lumen@users.noreply.github.com) |
| Name | Lumen |
| Tagline | Clarity for every line |
| Logo | public/assets/logo.svg + favicon.svg |
| Tone | Calm, precise, developer-first |
ai-ide/
├── public/
│ ├── index.html # Shell UI
│ ├── css/styles.css # Themes + layout
│ ├── js/app.js # Frontend (Monaco, auth, AI stream)
│ └── assets/ # logo.svg, favicon.svg
├── src/index.ts # Cloudflare Worker (API + assets)
├── wrangler.toml
├── package.json
└── tsconfig.json
cd ai-ide
npm install
npm run dev # wrangler dev --remote (required for Workers AI)Open the URL printed by Wrangler (usually http://127.0.0.1:8787).
npm run deploy
# or: npx wrangler deployWorker name: lumen
Assets: ./public via [assets] binding.
Verify deploy:
curl https://<your-worker>.workers.dev/api/version- Create a GitHub OAuth App or enable OAuth on a GitHub App.
- Set:
| Field | Value |
|---|---|
| Homepage URL | https://<your-worker>.workers.dev/ |
| Authorization callback URL | https://<your-worker>.workers.dev/api/auth/github/callback |
- Scopes:
repo,read:user - Secrets:
npx wrangler secret put GITHUB_CLIENT_ID
npx wrangler secret put GITHUB_CLIENT_SECRET- Redeploy, then use Connect GitHub in the UI.
- UI → Token → paste PAT with
reposcope - Stored only in browser
localStorage - Sent as
X-GitHub-Tokenon API calls
Optional fallback when no user token is present:
npx wrangler secret put GITHUB_APP_ID
npx wrangler secret put GITHUB_PRIVATE_KEY # full PEM
npx wrangler secret put GITHUB_INSTALLATION_IDToken priority: X-GitHub-Token header → GITHUB_TOKEN secret → App installation token.
| Method | Path | Description |
|---|---|---|
GET |
/api/version |
Build version + feature flags |
GET |
/api/auth/github |
Start OAuth (redirect to GitHub) |
GET |
/api/auth/github/callback |
OAuth callback |
GET |
/api/auth/me |
Current GitHub user |
GET |
/api/auth/status |
Whether OAuth secrets are configured |
POST |
/api/ai |
AI actions (review | fix | create | chat), supports stream: true |
GET |
/api/repos |
List user repositories |
GET |
/api/tree/:owner/:repo |
Directory listing (?path=&branch=) |
GET |
/api/file/:owner/:repo/* |
File content |
POST |
/api/commit |
Create/update file (commit) |
POST |
/api/create-repo |
Create repository |
GET |
/api/reviews |
List reviews and rating summary |
POST |
/api/reviews |
Create an anonymous or GitHub-authenticated review |
PUT |
/api/reviews/:id |
Edit an owned review |
GitHub routes accept header:
X-GitHub-Token: <token>Panel modes:
- Chat — general coding help
- Review Code — critique current file / selection
- Fix / Edit — return fixed code in a fenced block
- Create Code — generate new code
Streaming uses Server-Sent Events (text/event-stream).
Apply to editor pastes the first code block into the active tab.
Workers AI needs
wrangler dev --remoteor a deployed Worker (no local GPU).
| Secret | Purpose |
|---|---|
GITHUB_CLIENT_ID |
OAuth login |
GITHUB_CLIENT_SECRET |
OAuth login |
GITHUB_TOKEN |
Optional server PAT fallback |
GITHUB_APP_ID |
GitHub App JWT |
GITHUB_PRIVATE_KEY |
GitHub App private key (PEM) |
GITHUB_INSTALLATION_ID |
Installation for app token |
Bindings (wrangler.toml):
AI— Workers AIASSETS— static files from./publicREVIEWS— Cloudflare KV namespace for webapp reviewsSESSIONS— session KV namespaceUSAGE— neuron usage and quota KV namespace
npm run dev # local + remote AI
npm run deploy # production
npm run cf-typegen # generate Env types (optional)MIT