Skip to content
nothansPublic

About

An in-browser coding workspace: prompt a model, review its changes as a diff, and run Python, JavaScript and HTML in your browser.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

Cue

Cue is an in-browser coding workspace where you give the cue and a model writes the code. Each piece of work lives on a card: a conversation, one code file, and a spec that says what the code should do. The model proposes changes as a diff you accept or reject, and you run Python, JavaScript and HTML without leaving the page.

Try it at cue.nothans.com.

Cue has no backend. It is a static site: Node.js builds it, and any static web server can host it. You bring your own API key, it stays in your browser, and requests go straight from your browser to the provider you chose. With an OpenRouter key you can use free models and pay nothing.

What it does

  • Cards. A card holds the conversation, the code and its spec, and is named for you after the first reply.
  • Prompts with context. Every prompt carries the card as it is: the code, the spec and whether it still agrees with the code, and the last run's output when you attach it. Chips under the prompt box show what goes along, and a click leaves any of it out.
  • Proposals as diffs. The model changes the code or the spec by calling a tool, never by pasting a code block. The code streams into the editor as the model writes it, then becomes an inline diff with per-change Accept and Reject buttons, plus Accept all and Reject all. Stopping mid-stream puts the editor back exactly as it was.
  • A spec tied to the code. The Spec tab holds a short Markdown description of what the code does. Cue fingerprints both and tells you when they drift apart: when the code changed, it offers to update the spec, and when you edited the spec, it offers to update the code to match. Proposals change both together, so the spec stays true.
  • Next cues. After each reply, review decision or run, Cue asks the model for three follow-up prompts that fit what you are doing: fix the error you just hit, question the pending proposal, bring the spec back in step. One tap sends one. You can turn them off in Settings.
  • One assistant, no modes. There is no chat mode or tutor mode. The assistant follows your lead: ask how or why and it teaches, ask for a result and it gets to the proposal.
  • Run in the browser. Python runs through Pyodide in a web worker, loads the packages it imports, and shows matplotlib figures inline. JavaScript and HTML run in a sandboxed iframe with console output captured. A failed run attaches its output to your next prompt, and "Fix with AI" sends it straight away. Output belongs to its card and is cleared when you switch cards.
  • A live HTML preview. Once an HTML page is previewed, it follows the code: edits, accepted proposals and undo re-render it after a short pause, keeping your place on the page. While a proposal streams, the preview waits and then shows the proposal before you accept it. The pop-out button moves the page to its own window (for a second screen), still sandboxed and still live, with its console output in Cue's panel; closing the window brings it back.
  • Edit with AI. Select some lines, press Ctrl+K, describe the change, and review the result as a diff.
  • Providers. Anthropic, OpenAI and OpenRouter, plus a scripted demo assistant that needs no key at all.
  • Everything is local. Cards live in IndexedDB, keys in local or session storage, and there is export and import for backups. Work from the original 2025 Cue is imported automatically on first load.
  • Light and dark themes, keyboard shortcuts, and a phone layout with Prompt, Code and Output tabs where long lines wrap so a whole diff fits the screen.
  • A documented design system. NotHans Blue on tinted neutrals, IBM Plex Sans with a Bricolage Grotesque display face and JetBrains Mono for code, all self-hosted so the app works offline. See docs/design-system.md.

Providers

Each adapter uses its provider's current API directly, so the model keeps its reasoning between turns and prompt caching keeps working.

  • Anthropic (Messages API): adaptive thinking with summarized thinking shown in the conversation, an effort setting, fine-grained tool input streaming, prompt caching, and server-side fallback for Fable 5 and Opus 5. Earlier turns are replayed exactly as the model wrote them, thinking signatures included.
  • OpenAI (Responses API): stateless with store: false, encrypted reasoning items replayed on the next turn, reasoning summaries shown in the conversation, and strict function tools.
  • OpenRouter (chat completions): reasoning with reasoning_details replayed for the same model, a session id per card so its requests stay on one upstream provider, prompt caching for Anthropic models, and the live model catalog with free and tool-capable models marked. Settings shows how many free requests your key has left today.

The Thinking setting (Quick, Balanced, Deep) maps to each provider's effort control, or to the closest effort a model supports. Side tasks (titles and next cues) turn reasoning off, so they stay fast and cheap; models that always reason, such as gpt-oss, get their lowest effort and room to finish thinking before they answer.

