Skip to content

REPL, Eval & Watch Mode

ob includes built-in developer tools to speed up iteration without external utilities.

ob eval

Evaluate a Lua or TypeLua snippet directly from the command line:

ob eval 'local x: number = 21; print(x * 2)'

Supports all permission flags (--allow-read, --allow-net, -A, etc.):

ob eval --allow-read=ob.toml 'print(require("ob:fs").read_file("ob.toml"))'

ob repl

Start an interactive Luau / TypeLua console. Simple expressions are automatically evaluated and printed:

ob repl
Orbita v0.2.0 (Luau / TypeLua REPL)

ob> 2 + 2
4
ob> require("ob:json").encode({ runtime = "Orbita" })
"{\"runtime\":\"Orbita\"}"
ob> .exit

ob run --watch & Live Reload

Watches .lua, .tyl, .luax, .tylx, .html, .css, .js, ob.toml, and config.toml files in your project and automatically restarts your script or HTTP server whenever a file changes:

ob run src/main.tyl --watch

When running a web app with ob:router under --watch:

  • Clean server restarts: long-running HTTP servers are restarted automatically on save without lingering port conflicts.
  • Automatic Browser Live Reload: Orbita injects a tiny live-reload client (/__orbita/client.js polling /__orbita/live) into HTML responses, refreshing your browser automatically whenever code, templates, or CSS change.
  • Zero-stale-cache dev: compiled .html templates and static assets (Cache-Control: no-cache) revalidate automatically on every edit.

Combine with permission flags as needed:

ob run --watch --allow-net=127.0.0.1:3000 --allow-read=. --allow-write=storage src/main.tyl