typebulb
v0.3.0
Published
Local bulb runner CLI for Typebulb
Downloads
1,603
Readme
typebulb
Run single-file TypeScript apps. A .bulb.md file bundles code, HTML, CSS, and server-side logic in one markdown file — typebulb compiles and serves it locally with hot reload.
Create bulbs on typebulb.com and export, or generate .bulb.md files with any AI coding tool.
Quick Start
npx typebulb my-bulb.bulb.mdOr install globally:
npm install -g typebulbUsage
typebulb <file.bulb.md> Run a bulb
typebulb . Find .bulb.md in current directory
typebulb --no-watch <file> Disable hot reload
typebulb --port 3333 <file> Custom port
typebulb --no-open <file> Don't auto-open browser
typebulb --server <file> Run server.ts only, no web serverFeatures
- Hot reload — Recompiles on save and refreshes the browser (on by default; disable with
--no-watch) - Filesystem access —
tb.fs.read()andtb.fs.write()for local files - Env files —
.envand.env.localauto-loaded from cwd - Server-side code — Add a
**server.ts**section; exported functions become callable from the browser viatb.server.<name>()(e.g.,export async function query(...)→await tb.server.query(...)) - CLI logging —
tb.server.log(...)prints to the CLI's stdout - Server mode —
--serverruns only the**server.ts**section in Node, skipping the web server. Bulbs with only**server.ts**(no**code.tsx**) use this mode automatically. - Package resolution — Client dependencies are automatically resolved by generating import maps (same resolver as typebulb.com). Server dependencies are automatically installed via npm.
Limitations
- Inference —
tb.infer()is not yet supported locally. Bulbs that use inference will render but cannot run LLM calls.
License
MIT