Free models

OpenRouter's free models let you try Cue at no cost. Testing them turned up a few catches:

  • Free models get congested; Cue says when a model is busy upstream rather than blaming your quota.
  • Some free providers train on prompts, and your OpenRouter privacy settings may rule them out; Cue says so and links to the setting.
  • Free models vary a lot in quality and can be confidently wrong.

The default OpenRouter model is openrouter/free, a router that picks an available free model that can call tools. Each reply shows which model actually answered. Cohere North Mini Code and Nex N2.5 Pro did well in testing when you want a specific free model.

Quick start

You need Node.js 24.15 or later (22.22 also works).

npm install
npm run dev

Open the printed URL, pick a provider in Settings (or "Try the demo"), and give Cue its first cue.

Opening index.html or dist/index.html straight from disk shows a blank page: browsers block module scripts and workers on file:// URLs. Use npm run dev, npm run preview, or any static web server.

Other scripts:

npm run build      # production build in dist/
npm run preview    # serve dist/ locally
npm run typecheck  # tsc
npm run lint       # eslint
npm test           # unit tests (vitest)
npm run test:e2e   # end-to-end tests (playwright; builds and serves dist/ itself)
npm run check      # typecheck + lint + unit tests + build
npm run icons      # render the favicons and app icons from public/favicon.svg

Keyboard shortcuts

Keys Action
Enter Send the prompt (Shift+Enter for a new line)
Ctrl+Enter (in the editor) Run or preview
Ctrl+K (in the editor) Edit the selection or file with AI
F7 / Shift+F7 Next or previous change while reviewing a proposal
Ctrl+S Download the code, or the spec on the Spec tab
Ctrl+B Toggle the card list
Ctrl+, Settings
Alt+N New card

Icon

The icon is a C for Cue with an ember caret beside it: a prompt waiting for its cue. public/favicon.svg is the master. npm run icons renders favicon.ico (16, 32 and 48 px), apple-touch-icon.png, the 192 and 512 px PWA icons and a maskable icon from it with Playwright's Chromium, and public/manifest.webmanifest lists them.

Privacy and keys

Cue calls the provider APIs directly from the browser using your key. The Anthropic and OpenAI SDKs both require an explicit opt-in for browser use, and Cue sets it because this is a bring-your-own-key application: the key never touches a server that is not the provider's own.

Keys are stored in localStorage by default, or in sessionStorage if you choose "This browser tab only" in Settings. Keys are never part of an export. Code you run is isolated in a sandboxed iframe with an opaque origin, so a page you preview cannot read Cue's storage.

Project layout

src/
  ai/          provider adapters (anthropic, openai, openrouter, demo), prompts, tool schema, message conversion
  components/  Preact UI (conversation, workspace, output panel, dialogs)
  editor/      CodeMirror 6 wrapper with inline diff review, for code and for the spec
  run/         Pyodide worker, sandbox document builder, output store, the preview window's link to Cue
  preview/     the pop-out preview window (preview.html)
  state/       signals-based store and all application actions
  storage/     IndexedDB access, card normalization, settings, and the import from the original Cue
  util/        spec fingerprints, the partial-JSON reader behind the streaming preview, and helpers
  languages.ts language table shared by editor, runner and prompts
scripts/
  generate-icons.mjs        favicons and app icons from public/favicon.svg
tests/
  unit/        vitest
  e2e/         playwright
docs/
  modernization-review.md   review of the 2025 app, the decisions behind the rebuild, and the roadmap
  design-system.md          palette, type, spacing, motion, and the audit checklist for UI changes

Deploying

npm run build writes a static site to dist/. vite.config.ts uses a relative base, so dist/ works from a domain root or a subpath.

cue.nothans.com is served by GitHub Pages. The workflow in .github/workflows/pages.yml runs on every push to main: type check, lint, unit tests, the Playwright suite, then the build, which it publishes to Pages. A failing test stops the deploy.

To host your own copy, fork the repo and set Settings > Pages > Source to "GitHub Actions", or copy dist/ to any static host.

Status

Version 0.1.1. Release notes are on the releases page. Cue is a rebuild of a 2025 single-page app. See docs/modernization-review.md for the review, what changed, what was verified, and what is next.

License

See LICENSE.

About

An in-browser coding workspace: prompt a model, review its changes as a diff, and run Python, JavaScript and HTML in your browser.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages