Feature·Standalone Executables·Cross-Compilation
One file out the other end.
sema build traces your imports, bundles assets, and emits a self-contained binary. No venv on the server, no dependency pinning, no container just to run a script. The part Python never solved.
12 MB binary · no runtime needed · cross-compile for 5 platforms
The build pipeline
From source to binary, in one command.
The problem it solves
Deploy without the ritual.
def deploy(): # 1. SSH in ssh prod # 2. Create virtualenv python3 -m venv venv source venv/bin/activate # 3. Install dependencies pip install -r requirements.txt # hope versions haven't drifted… # 4. Copy source scp -r src/ prod:~/app/ # 5. Run it python agent.py # 6. Pray the runtime matches # 7. Containerize if it doesn't
# Build locally sema build agent.sema -o agent → traced 3 imports, bundled 1 asset → agent (self-contained, 12 MB) # Ship it scp agent prod: && ssh prod ./agent → runs. that's it.
Cross-compilation
Build from anywhere, for everywhere.
--target linux on macOS. --target windows on Linux. --target all produces five binaries in one command. Runtime binaries are downloaded, SHA256-verified, and cached — injection is format-aware, not host-specific.
- Five targets. macOS ARM + Intel, Linux x86_64 + ARM, Windows. Cover every mainstream deployment target.
- Any host → any target. Mach-O section injection works in pure Rust — build macOS ARM64 binaries from Linux.
- Cached runtimes. Downloaded once, SHA256-verified, stored in
~/.sema/cache/.--no-cachere-downloads. - Air-gapped support.
SEMA_RUNTIME_BASE_URLoverrides the download location for mirrors or offline builds.
Binary layout
How the archive gets injected.
The injection strategy varies by binary format — detected from the runtime binary's magic bytes, not the build host. Each method preserves binary integrity and OS loader compatibility.
libsui, ad-hoc re-signed for ARM64.libsui. Authenticode signatures stripped.VFS — bundled files
Your files travel with the binary.
--include data.json or --include assets/ bundles files into a virtual filesystem inside the executable. At runtime, file/read, import, and load check the VFS first, then the real filesystem. Your code doesn't change between dev and production.
- Transparent interception.
file/read,file/exists?,import,load— all check VFS first. - Recursive directories.
--include assets/bundles everything underneath. - Integrity checked. CRC32-IEEE checksum on the archive — corruption is detected at load.
- Writes go to real FS.
file/write,file/append,file/deletealways target the real filesystem, never the VFS.
Capability sandbox
Fence off what's dangerous.
--sandbox restricts shell access, filesystem writes, network calls, and LLM access — per group. --allowed-paths whitelists specific directories. Run untrusted code without exposing the host.
- Strict mode.
--sandbox strictblocks shell, network, and filesystem writes. Only--allowed-pathsare readable. - Allowed paths.
--sandbox strict --allowed-paths ./data,./output— granular filesystem access. - Per-capability.
--sandbox shell,network— block only specific capabilities, allow the rest.
Build your first binary.
One command. Trace, compile, bundle, inject.