Skip to content

CLI Reference ​

All commands accept --help for usage.

onelf init ​

Scaffold a starter onelf.toml.

onelf init [-o FILE] [--binary PATH] [--force]
FlagDefaultDescription
-o, --outputonelf.tomlWhere to write the recipe
--binarynoneSeed name/command from this binary's basename, and write [input] binary naming it, so the scaffold builds as it stands
--forcefalseOverwrite existing file

onelf build ​

Assemble an AppDir from its recipe and pack it. One command resolves the whole recipe: [input] imports a bare binary to the command's path, a [sysroot] applies its package database or records its sets, the framework rules run over the chosen source, and the packer writes the resolved set selections. An unresolved required dependency fails the build whether the contents come from a [sysroot] or from a scan of this machine. [bundle] skip runs no audit at all and packs the tree as unchecked, with no completeness claim.

onelf build [PATH] [-o FILE] [--dry-run]
Arg / FlagDefaultDescription
PATH.Directory or .toml file
-o, --output[package] output, else <name>.onelf next to the recipeOverride recipe's output path
--dry-runfalseReport what the build would collect, import and emit, with its completeness findings, without writing to the AppDir, fetching anything or running the application

The build ends its bundling with one sorted block of completeness findings, headed Completeness findings (N):. Each line names the entrypoint when the finding is specific to one, the framework rule when one is involved, the object, the outcome and the reason, and the soname that activated the rule. The outcomes are selected (the source or provider that answers for the object), unverified (a pinned set that was not obtained), optional omission, removed (by the policy, a trace or a host package), unresolved, required failure and unchecked (a compiled-in path or traced run the assembly could not check).

A dry run uses the same planning and reports the same findings. A binary import is placed into a private scratch copy, and a sysroot build populates one, so the AppDir is left exactly as it was. A pinned set whose build is not already verified on this machine is reported as unverified and satisfies nothing, since a dry run never fetches. A sysroot that is not materialized yet stops the dry run, which neither fetches nor unpacks its archive. A traced run is reported as not exercised. The dry run exits nonzero when it finds a required failure. Because the drop pass audits the finished tree, a dry run reports an unresolved need itself rather than the optional objects a build would omit for it.

A recipe with a [sysroot] pins every entry's mtime to 0 unless it sets [package] mtime or SOURCE_DATE_EPOCH is set. See Reproducible Builds.

onelf run ​

Run an AppDir in place for dev iteration.

onelf run [PATH] [--command PATH] [--entrypoint NAME] [--bundle] [-- ARGS...]
FlagDescription
PATHAppDir or .toml file (default .)
--commandBinary to exec, relative to AppDir
--entrypointSelect a recipe-defined entrypoint
--bundleAssemble from the recipe the way a build does (sysroot, sets, rules), acquire the selected entrypoint's sets, then run from the prepared development view
-- ARGSPassed to the entrypoint after its own args. Name the PATH explicitly when passing args, so the first one is not read as the path: onelf run . -- ARGS

onelf pack ​

Pack a directory into an executable.

