Single-File Binary & Embedded Assets¶
Inspired by go build (with //go:embed) and bun build --compile, Orbita packages your entire project into a single self-contained executable.
How It Works¶
When you run ob build <entry> --compile:
- Orbita collects all
.lua,.tyl,.luax, and.tylxfiles in your project and.ob/packages/. - It collects all static assets matching
[embed]inob.tomlas well as any--embedCLI globs. - Everything is packed into a
.tar.gzarchive alongside metadata (entry point + permissions) and appended to a copy of theobbinary with a magic footer (ORBITA_BUNDLE_V1). - When launched, the compiled binary detects the footer and boots straight from memory — no
obinstallation or loose source files required on the target machine.
Example¶
1. Declare [embed] in ob.toml¶
2. Read assets with ob:embed¶
-- src/app.tyl
local embed = require("ob:embed")
local template: string = embed.read("assets/index.html")
print(template)
3. Compile and run¶
Baking Permissions into the Binary¶
You can pre-grant permissions at compile time: