API Reference bsdkrun_ex v#0.1.0

Copy Markdown View Source

Modules

Elixir SDK for bsdkrun — a Firecracker-style microVM launcher for BSD and Linux guests on macOS and Linux, built on libkrun.

Builds the full bsdkrun argv (minus the binary and global flags) for a detached create. Ported verbatim from the TypeScript SDK's args.ts; every path ends with -d so create yields a handle.

Resolves the bsdkrun binary. First match wins; the result is cached in :persistent_term. Resolution order

Shells out to the bsdkrun binary via System.cmd/3.

The single exception type raised (or returned in {:error, _} tuples) by the SDK. kind discriminates the failure

Image operations: list downloaded OCI + fetched BSD images.

Global-network operations: opt machines into a shared subnet so they get distinct IPs and reach each other by IP and by name (docker-compose style).

A handle to a running (or stopped) bsdkrun microVM. Create one with create/1, reconnect with get/1, or enumerate with list/1.

Host-level toolchain + image operations.

Typed structs mirroring bsdkrun's JSON output, plus mapping helpers that turn a decoded --json row (string keys) into the corresponding struct.

An image as reported by bsdkrun images --json.

A global network as reported by bsdkrun network ls --json.

The captured result of running a command in the guest (Bsdkrun.Sandbox.exec/3).

A machine as reported by bsdkrun ps --json.

A volume as reported by bsdkrun volume ls --json.

Persistent volume operations.