onelf pack DIRECTORY -o OUTPUT --command PATH [options]
FlagDefaultDescription
-o, --outputrequiredOutput file
--commandrequiredPath to main binary within DIRECTORY
--namecommand basenamePackage name
--entrypoint NAME=PATHAdd extra entrypoint (repeatable)
--default-entrypoint NAMESelect default entrypoint
--lib-dir DIR[auto]Library dir of the bundle (repeatable)
--level N19Zstd compression level (0 to 22)
--block-size SIZE64K, 32M for stipplefsBytes per payload block, K/M suffix allowed (4K to 32M; a stipplefs payload takes a power of two up to 64M)
--payload FORMATblocksblocks for files cut into separately compressed blocks, stipple for a stipplefs image, deduplicated and compressed across files
--dictfalseTrain shared zstd dictionary
--no-compressfalseStore payload raw, no zstd (overrides --dict)
--prefetch FILEStartup profile recorded with ONELF_PROFILE. The runtime decompresses the blocks it lists ahead of the app. See Prefetching a startup
--preload PATHLibrary dlopen'd on every exec via onelf-env (repeatable, re-exec-safe)
--memfdfalseMark the default entrypoint memfd-eligible (conflicts with --no-memfd)
--no-memfdfalseForce memfd eligibility off
--cachefalseLet the runtime fall back to the persistent cache when no other execution mode works
--prefer-cachefalseRun from the persistent cache before any other execution mode, for an app that records its own path in files that outlive it. Implies --cache
--needs-setuidfalseThe app runs setuid binaries such as sudo or pkexec, so keep it out of a user namespace
--mtime SECSPin every entry's mtime to a Unix timestamp for reproducible output. Overrides SOURCE_DATE_EPOCH
--working-dir MODEinheritinherit, package, or command
--update-url URLURL of the release binary for self-update. Must start with https://. Selects the update runtime unless --no-embed-updater is given
--update-key PATHFile with one or more 32-byte Ed25519 public keys. Several concatenated keys form a keyring, and any of them can sign updates. A file that holds a secret key, is not a multiple of 32 bytes or repeats a key is refused. Requires --update-url, and self-update needs it
--update-revision NStamp release number N into the package; the runtime refuses downloads that are not strictly newer. Requires --update-url
--update-unsignedfalseAccept unsigned updates: store no signing key and mark the package so its runtime installs whatever the update URL serves, warning on stderr. HTTPS is still required. Requires --update-url, conflicts with --update-key
--no-embed-updaterfalseRecord the update URL without embedding the updater (keeps the slim runtime; see the self-update guide's size table)
--host-libs MODEautoWhat the launch resolver may take from the host: never nothing, auto the GPU driver stack's closure, always any bundled soname the host has newer
--exclude GLOBExclude paths matching glob (repeatable)

onelf bundle-libs ​

Resolve and copy shared library dependencies.

onelf bundle-libs DIRECTORY [options]
FlagDefaultDescription
--target PATHall ELFAnalyze only this binary
--from-binary PATHCopy binary into DIRECTORY/bin/ first
--lib-dir DIRlibWhere to place bundled libs
--exclude PFXSoname prefixes to skip (comma/repeat)
--include SONAMEForce-include this soname (comma/repeat)
--search-path DIRExtra lib search dir (highest priority)
--dry-runfalseReport without copying, fetching or running the target; a --sysroot dry run populates a private scratch copy instead of DIRECTORY
--no-recursivefalseDon't resolve transitive deps
--gl, --dri, --vulkanfalseBundle the GPU stack (Mesa GL/EGL/GBM, DRI drivers, Vulkan ICDs). Opt-in: it is never bundled on detection alone, because the host's driver is the one that works
--wayland, --gtkautoFramework bundlers. Auto-detect inspects both DT_NEEDED and versioned soname strings in the binary, so dlopen'd frameworks are picked up too
--no-gl, --no-dri, --no-vulkan, --no-wayland, --no-gtkfalseForce a framework off, overriding auto-detection and the matching positive flag
--stripfalseRun strip --strip-unneeded
--strict-libcfalseSkip wrong-family libc libs
--scan-dlopenfalseScan binary strings for common dlopen sonames
--dlopen SONAMEExtra sonames for --scan-dlopen (comma/repeat)
--trace-runfalseRun the --target for a few seconds in a sandbox and bundle every library it loaded at runtime, from the glibc loader's own report (a musl target needs strace). The GPU driver stack it loads is left to the host. Requires --target
--trace-seconds N5How long the traced run may go before it is stopped; requires --trace-run
--trace-arg ARGArgument for the traced run (repeatable); requires --trace-run
--sysroot DIRTake the bundle's contents from this sysroot's package database; needs --target. Excludes the framework bundlers --gl, --dri, --vulkan, --wayland and --gtk, and refuses --trace-run
--sysroot-optional PKGOptional dependency to include from the sysroot (repeatable); requires --sysroot
--platform-line FILESoname prefixes the host provides, one per line; requires --sysroot
--policy FILEGlob patterns that never ship, one per line; requires --sysroot
--trace FILEPaths a test run opened, one per line; requires --sysroot
--keep FILEGlob patterns the trace may not prune, one per line; requires --sysroot

onelf sysroot ​

Obtain and inspect pinned sysroots. See Bundling from a Sysroot.

onelf sysroot fetch SOURCE DIR [--hash BLAKE3]
onelf sysroot info DIR
onelf sysroot pack-gl DIR -o FILE [--sysroot SYSROOT --package NAME...]
onelf sysroot pack-set DIR -o FILE --name NAME [--sysroot SYSROOT --package NAME... [--platform-line FILE]]
CommandDescription
fetch SOURCE DIRMaterialize a .tar or .tar.zst rootfs from a local path or an https:// URL into DIR. With --hash, an archive whose BLAKE3 does not match is not unpacked
info DIRPrint the package count, file count and glibc version of a materialized sysroot
pack-gl DIR -o FILEPack a GL build for hosts without one and print the BLAKE3 hash to pin in platform.toml. With --sysroot and --package, DIR is built first from the named packages' closure: shared objects and driver description directories, glibc left out. Otherwise DIR is a tree you built. Either way it is verified to be self-contained
pack-set DIR -o FILE --name NAMEPack a shared dependency set and print the BLAKE3 hash to pin in a recipe's [sysroot.sets.<name>]. NAME is letters, digits, - and _ only, as the recipe requires. With --sysroot and --package, DIR is built first from the named packages' closure, everything but glibc and the development and documentation directories; otherwise DIR is a tree you built. --platform-line names the soname prefixes the host provides; without it the GPU driver families are the line. Verified to be self-contained like a GL build, and packed beside FILE and only renamed onto it once its provider index reads back as verified, so a failed check leaves FILE as it was

onelf info ​

Show metadata.

onelf info BINARY

onelf list ​

List packaged files.

onelf list BINARY

onelf extract ​

Extract files from a packed binary.

onelf extract BINARY [-o OUT] [--file PATH ...] [--preserve-mode]

Without --file, extracts everything to onelf_extracted/ (or -o). With one --file and -o -, pipes that file to stdout. File modes are masked to 0o777 unless --preserve-mode is given, which keeps the setuid, setgid and sticky bits. Do not use it on a package you do not trust.

A package extracts itself the same way with --onelf-extract.

onelf verify ​

Check a packed binary's integrity: the container structure first, then every file entry.

onelf verify BINARY [--key KEYFILE --sig SIGFILE]

For format 2 packages the structure check covers the runtime ELF prefix and the footer, both hashed into the manifest. Format 1 packages carry no such hashes and are refused with a clear message, since their structure cannot be checked at all. These hashes detect corruption and inconsistent edits, but anyone who rewrites a file can recompute them, so a passing check does not say who produced the file.

The entry sweep recomputes a BLAKE3 for each file and compares it against the manifest.

With --key and --sig (always together), also check a detached Ed25519 signature over the whole file. This is the same check the runtime's self-update applies before installing. KEYFILE is the raw 32-byte public key onelf key new writes, or a keyring of several concatenated keys, any of which may have signed; SIGFILE is the raw 64-byte signature onelf sign writes. A signature over a modified file fails, and only the holder of the secret key can make a new one.

Exit 0 on match, 1 on mismatch.

onelf icon ​

Extract the bundled icon.

onelf icon BINARY [--entrypoint NAME] [-o FILE]

onelf desktop ​

Extract the bundled .desktop file.

onelf desktop BINARY [--entrypoint NAME] [-o FILE]

onelf integrate ​

Install desktop shortcut and icon for a packed binary.

onelf integrate BINARY [--entrypoint NAME]

Installs every icon size the package carries to $XDG_DATA_HOME/icons/hicolor/ and a .desktop file to $XDG_DATA_HOME/applications/ (see Desktop Integration). Both are named onelf-<name>, or onelf-<name>-<entrypoint> for an entrypoint other than the default, so integrating a second entrypoint does not replace the first. The Exec=, TryExec=, and Icon= fields are patched automatically, and so is the Exec= of every desktop action. If the package has no bundled desktop file, a minimal one is generated.

Integrating the default entrypoint integrates the package: the default and every other entrypoint that carries a desktop file of its own, .onelf/desktop/<entrypoint>.desktop, each with its own files. An entrypoint served only by default.desktop gets no menu entry.

FlagDescription
--entrypointEntrypoint to integrate alone (default: the one BINARY launches; the default entrypoint integrates the package)

Exec= names BINARY. When --entrypoint names one that BINARY would not start on its own, Exec= runs it as env ONELF_ENTRYPOINT=<name> BINARY. See Desktop Integration.

onelf unintegrate ​

Remove desktop shortcut and icons installed by integrate. Through the default entrypoint it removes every entrypoint's files; --entrypoint naming another removes only that one's.

onelf unintegrate BINARY [--entrypoint NAME]

onelf key ​

Manage the Ed25519 keys that sign self-updates.

onelf key new [--secret PATH] [--public PATH]
onelf key show --secret PATH [-o PATH]
FlagDefaultDescription
--secret PATHonelf.keySecret key file, created owner-only
--public PATHonelf.pubPublic key file, 32 raw bytes for --update-key
-o, --output PATHstdoutWhere show writes the public key

new refuses to overwrite an existing key file.

onelf sign ​

Write the detached signature the runtime verifies before installing an update.

onelf sign BINARY --key PATH [-o PATH]
FlagDefaultDescription
--key PATHSecret key file from onelf key new
-o, --output PATHderived from the package's update URLSignature output path

The default output name comes from the update URL the package carries, because that is the only name the runtime requests: a package whose update URL is app.onelf needs its signature at app.onelf.sig. Signing refuses when the package embeds update keys and the secret matches none of them. It warns, and still signs, when the package embeds no key. See Self-Update for the full publish flow.

onelf cache ​

Manage the persistent cache: packages extracted by the cache mode, the GL builds and dependency sets fetched for hosts without them, and the execution views under views/, both the packed launches' and the development runs'. list shows the builds and packages; gc removes packages, builds and views unused past the age threshold, a view only once no launch holds its lease.

The cache lives under $XDG_CACHE_HOME/onelf, else ~/.cache/onelf. Run as root, the CLI ignores both variables and keeps a persistent, root-owned 0700 cache at /var/cache/onelf. Only when /var/cache is not a directory root alone may write does it fall back to the runtime's private base (/run/onelf, else /tmp/onelf-0), which does not survive a reboot.

onelf cache list
onelf cache clear
onelf cache gc [--max-age DAYS]

Released under the MIT License.