Browse docs
Docs / CLI Reference / swarmfile-runner
View as Markdown

swarmfile-runner

On this page

swarmfile-runner runs the engine in runner mode: it sets SWARMFILE_RUNNER_MODE=true (when the variable isn't already set), then re-execs the sibling swarmfile-engine binary with the same arguments and standard I/O. It has no subcommands or flags of its own - every engine flag passes straight through - and it runs the real engine boot path (config, single-instance lock, lifecycle) exactly as SWARMFILE_RUNNER_MODE=true swarmfile-engine would.

It exists so the headless CI role reads as its own tool rather than "the engine with an env var". For what a runner does and how to wire it into a CI system, see Runner (Headless CI).

Because it re-execs the engine, swarmfile-runner --help is the engine's help. The pass-through flags:

FlagWhat it does
--build-infoPrint the enabled cargo features and target architecture, then exit.
--statusEngine, hub, peers, and pending work at a glance (works while another engine holds the lock).
--capabilitiesThe compiled feature set of this binary.
--print-env-varsThe resolved SWARMFILE_* values this build consumed, secrets redacted.
--pause / --resumePause or resume sync on a running engine without unmounting.
--quitAsk the running engine to drain and stop.
--pin / --unpin / --list-pins / --verify-pinsOffline cache pins: add, release, list, and verify.
--prepare-offline [SECS] / --return-from-offlineThe engine-level Pack & Go pair - see Working Offline.

See Engine Config File → Engine command-line flags for the full descriptions.

Environment#

VariableDescription
SWARMFILE_RUNNER_MODEForced to true when unset. An explicit value is preserved, so SWARMFILE_RUNNER_MODE=false swarmfile-runner still runs in normal mode
SWARMFILE_API_KEYRepository API key (sf_key_…) the runner authenticates as. The hosted hub refuses to start with a PAT unless SWARMFILE_RUNNER_ALLOW_PAT=1 (jobs run, but their reports are refused and the Runs tab stays empty)
SWARMFILE_ORG_IDOrg that owns the repository. Optional with a repository API key (the runner resolves it from the repository API key) or when the hub URL already ends in /orgs/<id>; otherwise required, including with a PAT or an older hub
SWARMFILE_REPOSITORY_IDRepository the runner serves. Optional with a repository API key (resolved with the org)
SWARMFILE_BRANCHBranch the runner tracks (defaults to the repository's default branch)

Runner mode deliberately serves no control socket. A driverless CI host needs no FUSE - materialize and runner mode never call the mount path.

Acquiring it#

  • Linux - the .deb installs it at /usr/bin/swarmfile-runner, next to swarmfile-engine.
  • macOS - it ships inside Swarmfile.app/Contents/MacOS/swarmfile-runner, next to the bundled engine, with a /usr/local/bin/swarmfile-runner symlink on a prod install.
  • Windows - the MSI installs it next to swarmfile-engine.exe in the install folder, and the app-only zip carries it.
  • Keep it next to the engine. It must sit in the same directory as swarmfile-engine, because it re-execs the sibling resolved next to its own executable; the installers put it there.
  • Equivalent without the alias - on any engine binary, SWARMFILE_RUNNER_MODE=true swarmfile-engine behaves identically.

Example#

SWARMFILE_API_KEY=sf_key_... SWARMFILE_ORG_ID=org_abc123 \
  SWARMFILE_REPOSITORY_ID=proj_xyz789 swarmfile-runner

Because it re-execs the engine, the process's exit code and output are the engine's. If the sibling swarmfile-engine is missing, the alias prints an error and exits 127.

Something wrong or missing? Report a docs issue.