Typebulb Typebulb FAQ

What's Typebulb?

Typebulb runs apps in markdown files called bulbs. Designed for tools, visualizations & experiments. A bulb is a single self-contained file, so an agent can inline an app into its reply, and the same file can be published as a stand-alone web app. The "markdown with code blocks" format is one LLMs find natural to write.

Two ways to create and run bulbs:

One API runs everywhere: the same bulb works in typebulb.com's sandbox and locally, and can call AI models at runtime.

New here? Take the interactive tour.

How do I run bulbs locally?

Run bulbs locally via typebulb's agent mirror, which is included in the open-source Typebulb CLI:

What is the agent mirror?

The agent mirror is a GUI that mirrors your agent harness to provide a code scratchpad experience. Features:

Which harness works best with typebulb's agent mirror?

Pi lets you both prompt and read responses in the agent mirror, so it has an edge.

With Claude Code and Codex the mirror is strictly a read-only view, so you still prompt from their own CLIs. However, this can have benefits, most notably being able to use your subscription key in the case of Claude Code.

CLI Features

What can a bulb on my machine access?

A bulb has the following trust levels:

CapabilityInlineRestrictedTrusted
Run code in the browser, use the network
Use storage, cookies, background threads, and the GPU🚫
Read local files, run Node code with server.ts, use your AI keys🚫🚫

What's the tb.* API?

Every bulb gets a tb object, without importing anything. It covers what a single sandboxed file can't do for itself: read its own data, call an AI model, copy text to the clipboard, find out which theme it's in, and, once you've trusted it on your machine, reach your filesystem and your server.ts.

You won't write these calls. The AI does. The full list is in the typebulb README.

What comprises a bulb?

A bulb is one file made of a few named blocks, and each block is a tab in the editor on typebulb.com. Everything except the code is optional, so the smallest bulb really is just code.

BlockPurpose
code.tsxThe app itself: logic and UI
styles.cssStyling
index.htmlUsually just a stub for the app to mount into
data.txtData for your code to process (JSON, CSV, XML, YAML, or plain text)
infer.mdInstructions for a runtime AI call
insight.jsonThe result of that call
config.jsonThe npm packages the bulb uses, and its description
notes.mdPersistent context for the AI
server.tsNode.js code, when running locally

What's the Data tab?

The Data tab holds the content your code processes, structured (JSON, CSV, XML, YAML) or not (plain text). Multiple chunks are separated by two blank lines.

The Data tab is designed to be handled programmatically, as it's often too long to fit into an agent's context window. In the CLI, an agent can read and set it via the get and put commands.

How does inference work?

Note: For general-purpose runtime AI calls, use tb.ai.

This feature is easiest to understand via an example, such as the bach bulb. The user clicks on "AI Compose" and it launches a dialog, where the user types the genre, e.g. "fugue", and then the AI generates a fugue. The AI assistant will write such a bulb for you, but how does this work?

Under The Hood

The Infer tab is a prompt for runtime LLM calls. When your code in code.tsx calls tb.infer(), the LLM receives: your inference instructions, an example output (from insight.json), your code.tsx (so it knows the expected JSON shape), and the data.txt to process. A modal shows the user what will be sent; confirm and the LLM streams its response.

The Insight tab holds JSON that serves as both a working example (showing the LLM what shape you expect) and the current output (updated after tb.infer() completes). Your code reads it via tb.insight(). There's no separate JSON Schema. The code IS the schema.

Access

Free tier users are rate limited. Users with their own API keys have no Typebulb-imposed limits (within reason). Runtime inference always uses the user's API keys, or Typebulb's courtesy models, never your API keys.

What's the Notes tab?

Persistent context for the AI, carried across conversations and clones. Useful for API docs, examples, or skills the LLM requires.

Typebulb.com AI Assistant

Typebulb's AI assistant is great for 1-shot bulbs. If you've got a more complex bulb, develop it locally with Claude Code or Codex, and run with the typebulb CLI. When it's ready you can import to typebulb.com.

What AI providers do you support?

OpenAI, Anthropic, Gemini and OpenRouter. Bring your own keys. Your keys are used for the AI assistant and tb.infer() calls that you make, but not anyone else who runs your bulb.

What are the chat modes?

ModeAI sees your bulbAI will editUse case
CodeYesYesDefault. Sees code, HTML, CSS, notes, truncated data, errors, and logs.
AskYesNoSame context as Code, but when you just want to discuss, not edit code.
ChatNoNoGeneral conversation, unrelated to your bulb.
RawNoNoNo system prompt. Good for prompt testing.

In Code mode, Typebulb will automatically reply to the AI if it makes a patch error or generates TypeScript errors, with precise details on how to fix them.

Can the AI assistant search the web?

Yes, with caveats. Web search is most reliable with native provider integrations (OpenAI/Anthropic/Gemini); OpenRouter support can be model-dependent and less consistent.

This is web search, not browsing. It works best for well-indexed topics (news, popular libraries, recent releases), and may not retrieve obscure npm or GitHub pages from a URL alone.

If you need the AI to use specific documentation, paste excerpts into the Notes tab; for structured data, use the Data tab.

How do I debug?

On typebulb.com

Add console.logs to your code, and logs are automatically fed back to the AI. You can even debug manually, as we automatically generate TypeScript source maps:

typebulb CLI

Locally, your agent does the debugging. It instruments the bulb, runs it, and reads the console back itself, including for a bulb you started from the explorer and are watching in the browser. See What can my agent do with a running bulb? above for how far that goes.

Does Typebulb work on mobile?

Using Bulbs

Typebulb is heavily optimized for building responsive bulbs that work beautifully on both mobile and desktop. "alt-enter" toggles between a mobile-friendly portrait layout and full screen.

Developing Bulbs

For building bulbs, Typebulb works on mobile, but is heavily optimized for desktop usage. The mobile experience has one key feature: you can see the bulb's logs, which is useful for testing.

Why TypeScript?

Privacy & Sharing

Are my bulbs visible to others?

A bulb has 3 possible visibilities adjustable in the toolbar/menu:

When you share a bulb, the user will see any changes you make if you save the bulb and they refresh their browser. The user has a read-only view of your bulb; if they try to edit it, a clone is made.

Can I keep a local bulb in sync with a published bulb?

Yes. Make sure your local bulbs are in the typebulbs/u/<user-slug>folder, to enable syncing. E.g:

Local fileOn typebulb.com
typebulbs/u/ben/birds.bulb.mdtypebulb.com/u/ben/birds

Create an access token by clicking on your account name on typebulb.com, then copy & paste the token into your .env in your project, using the nameTYPEBULB_TOKEN.

In the bulb explorer, you can now push and pull the bulb to and from typebulb.com. You can also ask your agent to automate that via typebulb push and typebulb pull calls.

Extra Features

How do you handle my data?

This is what we store:

We don't use your data for training or sell it to third parties. Your AI providers have their own data policies.

About

Who's behind the website?

Ben Albahari. I worked as a Program Manager at MSFT, and co-authored the C# in a Nutshell series (with my brother, Joe Albahari, the author of the popular LINQPad tool). It's very cheap to maintain, but if it ever got really popular, I'd seek investment.

Do you have a favorite bulb?

This changes all the time. Currently it's a transformer that runs in your browser. Also You're Absolutely Right!, a sycophancy benchmark written as a bulb, that automates hundreds of API calls. The bulb approach makes it easy for anyone to inspect or re-run the results.

← Back to Typebulb