Browse docs
Docs / CLI Reference / swarmfile
View as Markdown

swarmfile

On this page

swarmfile drives Swarmfile version-control operations against a running engine: commit, switch/restore, branches, merge, and the rest of the day-to-day repository commands.

It talks to the engine over its control socket - most subcommands mirror an operation the Desktop App can do, and every subcommand requires a running engine except:

  • completions
  • demo offline (it changes the host firewall, not the engine, and must work exactly when the engine is what is being cut off)
  • usage agents --local (a local transcript scan, uploaded nowhere; the default org-ledger mode needs the engine)
  • processes (local record/log management, including while the engine is stopped)
  • the git helper verbs (git url, git clone, git preflight and git import, which answer before the engine connection is needed)
  • the pure Git-habit shortcuts (push/pull/clone/rebase/cherry-pick/rm/mv/cp/mkdir/touch/worktree/grep/init/remote/clean/reflog/mergetool/difftool/shortlog/submodule/bisect/gc/prune/fsck/archive/notes), which work standalone

add, stash, reset, and the executable clone <id> <path> / clone … --checkout / clone … --into forms are the exception among the shortcuts - they map onto real commands, so they need a running engine too (see the Git-habit shortcuts note below).

If the engine isn't running, start it (or the Desktop App) first, or use the standalone swarmfile-doctor binary to diagnose connectivity without one.

swarmfile comes with the desktop app on every platform: /usr/bin/swarmfile from the Linux .deb, /usr/local/bin/swarmfile on macOS (a symlink into Swarmfile.app, so desktop updates carry it too), and swarmfile.exe in the Windows install folder (C:\Program Files\Swarmfile), which the installer adds to the machine PATH.

There is no separate CLI download - install the desktop app and open a new terminal.

A macOS install that came from the .dmg rather than the .pkg needs one full installer run to get the command-line tools and the PATH entry - Diagnostics → Reinstall does that from the tray; on macOS the tray also repairs the /usr/local/bin symlinks at launch where the directory is writable.

swarmfile doesn't include a search subcommand - search needs its own hub-authenticated round trip independent of the control socket, so it lives in the standalone swarmfile-search binary instead.

Global flags#

These apply to every subcommand.

FlagDescription
--cache-dir <path>Engine cache dir (where control.json lives). Respects $SWARMFILE_CACHE_DIR. Default ~/.cache/swarmfile (macOS/Linux), %LOCALAPPDATA%\swarmfile (Windows).
--jsonPrint raw JSON instead of a human-readable summary.
--mount <id>Target this mount instead of whichever one is current - see mounts below. Has no effect on mounts subcommands themselves, which address by their own id argument instead, nor on workspace switch, which changes the whole engine's active workspace rather than one mount.
--no-waitDon't wait for a long operation: print its id and exit 3 at once.
--timingsPrint elapsed time (and phase timings where the command reports them) to stderr; commands that print their own JSON body also gain a timings object (elapsedMs plus named phases) under --json. Never changes stdout. Supported on commit, checkpoint, changelist submit, mounts new/open with --wait, materialize, hydrate start, workspace warm, and the agent hooks; hydrate start and the hook internals print to stderr only.

These are global flags, so they work on either side of the subcommand: swarmfile --json status and swarmfile status --json are equivalent, as are swarmfile --mount m2 status and swarmfile status --mount m2. That holds for the git-habit shims too - swarmfile rm foo --json is read as the flag, not a path.

Exit codes#

Scriptable commands separate "you need to do something" from "something failed", so a CI or pre-flight script can branch on it:

CodeMeaning
0Success - including the Git-habit shortcuts whose intent the product already satisfies (push, pull): nothing to do, so nothing failed.
1Any other failure: an unreachable engine, a hub transport error, and the shortcuts whose operation has no equivalent here.
3A long operation is still running - after --no-wait, or when you pressed Ctrl-C to detach. It carries on in the engine; follow it with op status / op wait.
2A refusal a script can act on, or a CLI usage error (an unknown command, flag, or argument). With --json, refusals print their response body as before, and usage errors print {"code":"usage_error","kind":"…","error":"…"} instead of clap's prose - so a script can tell a typo apart from an actionable refusal.
75Paused, not done: the hub accepted the operation (a large revert, checkout/restore --to, trash restore/purge, folder delete, repository delete or field write) but paused its background job because the repository used up today's write budget. It resumes on its own at the time the message gives; nothing failed, but it has not landed yet, so a chained revert && mr create stops here. --json prints {"code":"job_paused","jobId":…,"retryAtSecs":…,"message":…}, and op status exits 75 for such an operation. undo also exits 75 (operation_paused) when the operation it would undo is still finishing behind a paused job; undo it once it has finished, or use undo --skip to undo the one before it. If the job later fails, you get a notification.

A command page can assign 3 its own meaning where there is no long operation to follow - git index exits 3 when the hub couldn't be reached, for example.

The translated shortcuts (add, stash, reset --hard <rev>, clone <id> <path>) return the exit code of the command they map to, not a shortcut code.

Git-habit shortcuts honor --json: instead of the sentence they print {"code":"already_satisfied"|"not_applicable","exitCode":N,"hint":"…"}.

The confirm-gated verbs all take -y/--yes, and most also accept -f/--force as a synonym - except git enable, and the verbs with a separate safety-gate --force below - stash drop/clear, changelist discard, branch prune, trash purge, repository delete, sync discard, git enable (one-way, so it never proceeds without it), ignore-clean, and (unless --dry-run) cache reclaim, cache public --clear/scratch gc.

Without it, a non-interactive stdin or --json refuses ({"code":"confirmation_required"}, exit 2) rather than destroying work; the estimate-only verbs (ignore-clean, cache reclaim, scratch gc) take --dry-run to preview without confirming or deleting.

Two prompt-gated verbs are the exception and proceed without --yes in the right context: hydrate start and workspace switch both proceed under --json or a non-interactive stdin (an interactive terminal still prompts).

Both are resumable/reversible operations rather than destructive ones, and --yes only skips the interactive prompt.

A few verbs have a separate -f/--force meaning "proceed despite a safety gate" - mounts close (open changelists), scratch clear (repository still open), and ignore-clean (-y skips its prompt, -f also overrides its recent-foreign-edit gate).

Commands that currently use exit 2:

  • mr status (open, not yet approved - the CI review gate)
  • mr approve / mr request-changes with a source stamp the merge request has moved past (source_changed)
  • conflicts resolve --auto / --all --auto (a human must choose - a request that fails mid-sweep is exit 1 and takes precedence)
  • lock (already held)
  • mounts close (open changelists, or the boot mount)
  • mounts retry (mount_retry_unavailable for a non-boot mount or one that attached earlier)
  • acl mode set / acl entry … (forbidden / not_found / plan_restricted)
  • unlock-request respond/cancel (already resolved, or not yours)
  • workspace switch (another switch running, a changelist open, or a drive open on another repository - cross_repository_mount_open)
  • checkout with no target
  • blame --lines (binary/non-UTF-8/oversized, revoked or lease/key refusal, or an engine that predates line attribution)
  • rollback --at with a synthetic (d1:) version (no local restore key)
  • ignore-clean --yes when a candidate was recently edited by someone else (unless --force) or when any delete failed
  • hydrate start / fetch when a job is already running
  • any confirm-gated verb without --yes (the confirmation_required refusal above; ignore-clean --yes keeps its own cross-machine gate)

Version control#

See Version Control and Branches & Merging for the conceptual walkthrough - this section is the flag-by-flag reference. If you're arriving from Git, Coming from Git maps your habits onto these commands.

Git-habit shortcuts. Typing a Git command that has no Swarmfile equivalent - push, pull, clone, rebase, cherry-pick, rm, mv, cp, mkdir, touch, worktree, grep, init, remote, clean, reflog, mergetool, difftool, shortlog, submodule, bisect, gc, prune, fsck, archive, notes - prints a one-line pointer to the real workflow instead of an error (e.g. push explains that saves sync automatically, rm/mv point at doing it on the mounted drive, worktree points at swarmfile mounts open, grep points at swarmfile-search, mergetool points at conflicts resolve --tool, and clone is argument-aware - a public-repository URL, a /s/<token> share link, a swarmfile://mount?repository=… deep link, or a lone repository id each get the right next step; clone <repository-id> <path> actually opens a mount - add -b <branch> to pin it to that branch, exactly like mounts open --branch, or add --checkout to write a plain directory instead (see materialize); clone <public-repository> --into <org>/<repository> copies a public release into a repository, encrypting blocks on this machine - the way to get a public release into a private repository, since the web Copy action only produces public ones. Add --tag <tag> to pick a release, --path <p> (repeatable) to copy a subtree, and --new (with optional --public) to create the destination repository first - a --new --public create records the copy as a claimed fork of the source (the destination links "Forked from"; a private --new records nothing). It runs as a long operation (--no-wait, swarmfile op status|wait|cancel; per-file progress; a cancel resumes from what's done), and its refusals (unknown slug or tag, no write access, a protected branch, a name collision) exit 2 while hub or transport failures exit 1. These shortcuts work even when the engine isn't running (the executable clone forms need it).

Three shortcuts have a real destination and run it instead of just advising: stash (and push/save) → changelist park, stash list/show → changelist parked, stash pop/apply → changelist resume, stash drop/clear → changelist discard (stash list numbers entries stash@{n}; stash drop stash@{n} or drop n discards just that one); add → opens a changelist if none is open (idempotent - saves then stage into it automatically, and this mount goes into staged mode until you commit or changelist cancel); and reset --hard <rev> → restore <rev> (one undoable commit). add <path> exits 1 if the path doesn't resolve, so a typo doesn't silently pass. Parked work is a set, not a stack: a bare pop/apply resumes all parked work for the branch, and pop <n> (or pop stash@{n}) resumes just that entry and leaves the rest parked - an entry parked on another branch is refused, since parked work resumes on its own branch (switch to it instead). If an entry's changeset was closed on the hub while it sat parked, resuming re-creates it and its staged files under a new id, and the result names the new id. A bare drop or clear abandons all of it - so discards ask first (or take --yes). On success these print a sentence, not raw JSON. Bare reset --hard, --soft/--mixed, and bare reset still print guidance, since there is no unstaged state to discard. These three need a running engine.

Referring to a commit. Every command that takes a commit (show, restore, revert, describe, diff, and the commit form of checkout) accepts any of: a commit number (482), the #N form the log prints (#482), HEAD, HEAD~N / HEAD^ (N commits back in the current branch's log), a tag name, a branch name (its head), a changeset id, or a 64-hex commit hash. A seq:/head:/branch:/tag:/changeset:/hash: prefix forces which kind is meant. Resolved client-side to the commit number before the request.

commit#

Open a changelist (if none is open) and submit it in one step.

FlagDescription
-m, --message <String>Commit message
--amendRename the most recent commit instead of creating a new one (like git commit --amend). Message-only and non-destructive - contents and history are untouched. Requires -m. Equivalent to describe on the latest commit.
swarmfile commit -m "Fix layout regression in the deck"
swarmfile commit --amend -m "Fix layout regression in the title deck"

checkpoint#

Close this mount's open auto-commit changeset now, creating a rewindable commit - the same kind of commit swarmfile log shows, with no second history. Use it before a risky change, or per agent turn. An explicit staged changelist is left untouched (submit it with commit); an agent/<label>-<6 hex> workspace also closes after 30 seconds of quiet (SWARMFILE_AGENT_CHECKPOINT_IDLE_SECS, 0 disables the shorter window).

A checkpoint of more than about 5,000 files is committed by the hub in the background. The command waits up to about three minutes for it to land.

If it is still running after that, the command says so and exits 0, and the commit appears in swarmfile log once it lands; a -m message is not applied in that case, so name the commit with swarmfile describe afterwards.

If the hub cannot finish the commit (for example, write access was removed mid-way, or the change is too large to record as one commit), the command exits non-zero and says why; nothing is committed, but your saves are kept.

A commit that failed for a temporary reason is retried automatically. Saves made while a large commit is being recorded go into the next commit, which is recorded after it.

FlagDescription
-m, --message <String>Name the commit this checkpoint creates.
--if-changedExit 0 with no output when nothing changed (for tool hooks and scripts).
--wait <seconds>Wait for in-flight saves to land before checkpointing (default 5; 0 posts immediately).
swarmfile checkpoint
swarmfile checkpoint -m "green build"
swarmfile restore --to 482

undo#

Undo this device's newest local operation, or inspect the journal. It is local and control-route only: it cancels a pending create or inverts a confirmed delete, rename, move or restore.

A confirmed create and a restore are undone as a guarded delete: the engine locks the entry, re-reads the hub's current version (a teammate's newer version is refused superseded), refuses while the entry has unsaved or queued local changes (blocked, try again once they sync) and deletes with the hub's version check, so nothing newer is ever deleted.

A directory is refused. A content edit or teammate's change is refused not_undoable; --skip explicitly targets the next invertible row. VFS/mount namespace ops are journaled read-only; undoing a queued VFS op is not offered (let it sync, then undo the rename or restore it from Trash). It is not a history rewrite.

A multi-entry gesture undoes as one. A multi-select delete or move from the app is recorded as one gesture, and undo (or undo --op on any of its rows) reverses all of it, reporting each entry. If some entries are refused, the answer says which and why and exits 2; the refused entries keep their state, so running undo again retries only them.

An entry that can never be reversed - a new file deleted before it finished uploading is gone for good - is listed under skipped with the reason, without failing the rest; if every entry in the gesture is skipped, the undo is refused not_undoable (exit 2), never reported as done. undo --list marks such rows (one gesture of N). A single-file delete or move is not a gesture and undoes on its own.

A large gesture can take a while: undo and redo run as long operations (--no-wait, op status/op wait), cannot be canceled part-way, and finish in the engine even if the command is interrupted.

Pressing Ctrl-C during undo or redo detaches rather than stopping it: the command exits 3 and prints the operation id, and op wait <id> then exits the way undo/redo would have (2 when something was refused, 75 when the operation is still finishing behind a paused job). --dry-run answers straight away, without an operation id; if another undo or redo in the repository is still running, it says so (in_progress) instead of waiting.

Operations recorded before gestures existed, and VFS/mount operations, are still undone one entry at a time.

An operation whose hub job is still paused behind the daily write budget is refused operation_paused (exit 75). So is any undo or redo while a paused revert, checkout or field commit in the repository is still finishing, and an undo of something inside a folder whose paused restore, folder delete or purge is still running.

--skip passes over a paused row, but it never undoes an older operation inside a folder whose paused delete is still running. When every candidate is paused it exits 75 instead of reporting nothing to undo.

A folder operation that only partly finished (its paused job later failed) stays partial: a plain undo stops on it and tries again (a folder still in Trash comes back), and if the folder is already back it answers partial (exit 2) and keeps the row for a later retry.

A refused undo (for example a confirmed-create delete the hub refused, delete_failed) exits non-zero, never 0.

FlagDescription
--listList this device's recent journal rows (newest first).
--dry-runShow the inverse plan and precondition verdict without applying it.
--op <OP_ID>Undo this journal row instead of the newest.
--skipExplicitly skip a newest non-invertible user action (or one still finishing behind a paused hub job) and target the next invertible row.
--before <SEQ>Page --list rows before this journal sequence (a newest-first cursor).
swarmfile undo --list
swarmfile undo --dry-run
swarmfile undo

redo#

Re-apply the newest undone delete, rename, move or restore, or a row named with --op. A cancelled pending create is terminal and cannot be redone. Redoing a delete is guarded like undo's deletes: a file that changed since the undo is refused superseded, and so is one the hub has already deleted (the redo has nothing left to do); a local cache miss that the hub does not confirm is retryable blocked. A gesture redoes as a whole. --dry-run shows the forward plan.

swarmfile redo --dry-run
swarmfile redo

changelist#

Explicit changelist control (Mode B: staged atomic submit) - for when you want to stage multiple saves before committing them atomically, rather than using commit's one-step flow. A mount can hold several open changelists at once (Perforce's -c model) - see Multiple changelists at once for the conceptual walkthrough.

SubcommandFlagsDescription
open-m, --message <String>Open a new changelist and make it current; subsequent saves stage into it until submit/cancel/switch. Never fails if one is already open - opening a second doesn't close the first.
submit--id <changeset>, -m, --message <String>Atomically apply a changelist. Defaults to the current one; --id targets a specific one without switching to it first. -m sets the commit message at submit time (git-style) instead of naming the changelist at open; omitted, the changelist keeps its open-time label.
cancel--id <changeset>Abandon a changelist. Defaults to the current one; --id targets a specific one without switching to it first.
status-Show whether the current changelist is open and what's staged, plus any files blocked by an unresolved conflict - the same changelist + conflicts pair status --changes renders.
list-List every open changelist, * marking which one is current.
current<id>Switch which open changelist is current.
reopen[path], --to <changeset>, --from <changeset>Move staged file(s) to a different open changelist without unstaging/restaging. With path, moves that one file. Without it, moves every staged file - from the current changelist, or from --from <changeset> if given - to --to. --from applies only without a path (a path with --from is a usage error).
park-Set aside every open changelist on this mount (kept, and kept alive on the hub) so the branch/repository can be left without abandoning the work.
parked-List parked changelists with age + files.
resume-Restore parked work for the mount's current branch.
discard--changeset <id>, -y, --yesAbandon parked work (one with --changeset, else all). Asks first (it cannot be undone); --yes skips the prompt.
staged-base--changeset <id>, --entry <id>Return the exact hub version the staged row was based on. Hunk selection must diff against this, not the live head.
commit-plan--changeset <id>, --entry <id>, --path <path>, --partial <FILE>, --remainder <FILE>, -m, --message <String>Commit exactly one staged file's selected hunks (the exact content in --partial), leaving the remaining hunks staged in a fresh changelist against the new head. --remainder is the complete content to stage in the follow-up changelist (normally the full working file); it may be empty when every hunk was selected. The source must be the changelist's only staged file; it must be a regular UTF-8 text file without a BOM. An empty --partial commits a zero-byte file (the hub stores the canonical null root). No working-tree write is made by the engine; the extension saves the open buffer first. --path names the staged file; --changeset is its source changelist (from changelist list).
swarmfile changelist open -m "Reorganize asset folders"
# ...edit and save files...
swarmfile changelist status
swarmfile changelist submit
swarmfile changelist open -m "Swap all Act 2 plates to final grade"
swarmfile changelist open -m "Quick fix: wrong LUT on shot 12"
swarmfile changelist list
swarmfile changelist current a1b2c3d4
swarmfile changelist reopen "Renders/Act2/shot12.mov" --to e5f6a7b8
swarmfile changelist submit --id e5f6a7b8

agent#

A coding-agent session is a per-mount changelist labeled Agent: <name> (a header, not a trailer). agent start reuses an open same-name session or opens one and makes it current; saves stage there. agent done submits that session atomically and prints its changelist id, giving the agent a stable baseline without waiting for the other agents. It refuses to submit a current/--id changelist that is not an agent session. agent wait blocks until matching sessions are submitted. This uses the existing per-mount changelist and adds no server contract.

One mount per agent is the supported topology; a shared mount is one writer identity. For exact line-level attribution run one engine per agent with a distinct SWARMFILE_MACHINE_ID (a per-agent API key still needs its own engine). The label is claimed; the key/machine is the authoritative identity. Only open changelists are listed - parked and in-flight work is not included.

SubcommandFlagsDescription
start <name>-m, --message <String>Reuse one open Agent: <name> session (make it current) or open one; more than one open match is refused, and a parked match must be resumed first. One to 64 characters with no control characters. The note applies only to a newly opened session.
done--name <name>, --id <changeset>, -m, --message <String>Submit an open agent session atomically and print its changelist id. Defaults to the current changelist but refuses one that is not an agent session; --name requires exactly one match. A final note keeps the Agent: header.
status--name <name>List open agent sessions, their changeset, staged file count and current marker.
wait--name <name>, --timeout <secs> (default 600, 1-86400), --interval <secs> (default 2, 1-3600), --requireBlock until no matching open session remains; exits 1 on timeout, or when a matching session is parked (changelist parked resume first). Without --require, a name that is not open yet completes immediately; --require makes that a failure (with no name it requires at least one open session).
swarmfile agent start claude-1 -m "tighten the parser"
# ...the agent works...
swarmfile agent done --name claude-1
swarmfile agent status
swarmfile agent wait --name claude-1

agents#

agents show prints the current mount's .swarmfile/agents.yml; agents init writes a commented starter (refusing an existing file unless --force); agents check validates the TTL, conflict mode, branch prefix, concurrency, image, deny paths and upstream values and exits 2 on a bad file. The GitHub Action and MCP server read the same policy; the engine applies it on mounts new (TTL, conflict mode, paths_deny, max, checkpoint idle), the hooks use its TTL, and merge uses merge_diff3 when .swarmfile/merge.yml is absent.

SubcommandFlagsDescription
show--jsonPrint the policy as JSON instead of YAML.
init-f, --forceWrite the commented starter; overwrite an existing file.
check--jsonValidate the policy; JSON output when requested; exit 2 on errors.
swarmfile agents show --json
swarmfile agents init
swarmfile agents check

hosted-agents#

Reads the hosted agent control API for the active organization: the non-human agent identities, their live delegations, and the branch each delegation is scoped to. This is separate from the local agent changelist sessions and the agents policy file. The control surface is the hosted hub only - a community or self-hosted server serves none of it. The same commands mint and revoke agents and delegations and start, exec, log and stop a hosted session.

SubcommandFlagsDescription
list--jsonList the organization's hosted agents with a live-delegation count.
show <agent-id>--jsonOne agent and its delegations (branch scope, tier, role, creator, max-live, expiry, revoked).
keys <agent-id>--jsonThe agent's live scoped keys (id, kind, delegation, expiry); members see only keys on their own delegations.
create--name <n>, --kind <k>, --jsonCreate a non-human agent identity (owner/admin on the hub; the name must be unique).
delegate <agent>--branch <b> or --prefix agent/, --repository <id>, --tier branch, --role read|write, --ttl-days <1-30>, --deny-glob <g>…, --max-live-keys <1-100>, --service-mintable, --service-user <sub>, --max-token-ttl <60-3600>, --jsonDelegate a repository branch or the reserved agent/ workspace prefix. The repository defaults to the mounted one. An owner/admin may delegate any repository in the org; a member or guest needs the repository root write (be its creator or hold a whole-repository grant) and is capped at seven days.
sessions <agent-id>--jsonList the agent's sessions (state, delegation, stop reason); members see only sessions on their own delegations.
key <agent>--delegation <id>, --name <n>, --jsonMint a durable scoped key for the delegation. The plaintext key is printed exactly once. Owner/admin only on the hub; a member instead uses token on their own service-mintable delegation.
token <agent>--delegation <id>, --branch <b>, --ttl-seconds <60-3600>, --name <n>, --deny-glob <g>…, --jsonMint a short-lived service token (shown once) on a service-mintable delegation. The delegation's own ceiling caps the request; it defaults to 900 seconds unless the delegation was created with a larger --max-token-ttl (the server's hard maximum is 3600).
revoke-token <agent>--delegation <id>, --token <id>, -y, --yes, --jsonRevoke one service token.
session start <agent>--delegation <id>, --budget-micro-cents <n>, --ports <a,b>, --jsonStart a hosted session (owner/admin; materialize the branch, mint a session key, start the runtime). The session key is printed once.
session status <agent> <session>--jsonThe session state and stop reason (owner/admin, or the session's own session key).
session stop <agent> <session>-y, --yes, --jsonCheckpoint the workspace, revoke the key, stop and settle. Allowed for an owner/admin, the session's own key, or the delegation's creator/service user; a failed or absent checkpoint is reported and exits nonzero.
session exec <agent> <session> -- <cmd> [args]--jsonRun one command in the workspace (owner/admin, or the session's own key); prints stdout/stderr (or the hub's JSON) and exits 0 when the command succeeded, 1 on a failure or timeout, in both modes. It does not pass the command's own exit code through.
session logs <agent> <session>--after <seq>, --jsonThe bounded session event log, oldest first (owner/admin, or the session's own key).
disable <agent>-y, --yes, --jsonDisable the agent; the hub revokes its live keys immediately.
revoke-delegation <agent>--delegation <id>, -y, --yes, --jsonRevoke a delegation; the hub stops its sessions and revokes its keys.
revoke-key <agent>--key <id>, -y, --yes, --jsonRevoke one scoped agent key.
swarmfile hosted-agents list
swarmfile hosted-agents show <agent-id>

Human rows print the agent, delegation, session and key ids in FULL, because those are exactly the values the next command takes; only informational ids such as a creator are shortened. --json prints the hub's object untouched. The engine's proxy passes the hub's real 401/403/404 through, so a permission or missing-agent refusal is reported as itself rather than a gateway error. A 402 plan_restricted (for example service-token minting on the Free plan) exits 2, the same convention as the other CLI plan refusals.

A session checkpoint is clean only when the hub answers a 2xx {ok:true}. The web Agents view applies the same rule, so the terminal and the dashboard never disagree about whether a stopped session's changes landed.

hooks#

Coding-agent harness integration: give each agent session its own mounted agent/* workspace without the agent knowing Swarmfile exists. hooks install merges the hooks into a harness's settings; hooks run is the wrapper form for any command line. A session that cannot mount (no engine, no FUSE, a refusal) says why on stderr and exits 0; SessionStart may spend up to 120 seconds creating the workspace and 60 seconds waiting for it to attach (the installed hook timeout is 240 seconds), and hooks run exits 2 if it cannot mount.

hooks install#

Merge Swarmfile's hooks into a harness's own settings file: SessionStart opens the workspace and returns its path as context; PostToolUse (Write/Edit/MultiEdit/NotebookEdit/Bash/PowerShell; Codex also apply_patch) checkpoints after each mutating tool call and names the commit after the step; Stop is a turn-end backstop; and SessionEnd waits briefly, checkpoints, then archives the branch (or opens an MR).

Codex's 3-second SessionEnd closes the mount and leaves the archive to the TTL sweeper; --mr is refused for Codex hooks (use hooks run --mr -- codex). It also writes the harness's instructions file if absent.

Re-installing replaces Swarmfile's own hooks and leaves every other hook and an edited skill alone.

Argument / FlagDescription
<harness>claude-code, cursor, codex, or copilot. Claude uses .claude/settings.json + a skill; Cursor uses .cursor/hooks.json + a rule; Codex uses .codex/hooks.json + a skill (which it asks you to review/trust via /hooks); Copilot has no lifecycle hooks, so it gets a .github/agents/swarmfile.agent.md profile (repository-scoped).
--repositoryWrite the repository-level file (default). Check it in; teammates need swarmfile on PATH and the default cache.
--userWrite the user-level file instead (~/.claude/..., ~/.cursor/..., ~/.codex/...); commands pin the absolute binary and cache. Not valid for copilot. Cursor user rules are UI-managed, so only its hooks file is written.
--mrAt session end, open a draft merge request and keep the branch instead of archiving it. Refused for codex hooks; use hooks run --mr -- codex.
--label <L>Readable part of the workspace branch name (default: claude, cursor, codex or copilot for the chosen harness; 1-40 safe characters).
--ttl-days <1-30>Workspace lifetime (default .swarmfile/agents.yml, then 7).
--printPrint the settings this would write, without touching the file.

For a self-contained prompt you can paste into an agent (version-pinned, with the verification steps), see Coding Agents § Copy-paste install prompt.

swarmfile hooks install claude-code
swarmfile hooks install cursor
swarmfile hooks install codex
swarmfile hooks install copilot
swarmfile hooks install claude-code --user --mr

hooks run#

Mount a workspace, run the command with its cwd inside it, then checkpoint and finish the workspace. This is the reliable cwd path: a hook cannot change the agent's working directory. Installed hooks stand down while it runs (SWARMFILE_AGENT_MANAGED). It also exports the repository's .swarmfile/cache.yml redirects to the child, so installs/builds run by the agent use the shared dependency cache automatically.

FlagDescription
--label <L>Readable part of the workspace branch name (default agent).
--ttl-days <1-30>Workspace lifetime (default .swarmfile/agents.yml, then 7).
--mrOpen a draft merge request instead of archiving the workspace.
-- <command…>The command to run (everything after --).
swarmfile hooks run -- claude

hooks uninstall#

Remove Swarmfile's own hooks from a harness's settings (foreign hooks are preserved) and delete the generated instructions only if they were not edited. --repository (default) / --user select the scope; the harness argument is claude-code, cursor, codex or copilot.

hooks doctor#

Check that the harness's settings contain Swarmfile's lifecycle hooks and that the instructions file exists. --repository (default) / --user select the scope. Exits 1 with the missing pieces; it does not contact the engine.

The internal hook entry points (hooks session-start, hooks session-end, hooks checkpoint) are installed into the settings, not typed by hand.

switch#

Switch which branch this mount works on (like git switch) - hot and in-process, no engine restart. Same operation as branch switch. "This mount" is the --mount one, else the current mount (mounts current): the branch checks, -c's create, and the switch itself all act on that same mount. A mount that shares another mount's branch context can't switch on its own and is refused (shared_branch_context) - -c refuses before creating anything. The success line names the branch the engine reports it switched to.

Argument / FlagDescription
[name]Branch to switch to. Omit to return to the repository's default branch (usually main).
-c, --createCreate the branch first (forking from the current branch), then switch to it - like git switch -c. Errors if it already exists.

Refused while any changelist is open on that mount (exit 2 on the default mount; on any other mount the switch fails with the same reason, exit 1); submit or cancel all of them first.

swarmfile switch look-dev-b
swarmfile switch            # back to the default branch
swarmfile switch -c feature-x   # create + switch

restore#

Restore a scope (the whole repository, a folder, an entry, or a mount-relative path) to a past commit - a true tree snapshot, landed as one undoable commit (like git restore, but whole-repository by default). Locked files → exit 2, and a file the restore would change that has an unresolved conflict refuses with conflict_unresolved - resolve it first.

Argument / FlagDescription
[seq]A commit to restore to - #N, HEAD~N, a tag, a changeset id, or a 64-hex hash (see "Referring to a commit"). A branch name restores this mount's branch to that branch's head tree (it does not switch branches - that's switch).
--to <ref>The same commit ref as [seq], in the checkpoint spelling - swarmfile restore --to 482. Not with [seq] or --at-seq.
--at-seq <N>Commit number to restore to - instead of [seq], not with it (both at once is a usage error).
--path <path>Restore only this mount-relative path.
--folder-id <id>Restore a specific folder by ID.
--entry-id <id>Restore a specific entry by ID.
swarmfile restore 482                     # whole repository back to commit #482
swarmfile restore 482 --path shots/seqA   # just that folder

--json prints the engine's response plus targetSeq - the commit number the CLI resolved your ref to; the engine's own seq is the NEW commit the restore landed as.

checkout#

A Git-habit shim mirroring git checkout's overloading - prefer switch / restore, which say exactly what they do.

You typeWhat happens
checkout <branch>Switches to that branch (→ switch).
checkout <N> (a number, HEAD, HEAD~N)Restores to that commit (→ restore).
checkout <tag> / <hash> / <changeset-id> / a prefixed ref (tag:x, seq:5, hash:…)Restores to that commit - resolved exactly as restore resolves it. branch:x switches to x.
checkout -b <name> [<target>] (-b, --branch <name>)Creates a branch and switches to it - like git checkout -b. Forks from <target> (a branch, tag, or commit - same rules as branch create --from) or --at-seq <N>, else from the current branch. --path/--folder-id/--entry-id don't combine with -b (a branch is whole-repository).
checkout --at-seq <N> [--path …]Restores the version at that sequence number (the --at-seq form). Not combined with a <target>.

A bare number restores that commit unless a branch of that name exists - an existing branch wins even when its name is commit-shaped, as in git, and the CLI prints a note when it does. Force the branch with switch <name>, or force the commit with a hash:/seq: prefix.

show#

Show one commit: its message, author, time, and the files it changed (like git show). Whole-file - Swarmfile versions binaries, so there's no line-level diff.

ArgumentDescription
<rev>A commit - number, #N, HEAD, HEAD~N, or a tag (see "Referring to a commit" above).
swarmfile show 482
swarmfile show HEAD        # the latest commit
swarmfile show HEAD~2      # two commits back
swarmfile show v1.0        # a tag

show-tree#

Fetch and print a tree object by its content-addressed cid (like git ls-tree) - one level, not recursive: each entry's kind (d directory, f file, l symlink), name, and content cid. Get a cid from swarmfile show <rev>'s tree line.

A directory large enough to be stored segmented is listed a segment at a time - each segment is its own fetch, never one unbounded request for the whole directory.

A repository member's listing is filtered against the selected mount's branch view (the same ACLs a normal listing applies), so a cid taken from an old commit can come back partial or empty; owners and service callers see the object unfiltered.

Argument/flagDescription
<cid>A tree object's content-addressed cid (64 lowercase hex characters).
--auditWalk the tree and its child tree objects at their real depth and report symlinks that would escape. A tree stored before the object-PUT guard can carry one; a content address cannot be rewritten, so this is the read-only audit an operator acts on. Exits 1 on a finding.
swarmfile show-tree a1b2c3...
swarmfile show-tree a1b2c3... --audit   # audit a pre-guard tree's links (walk all child trees)

revert#

Undo a commit by landing a new commit that restores the prior versions of the files it changed (like git revert) - non-destructive, itself undoable, and it doesn't touch newer commits. Locked files → exit 2, and a file the revert would change that has an unresolved conflict refuses with conflict_unresolved - resolve it first.

ArgumentDescription
<seq>The commit to undo - a number (#N), HEAD~N, a branch, a tag, a changeset id, or a 64-hex hash (see "Referring to a commit").
swarmfile revert 482

rollback#

Restore one file to an earlier version, keeping the current version in history - the CLI form of the Desktop App's version picker. File-scoped and non-destructive, unlike revert, which undoes a whole commit.

Requires the file's write lock, and refuses (exit 2) if the file has uncommitted local changes, is locked, has an unresolved conflict, or changed since the version was chosen. Get the version id from swarmfile blame.

Argument / FlagDescription
<path>Mount-relative (or absolute) path to the file.
--at <id>The version's local history id - the #N column from swarmfile blame <path> for a local row. Synthetic (d1:<seq>) rows have no local restore key and are refused; cold-archived rows keep theirs.
swarmfile blame shots/seqA/plate_v3.exr   # find the version id
swarmfile rollback shots/seqA/plate_v3.exr --at 4182

describe#

Name, rename, or clear a commit's message after the fact - including an auto-saved commit that landed with no message (like git commit --amend -m, but for any commit and non-destructive). Author-or-admin only.

Argument / FlagDescription
<ref>The commit to describe - the full ref vocabulary (482/#482, HEAD~N, a branch, a tag, a changeset id, or a 64-hex hash).
-m, --message <String>The new message.
--clearRemove the commit's message.

Exactly one of -m / --clear is required. Alias: reword.

swarmfile describe 482 -m "v2 delivery to client"
swarmfile describe 482 --clear

diff#

Show what changed. With no argument (or a branch name) it previews what merging a branch into its base would change (like git diff main...); with two commits it shows the files that changed between them (like git diff A B); with one commit (any ref that isn't a branch) it shows what changed from that commit to the current branch head - git's diff <commit> compares against the working tree, and since saves sync as they happen here, the head is the closest equivalent. Whole-file: there's no line-level diff for a binary. Read-only - it writes nothing.

ArgumentDescription
(none) / [branch]Branch preview - the given branch (or this mount's) vs its base. A branch preview is only meaningful for a non-main branch (main has no base → 400).
<commit>That commit vs the current branch head - any non-branch ref (HEAD~3, a tag, a hash, tag:x, …).
<A> <B>Two-commit diff - files changed between commit A and B. Each accepts the full ref vocabulary: a number, #N, HEAD, HEAD~N, a branch, a tag, a changeset id, or a 64-hex hash (prefixes force a kind).

--format=unified/side-by-side renders a branch preview's or commit range's content in the terminal; auto selects unified on a TTY and stat on a pipe. Side-by-side underlines the changed words within paired lines. Content reads stop at 8 MiB per file / 64 MiB total / 50k lines, and binary, encrypted-unavailable or oversized files are listed with the reason. Commit ranges carry both content CIDs in the hub response, so they render the same way.

swarmfile diff              # this branch vs its base
swarmfile diff look-dev-b   # a named branch vs its base
swarmfile diff HEAD~3 HEAD  # what changed over the last three commits
swarmfile diff v1.0 v2.0    # between two tags

blame#

Who last changed a file, plus its version history with authors. The default is whole-file (one row per saved version). With --lines, Swarmfile derives line-level attribution from the saved versions: each line is credited to the version/writer that last introduced or replaced it. Content is read client-side, so this works on managed and end-to-end encrypted repositories. For E2E repositories the key never leaves the engine; managed repositories are decrypted by the engine with the repository key, which the hub manages.

ArgumentDescription
<path>Mount-relative (or absolute) path to the file.
--branch <name>Read this path's history on another branch (read-only) instead of the selected mount's - that branch's metadata is synced on demand, and the path must exist there.
--linesLine-level attribution. Text files only (UTF-8, no NUL bytes).
--max-versions NHow many saved versions the line walk reads (default 100, range 1-500; out-of-range is refused). It is enforced at page granularity - a page can add up to 50 versions beyond the limit. Older lines outside the window are reported as unknown/truncated.
--summaryPrint per-writer line counts instead of every line range. Requires --lines; ignored with --json (which prints the raw ranges).
--include-textWith --lines --json, also return the attributed head file content (headText) - the baseline an IDE uses for a quick diff. Requires --lines.
--include-versionsWith --lines --json, also return every walked version's text (versions) - the historical sides an IDE diffs against. Requires --lines.
swarmfile blame shots/seqA/plate_v3.exr
swarmfile blame --lines src/foo.ts
swarmfile blame --lines --format=gutter src/foo.ts
swarmfile blame --lines --summary src/foo.ts
swarmfile blame --lines --json src/foo.ts

Line attribution is exact to the version's writer. Within one version pair, a rewrite larger than the bounded line alignment is credited to the newer version as a whole. To attribute separate agents exactly, run one engine per agent with a distinct SWARMFILE_MACHINE_ID (or a per-agent API key; a key is process-wide, so it still needs its own engine). A shared mount is one writer identity: the engine cannot tell which process inside it saved a line.

Lines present in a recorded merge/rollback parent inherit that parent's author; lines present in no parent belong to the merge/resolution actor.

On the hosted hub, clean branch merges record target/source CIDs and copy up to 30 source content-history rows (authors and parent links) into the target entry as local side rows for modified files and branch-only adds. The rows are only served when the caller can read the source entry.

The community server's history has no copied source rows, so a merged line there is credited to the merge actor. Source copy requires the retained window to reach a create/copy base; history beyond that window falls back. Branch-only add copies are base-aware; their old source history is capped at 30 versions. Staged changelist work is not included until it is submitted; --lines says so when it detects an open changelist on the requested mount. Parked and in-flight work is not detected by that flag.

The line view works against the hosted hub and against a community server's changeset history. The line view is capped at 8 MiB per version, 64 MiB total, 50,000 lines and 20,000 attribution ranges; a version open and each 4 MiB read slice have a 30-second timeout, and the whole read is bounded at 170 seconds. A deep/cold history may return blame_timeout - lower --max-versions and retry.

The first older version that cannot be read is listed under unavailable with a code (binary_file, not_utf8, too_many_lines, file_too_large, content_unavailable - including a timed-out version read - or key_unavailable when that version names a key generation this device does not have yet).

Synthetic versions (d1:<seq>, no local history row) are line-blame only and are not locally restorable; cold-archived rows keep their local restore key.

changesets list#

The commit log, newest first, scoped to the branch this mount is on (or another named branch, read-only).

FlagDescription
--limit <N>Default 50
--offset <N>Default 0
--branch <name>Read another branch's log without switching mounts. Omitted = the selected mount's branch.

branch#

Branch management.

SubcommandFlagsDescription
gc--older-than-days <DAYS>, --dry-run, -y, --yes, --limit <N>, --repository <ID>Archive expired ephemeral workspaces now (manual expiry sweep). Owner/admin only; only ephemeral rows are touched. --dry-run lists the due rows; a real sweep requires --yes; --older-than-days (default 0), --limit (1-500, default 20) and --repository (defaults to this mount's repository) bound it.
list--allActive branches for this mount's repository. Each row carries its head commit's hash (headCommitHash; null when no head hash is recorded), creator, age/expiry and kind. Ephemeral agent/<label>-<6 hex> workspaces are hidden unless --all; a bare agent/foo stays visible.
create<name>, --from <REF>, --from-commit <seq>, --from-tag <tag>Fork a new branch (defaults to forking from the selected mount's branch's live head, like switch -c). --from takes the full ref vocabulary: a branch forks that branch (an empty one included), a tag forks its commit, and a seq/hash/changeset id forks that commit with the source branch derived from it. --from-commit/--from-tag are the explicit forms; combining a branch --from with one of them is allowed and the hub refuses the fork if the point belongs to a different branch (branch_mismatch), while a second explicit point (a tag/seq --from plus --from-commit/--from-tag) is refused up front.
switch[name]Switch which branch this mount (--mount, else the current mount) works on. Omit name to switch back to the repository's default branch (usually main).
archive<name>Soft-archive a branch (the repository's default branch cannot be archived). Exit 2 on an actionable refusal: unknown branch, the repository's default branch, a protected branch archived by a non-admin, a branch another active branch is based on (branch_has_active_children), one still named by an open merge request (branch_has_open_mr), a branch with a merge in progress (merge_in_progress, 409), or a branch in an archived repository (repository_archived, 403). A merged/closed MR doesn't block, so mr merge --delete-branch still works.
merged-Branches with nothing left to land - a branch-vs-base diff with no changed files and no conflicts (the same computation diff <branch> shows). The repository's default branch is never listed, a branch whose diff can't be computed is excluded rather than assumed merged, and a branch an open mount is working on is marked in use.
rename <name> <new-name>-Rename/promote a branch. The branch id is stable, so history, comments, MRs and locks follow; an ephemeral workspace becomes a named branch and loses its TTL. A protected branch requires an org admin (exit 2). The hub refuses a rename into or out of the reserved contrib/ namespace (fork proposals) with contrib_branch_reserved.
restore <name>--ttl-days <1-30>Restore an archived branch. A restored ephemeral workspace gets a fresh TTL (the hub's configured EPHEMERAL_TTL_SECS, otherwise 7 days; --ttl-days overrides); a named branch is TTL-free.
prune-y, --yes, --include-ephemeral, --older-than <30m|12h|7d>, --owned-by <user-id>Archive every prunable branch merged lists, after naming them and confirming. Never archives a branch an open mount on this machine is on. Ephemeral agent/<label>-<6 hex> workspaces are skipped unless --include-ephemeral is given (their normal cleanup is mounts close --archive). --older-than uses last activity/creation time; --owned-by takes a user id or me; both fail closed when metadata is missing. --yes skips the prompt; --json without --yes returns a confirmation_required error instead. The result lists archived / refused / failed by name. Exits 2 if any branch was refused (protected, etc.), 1 on a transport error.
protect<name>, --required-approvals <N>Refuse a direct merge into this branch and every direct write to it (saves/edits/renames/moves/creates/deletes, staging/committing, rollback, conflict resolution, LFS reflect) - changes land only through an approved Merge Request. --required-approvals (1-10, default 1) sets this branch's approval floor - an unprotected branch otherwise requires none; a matching protection rule's own count can raise it further (the effective count is the MAX of both). The CI-checks-required gate (--require-checks-to-pass) is a protection-rule-only flag, not available per-branch here - protect via a single-branch (no-wildcard) rule instead if you need it without a pattern. Org-admin-gated.
unprotect<name>Clear a branch's protected flag. Org-admin-gated, same as protect.
backfill--dry-run, --ttl-days <1-30>, -y, --yes, --json, --repository <ID>Classify existing agent/<label>-<6 hex> branches that predate the expiry lifecycle as ephemeral so the expiry reaper manages them. Dry-run by default; --yes writes the classification and --ttl-days sets the new expiry (default 7, or the deployment's EPHEMERAL_TTL_SECS/SWARMFILE_EPHEMERAL_TTL_SECS). Classification is capped (repository plus per-user/per-key, overflow); the CLI follows nextAfter and --json emits one aggregate envelope with truncated. Owner/admin only.
set-commit-mode<name>, [mode]Lock (or unlock) this branch to a commit mode - overrides the repository's own lock, if any, while set. mode is auto-commit, staged, or omitted/unset to clear it back to unenforced-at-branch-scope (the repository's lock, if any, still applies). Already-open sessions/changelists are grandfathered: this only affects the next commit/changelist open, never one already in progress. Org-admin-gated: exit 2 on forbidden (403) or an unknown branch (404); any other failure is exit 1.

branch switch is hot - no engine restart. It's refused (exit 2) while any changelist is open; submit or cancel all of them first. With the global --mount <id>, it retargets that mount only (a mount sharing another mount's branch context can't switch on its own and is refused with shared_branch_context - open an independent mount instead); a branch that doesn't exist can't be switched to. branch create never touches the running mount either, even with --from-commit/--from-tag - creating a branch doesn't change which branch this mount is checked out to. protect/unprotect exit 2 on forbidden (non-admin caller), not_found (unknown branch), or (protect only) an out-of-range --required-approvals (400) - distinguishable business states, not a crash - and exit 1 on anything else.

swarmfile branch create recover --from-commit 482
swarmfile branch create recover --from-tag v1.0

protection-rule#

Glob-pattern branch protection - additive on top of branch protect/unprotect's per-branch flag. A rule like release/* protects every branch whose name matches it, including ones created after the rule was added; a pattern with no wildcards is just another way to protect one exact branch.

SubcommandFlagsDescription
list-Protection rules for this mount's repository. Org-admin-gated, like create/delete: exit 2 on forbidden.
create<pattern>, --required-approvals <N>, --require-checks-to-passCreate a rule. * matches any run of characters, ? matches exactly one. --required-approvals (1-10, default 1) is this rule's contribution to the approval floor for every branch it matches - see branch protect's row above. --require-checks-to-pass refuses a merge unless every CI check that has reported a run at the request's exact current head shows its latest run passing. A check whose latest run is at an earlier commit is not carried forward as still-required; if no check has reported at the head at all, the gate fails closed rather than passing vacuously. This flag exists only here, at the rule level; there's no per-branch equivalent on branch protect itself. Org-admin-gated: exit 2 on forbidden (403), invalid_pattern/invalid_required_approvals (400), or pattern_taken (409); exit 1 on anything else.
delete<pattern>Delete a rule by its exact pattern text. Exit 2 on forbidden or not_found, same convention as create.
add-reviewer<pattern>, <principal-id>Add an auto-reviewer - every merge request opened against a branch this rule matches automatically requests a review from this principal. Additive to manually-requested reviewers, never a replacement. Idempotent. Org-admin-gated.
remove-reviewer<pattern>, <principal-id>Remove an auto-reviewer from a rule. A no-op if they weren't one. Org-admin-gated.
list-reviewers<pattern>List a rule's configured auto-reviewers. Human output shortens each id (user 1a2b3c4d…); --json carries the full ids that add-reviewer/remove-reviewer take. Org-admin-gated.
swarmfile protection-rule create "release/*" --required-approvals 2 --require-checks-to-pass
swarmfile protection-rule list
swarmfile protection-rule add-reviewer "release/*" <principal-id>
swarmfile protection-rule list-reviewers "release/*"
swarmfile protection-rule delete "release/*"

tag#

A repository-scoped, immutable named pointer to a commit - "branch from tag" is "branch from commit, resolved via a name." A tag also pins the commit it names against history retention, so checkout/restore to it keeps working while the tag exists; deleting the tag releases the pin. There is no move/repoint subcommand: to repoint a name, delete it and create it again. (With git access on the repository, a lightweight tag can also be moved or deleted over the git remote - see Cloning a Repository with Git.)

SubcommandFlagsDescription
list-Tags for this mount's repository. Each row carries the tagged commit's hash (commitHash; null when no hash is recorded for the tagged commit).
create<name>, [REF], --at <ref>, --at-seq <seq>, --on-branch <branch>Tag a commit. REF takes the full vocabulary (N/#N, HEAD~N, a branch, a tag, a changeset id, a 64-hex hash; prefixes force a kind); --at-seq N is the bare-number shorthand. Omit the ref to tag the CURRENT head of the selected mount's branch, or of --on-branch (which must name an existing branch - checked with every form, --at-seq included). Errors if the branch has no commits yet. Needs repository-wide write (see Permissions); exit 2 on that refusal (403).
delete<name>Delete a tag. Real delete, not soft - a tag has no archived state. Same access and exit 2 on 403 as create.
swarmfile commit -m "final render pass"
swarmfile tag create v1.0
swarmfile tag create v0.9 --at-seq 482
swarmfile tag list
swarmfile tag delete v1.0

query#

A fixed-filter query over branches, commits, changes, or entries. Predicates are space-separated: type:branch|commit|change|entry, branch:<glob>, author:<me|id>, since:<unix>, until:<unix>, text:<substring>, path:<glob>, limit:<N> (1-500), and order:name|time. ACLs stay hub-side.

Predicates are type-checked: branch: applies to type:branch and type:commit (a commit glob expands through the branch catalog, bounded to 50 branches, and merges by commit sequence); text: applies to commits and changes; path: applies to entries only.

type:change is the repository activity feed (every activity kind), has no branch/path field, and its since:/until: are forwarded to the hub's window. type:entry is the mounted repository's current (root) folder listing; path: on it is a name glob (there is no recursive path walk yet).

author:<id> asks the hub for the enriched lastModifiedById (the raw idp subject); lastModifiedBy is a display name for rendering only. author:me needs a signed-in OIDC identity - an API-key session has no user id and exits with author_me_unresolved (use author:<id>). Entry author: needs the hosted enriched listing; a community or older hub returns enrichment_unavailable (use type:commit there; the community cut does not serve the authenticated activity feed).

order:name applies to branches and entries; order:time sorts entries by mtime/ctime, changes by their activity time, and commits by their commit time.

--json emits {kind, items, nextCursor, truncated}; the human form prints the matching rows. nextCursor is the last item's key (informational - the grammar has no cursor predicate yet). One local changeset page is capped at 200 and one activity page at 100, so truncated can be true even when fewer than limit: rows are returned; a 50-branch glob that drops matches also sets it. Entry since: uses the entry's mtime/ctime fields, which are best-effort metadata. type:entry lists one page (up to 500 rows); truncated reports the cap. type:change uses the hub's default 7-day activity window unless since:/until: is given.

swarmfile query "type:commit branch:main since:1790000000 limit:20"
swarmfile query "type:change since:1790000000 limit:50"
swarmfile query "type:entry path:*.rs author:<id>"
swarmfile query "type:branch author:me order:time" --json
FlagDescription
--jsonEmit the machine-readable result instead of the summary.
--mount <id>Query through this mount's repository instead of the current one.

ref#

A thin read-only grouping over branches and tags - for the two questions that need both listings at once. branch and tag remain the full commands for acting on either.

SubcommandFlagsDescription
list-Every named pointer: branches (the current one marked *) and tags, together - each carrying its head/tagged commit hash.
resolve <name>-Say what a ref resolves to under the same resolver every other command uses - the kind (branch, tag, seq, head, hash, changeset) and commit number restore/checkout/log would act on - with a note (alsoMatches in --json) when the name also matches another kind: a branch wins over a same-named tag, and tag:<name> selects the tag. Exit 1 if it doesn't resolve.
swarmfile ref list
swarmfile ref resolve v1.0

release#

Publish a tag as an immutable, public release - a static, cached snapshot of that tag's tree, served anonymously for browsing and for full downloads (a quick proof-of-work check per download, no account needed).

Requires the repository to already be plaintext-tier and public (every public repository is plaintext-tier, on any plan - see Billing and plans); publishing enqueues a combined-archive build, so a fresh release starts pending and moves to ready (or failed) asynchronously.

list/create/preflight are scoped to this mount's own repository; fetch is not - it pulls from ANY public repository by org/repository slug, since a public release needs no org membership and no account.

A release can also carry assets: named binaries attached to it without living in the repository tree (no manifest entry, no combined archive, no clone history). They are served anonymously at /public/<org>/<repository>/assets/<name> on the hub, which is how build artifacts ship alongside the tagged source; attach uploads one, assets lists them, detach removes one, and re-attaching the same name replaces it.

SubcommandFlagsDescription
list-Releases published for this mount's repository, each with the id delete takes, its status (pending/ready/failed), and the tagged commit's commitHash (null when no hash is recorded for the tagged commit).
preflight<tag>Report exactly what create <tag> would do, publishing nothing: the gates (public/plaintext, your authority, verified email), the file count and size that would become public, the paths .swarmfile/publicignore.yml keeps out, the paths .gitignore/.swarmfileignore hide from the web browser that would still publish, and whether the tag's policy differs from the default branch's current one (the fixed-the-policy-but-didn't-re-tag trap). Exit 0 when the tag is publishable, 2 when it isn't (the reason is printed, including publicignore_clone_exposure when the release would hide paths while anonymous cloning is on - turn anonymous cloning off, then retry), 1 when the check itself failed.
create<tag>Publish a tag. Re-running this on an already-published tag is a no-op unless the prior attempt failed non-permanently, in which case it retries. Exit 2 on a defined refusal: not plaintext+public (409), the tag's prior publish failed permanently (409 - publish a new tag instead; a terminal publicignore_invalid from a committed .swarmfile/publicignore.yml lands here, so fix the file and publish a new tag), publishing a release that hides paths while anonymous cloning is on (409 publicignore_clone_exposure - turn anonymous cloning off with swarmfile git anonymous-clone off, then retry; once the release is ready, turning it back on does not re-expose those paths), the tag doesn't exist (404), the repository isn't provisioned on the hub yet (501), or you lack the access to publish (403 - see Permissions; this includes a folder in the tag you're denied read on, and an unverified email).
delete<id>Unpublish. Real delete, not soft, and needs the same access as create (see Permissions). Find id via list's output first. Exit 2 on 404 (already unpublished, or a typo'd id) or 403 (you lack the access to publish, so you can't unpublish either).
attach<tag> <file>, --name <name>, --content-type <type>Upload a local file as an asset of the release named by tag (see list). The file's basename is the asset name unless --name overrides it; --content-type overrides the type derived from the file name. The engine computes the SHA-256 the hub displays. Re-attaching the same name replaces it. Files up to 100 MiB stream through the hub; larger files (up to 5 GiB) upload directly to the repository's storage with a presigned URL. Exit 2 on a defined refusal: a bad name (400), no authority (403), a missing release (404), too many assets (409), a file over the 5 GiB cap (413), or a repository bucket that cannot accept a direct upload when the file is over 100 MiB (409 presign_unavailable).
assets<tag>List the release's attached assets (name, size, content type, SHA-256).
detach<tag> <name>Remove one attached asset. Exit 2 on 404 (no such asset) or 403 (no authority).
fetch--org <slug>, --repository <slug>, --tag <name>, --path <path>, --out <path>, --into <org>/<repository>Fetch one file from the release's manifest, or (if --path is omitted) the whole release as a combined .tar. No account is needed: the download passes a one-time proof-of-work check. --org/--repository are slugs, matching the public URL shape, not internal ids. With --into, nothing is written to disk: the release is copied straight into that repository by the engine - the same client-side copy as clone … --into (see Version control), which seals the blocks on this machine so a private destination works - --out is then not required, and --path narrows the copy exactly as it narrows an archive. The copy runs as a long operation (--no-wait, `swarmfile op status

Browsing a published release anonymously (no account, no CLI) is a web-hosted page, not a CLI surface - the same split share describes for share links.

swarmfile tag create v1.0
swarmfile release preflight v1.0
swarmfile release create v1.0
swarmfile release attach v1.0 dist/widgets-1.0-macos-arm64.tar.gz
swarmfile release assets v1.0
swarmfile release detach v1.0 widgets-1.0-macos-arm64.tar.gz
swarmfile release delete rel_9f2a
swarmfile release list
swarmfile release fetch --org acme --repository widgets --tag v1.0 --out widgets.tar
swarmfile release fetch --org acme --repository widgets --tag v1.0 --path docs/readme.md --out readme.md
swarmfile release fetch --org acme --repository widgets --tag v1.0 --into myorg/private-widgets

merge#

Merge this mount's branch into the branch it was forked from - its parent (usually main, but a branch forked from a non-main branch merges back into that one). The target is implicit: a branch already knows its own parent, so there's no target flag. A merge that would change an entry with an unresolved conflict is refused with conflict_unresolved - resolve it first, then re-run.

FlagDescription
--from <branch>Merge FROM this branch instead of the selected mount's own - land a branch you aren't standing on. The target is still the source's parent (main, or whatever it was forked from).
--record-conflictsRecord each conflict for interactive resolution (the Conflicts page or conflicts) instead of only listing them.
--diff3On a merge conflict, batch-resolve every text-file content conflict with the engine's three-way merge before giving up, then retry the merge once. Never lands a partial merge on its own. Overrides a repository's .swarmfile/merge.yml diff3: false. Mutually exclusive with --no-diff3.
--no-diff3Force diff3 auto-resolve off for this invocation, even if the repository's .swarmfile/merge.yml declares diff3: true. Mutually exclusive with --diff3.
--dry-runPrint what the merge would change - added, modified, deleted, renamed, and conflicting files, the same read-only diff swarmfile diff <branch> shows - and stop. Nothing is staged and no merge lock is taken.
--waitLarge merges apply in the background; the command otherwise returns as soon as the merge is accepted. Block and poll until the apply finishes, printing each phase. Gives up after ten minutes with exit 2 and explains how to resume or roll the merge back.
swarmfile branch create feature-x
swarmfile branch switch feature-x
# ...work, commit...
swarmfile branch switch
swarmfile merge --record-conflicts

mr#

Open, list, inspect, review, and land Merge Requests - the propose → review → approve → merge gate that sits on top of merge above.

SubcommandFlagsDescription
create--title <title>, --from <branch>, --body <text>, --draftOpen a merge request from --from into its base branch. --from defaults to whatever branch this mount is currently on. Prints the branch-vs-base diff preview (same as diff <branch>) before opening it, so you see what a reviewer will see. --draft opens it as a draft - reviewable and commentable, but mr merge refuses it, and the usual "new merge request" notification never fires for it at all (not deferred - marking it ready later doesn't retroactively send the one it skipped).
list--status <open|merged|closed|all> (default open), --limit <N>, --label <label-id>, --assigned-to <principal-id>Merge requests for this mount's repository. --limit is a hint the hub caps at 500 regardless. --label/--assigned-to filter server-side - see label list/assignees, requested reviewers, and labels for where the ids come from. --assigned-to matches the assignee role specifically, not a requested reviewer.
status<number>Branch names, who opened it, approval state, per-reviewer verdicts, assignees/requested-reviewers/labels, and changed-file count for one merge request, by its display number (the "3" in "MR-003"). Exit code doubles as a CI gate: 0 approved, 2 open but not yet approved, 1 any other error. It also prints the source stamp (h1:…) for the content it showed; --json carries it as sourceContentStamp.
diff<number>The merge request's live diff - the files it would change (A/M/D/R) plus any conflicts, rendered exactly like diff above. Read-only, recomputed fresh by the hub on each call. If the MR's source branch was archived/deleted the hub has no diff and this says so, rather than printing an empty list that reads as "no changes."
approve<number>, --note <text>, --acknowledge-no-preview, --source-stamp <h1:…>, -y, --yes, --no-bindApprove a merge request. Refused (self_review) if you opened it yourself. When the merge request is too large to preview (mr diff says so), approving means approving changes you haven't seen, so it is refused (preview_too_large, non-zero exit) unless you pass --acknowledge-no-preview; otherwise review it in the web app. --source-stamp binds the approval to the content mr status showed you: if the source branch changed since, it is refused (source_changed, exit 2: the merge request changed since you viewed it, so review it again). Without the flag, an interactive run prints which merge request and branches it is approving and the stamp it binds to, then asks Send this approval? [y/N] (--yes skips the question). If the read fails it warns and refuses (exit 2) unless you pass --no-bind, so an approval is never sent unbound silently; --yes sends it unbound only when the hub reports no stamp at all. --no-bind sends it unbound on purpose. A script (no terminal, or --json) without --source-stamp or --no-bind is refused (exit 2) unless SWARMFILE_MR_ALLOW_UNBOUND=1 is set.
request-changes<number>, --note <text>, --source-stamp <h1:…>, -y, --yes, --no-bindRequest changes on a merge request - blocks merge below until a later review from the same reviewer approves it, or an org owner/admin dismisses it (dismiss-review); a new commit does not lift it. Same self-review restriction as approve, and the same --source-stamp/--yes/--no-bind binding rules (the stamp is recorded with the review).
review-comment<number>, --note <text>Leave a non-blocking "Comment" review - shows up in the review history but never counts toward the approval floor and never blocks merge. Unlike approve/request-changes, allowed on your own merge request. Distinct from comment/comments below, which post to the discussion thread, not the formal review history.
dismiss-review<number>, <review-id>, --reason <text> (required)Dismiss one approval or request for changes so it no longer gates merge - a "request changes" otherwise blocks until that reviewer reviews again (a new commit does not lift it). Org owners and admins only (dismiss_forbidden), on any open merge request, their own included. The review id is reviews[].id in status --json.
ready<number>Mark a draft merge request ready for review - lifts merge's draft refusal, and notifies the merge request's current assignees and requested reviewers (mr_ready). Opening it as a draft suppressed the one-time "new merge request" notification, which is not re-sent. One-directional: there's no way back to draft. Refused (not_draft) if it isn't currently a draft, or (invalid_state) if it isn't open.
merge<number>, --record-conflicts, --delete-branch, --diff3, --no-diff3Land an approved merge request - same conflict detection as merge above, including the --diff3/--no-diff3 override flags. Refused with not_approved unless enough reviewers have approved (zero on an unprotected branch; a protected target branch or rule raises the floor, 1-10), nobody's latest verdict is "request changes," and (if the target requires it) CI checks pass. Refused with is_draft while the merge request is still a draft - run mr ready first. --delete-branch archives the source branch once the merge has actually landed - opt-in, off by default; a failed archive (e.g. the branch got protected in the meantime) never fails the merge itself, just prints a warning.
close<number>Close a merge request without merging it.
reopen<number>Reopen a closed merge request. Refused (invalid_state) unless it's currently closed - a merged merge request can never be reopened.
comment<number>, -m, --message <text>Post a comment to a merge request's discussion thread - the same thread the web dashboard's merge request page shows.
comments<number>List comments on a merge request's discussion thread.
assign<number>, <principal-id>Assign a principal (user or group id - see admin nodes/the web dashboard's people picker for ids) to land this merge request. Idempotent: assigning someone already assigned is a no-op, not an error.
unassign<number>, <principal-id>Unassign a principal. A no-op if they weren't assigned.
request-review<number>, <principal-id>Request a review from a principal - distinct from assign (who lands it). Idempotent.
unrequest-review<number>, <principal-id>Withdraw a review request. A no-op if none was pending.
label<number>, <label-id>Attach a label (from label list below) to this merge request. Idempotent.
unlabel<number>, <label-id>Detach a label. A no-op if it wasn't attached.
swarmfile mr create --title "Warmer facade material"
swarmfile mr create --title "WIP: new roof profile" --draft
swarmfile mr ready 4
swarmfile mr list
swarmfile mr list --label <label-id> --assigned-to <principal-id>
swarmfile mr status 3
swarmfile mr diff 3
swarmfile mr approve 3
swarmfile mr request-changes 3 --note "needs another pass"
swarmfile mr merge 3
swarmfile mr close 3
swarmfile mr reopen 3
swarmfile mr comment 3 --message "Looks good once the fascia texture is swapped."
swarmfile mr assign 3 <principal-id>
swarmfile mr request-review 3 <principal-id>
swarmfile mr label 3 <label-id>

approve/request-changes/merge/close put every review action a terminal command away. The hub refuses a review from the merge request's own creator; an approval from a second credential counts, so treat review-capable credentials like any other approval authority in your org. branch protect --required-approvals raises the bar for a unilateral change.

label#

A repository's label registry - the tags mr label/mr list --label above attach to and filter by. See assignees, requested reviewers, and labels.

SubcommandFlagsDescription
list-This mount's repository's label registry.
create<name>, --color <#RRGGBB>Define a new label. Org admin/owner only.
update<label-id>, --name <name>, --color <#RRGGBB>Rename and/or recolor a label in place - the alternative to delete-and-recreate, which would drop every existing merge request's attachment. Both flags optional; an omitted one is left unchanged. Org admin/owner only.
delete<label-id>Delete a label - cascades off every merge request it was attached to. Org admin/owner only.
swarmfile label list
swarmfile label create bug --color "#FF5733"
swarmfile label update <label-id> --name defect --color "#000000"
swarmfile label delete <label-id>

rfi#

RFIs and Submittals - the AEC request-for-information / approval workflow, the same feature the dashboard's RFI panel drives. Every command here (other than create/list/search/by-file) takes an RFI, and you can name it either way: the friendly display number (RFI-003, case-insensitive - resolved through the mounted repository) or its internal id from rfi create's or rfi list's output. Resolving a number needs a mounted repository and the same read access the detail view has.

SubcommandFlagsDescription
create <path>--title, --body (required); --priority <low|normal|high|urgent>; --due-at <unix-s>; --assigned-to <id>; --reviewer <id> (repeatable); --kind <rfi|submittal> (default rfi); --draftOpen an RFI (or, --kind submittal, a Submittal) rooted at a mount-relative folder - same path resolution as comment/watch. Needs write there. --draft creates it unsubmitted; call submit when ready.
list--status, --priority, --ball-in-court <originator|reviewer|both>, --kind, --assigned-to, --due-before <unix-s>, --outstanding, --limit, --offsetRFIs/Submittals matching the filters. --outstanding narrows to the same still-needs-attention set (excludes closed/void/draft) the file-browser's badge uses.
status <id>-Full detail, including decision history. Exit 0 if answered/closed (someone has responded), exit 2 for every other state (draft/open/in_review/void) - a CI/pre-merge gate can check "has this been answered."
update <id>--title, --body, --priority, --due-at, --assigned-to, --ball-in-courtChange mutable fields - every flag optional, only the ones given change. Originator-or-owner only.
submit <id>-draft → open. Originator-or-owner only.
acknowledge <id>-open → in_review - a reviewer marking they've seen it. Assigned-reviewers only.
close <id>-answered → closed. Originator-or-owner only.
void <id>-any → void - abandon it (terminal, leaves the number gap). Originator-or-owner only.
decide <id> <decision>-m, --message <text> (required); --signature-kind <click|drawn>; --signature-blob; --comment-idRecord a decision - an RFI's answer, or a Submittal's review outcome. decision is one of approved, rejected, revisions_requested, answered, commented, approved_rev_a, approved_rev_b, approved_as_noted, rejected_as_noted - the last four are Submittal-only; the hub doesn't itself reject a mismatched kind, so check status <id>'s kind first. Comment-or-above ACL.
decisions <id>--limit, --offsetThe decision audit trail, oldest first.
assign <id>--add <principal-id[:role]> (repeatable), --remove <principal-id> (repeatable)Add/update or remove reviewer-role assignments. role is reviewer (default)/observer/originator. Admin-gated.
attachments <id>-Files attached under the RFI's root.
search <query>--repository-id, --limitFull-text search over title and body, ACL-filtered to what you can read. Defaults to the mounted repository; pass --repository-id to search a repository this engine isn't mounted on.
by-file <path>-Resolve the RFI (if any) that owns a file - the CLI equivalent of the dashboard's right-click "Open RFI thread."
swarmfile rfi create ./Repositories/tower-a/foundations --title "Slab thickness at grid C4" --body "Drawing S-201 shows 300mm, spec calls for 350mm - which governs?" --priority high --reviewer user_88
swarmfile rfi list --outstanding
swarmfile rfi status rfi_9f2a
swarmfile rfi decide rfi_9f2a answered -m "350mm per spec - drawing will be revised"
swarmfile rfi status rfi_9f2a   # now exits 0

ec-placement#

Deliberate erasure-coded shard placement across LAN peers.

SubcommandDescription
statusWhether this mount currently has deliberate LAN shard placement on.
enableTurn on deliberate LAN shard placement.
disableTurn off deliberate LAN shard placement.

ec-placement enable/disable restart the engine to take effect.

Placement spreads shards across your LAN peers, which are normally found by mDNS. If your network blocks mDNS multicast (common on corporate/VLAN'd networks), the office won't be discovered and every shard falls back to this machine - set lan_from_office (see Engine Config File) so same-office peers count as LAN.

shards <path>#

Where a file's erasure-coded shards live across the office - for each piece, the machines it's assigned to and whether this one holds it. Requires ec-placement enable and a live P2P fabric. The command opens with a per-file summary: how many chunks and shards the file has, whether this machine holds enough shards (k per chunk) to reconstruct it alone, and whether placement actually assigned every shard to K peers - so "is this file protected in the office, and from where" is one line instead of counting rows.

Day-to-day#

status#

This mount's engine, peers, and settings at a glance, including a drive: line (mounted, starting, or failed with its reason). The text is human-oriented - use --json for scripts. It also prints the mounted branch's head commit pin when one is known (head commit: <12-char> (<full hash>)) so a script can capture the exact commit this workspace is on.

An engine started with SWARMFILE_CONFLICT_MODE pinned prints the mode it pinned (conflict mode: hard (pinned by SWARMFILE_CONFLICT_MODE)); per-drive pins show in mounts list / mounts status instead.

pending uploads counts this mount's repository. When another repository still has saves uploading (one you switched away from keeps uploading in the background), the line adds (N more in other repositories) and one indented line per such repository follows, named when the engine has seen the repository's name and by id otherwise, with any saves held there by a refusal. --json carries the same as pendingUploadsAllRepositories and pendingUploadsByRepository.

--changes swaps that for a Git-status-like summary of what's outstanding on this mount: the current changelist's staged files and any blocked conflicts. There's no "modified but unsaved" state to show - saves either stage into the changelist or commit immediately - so "staged" plus "conflicted" is the whole picture.

swarmfile status            # engine, peers, drive, settings
swarmfile status --changes  # staged files + conflicts

storage#

Storage accounting for the mounted branch: the live file tree's logical bytes (including local-only rows such as an imported dependency layer), this machine's local block cache (bytes, block count, pinned count, cache ceiling), and their ratio. The ratio is null when this machine has no local blocks yet. This is not the repository's billed hub storage - the local cache only holds what this engine has read or written, so a cold mount can show a small cache against a large tree, and a warm one can show a high ratio from versions it has seen.

swarmfile storage
swarmfile storage --json

events#

The host-call journal: one JSON line per CLI control call, written beside control.json (trace.jsonl, rotated at 1 MiB). Each line carries atMs, method, the path with its query string removed, status, ms, and an optional actor from SWARMFILE_ACTOR in the calling process's environment. No body, header or bearer is recorded. It covers buffered CLI calls and the SSE stream's open (its lifetime is not recorded); it does not cover the tray's or the web app's requests, and not engine-internal work.

swarmfile events                 # last 50 calls, human lines
swarmfile events --limit 100     # a larger window
swarmfile events --json          # raw JSONL
swarmfile events --follow        # keep printing new calls

host state#

One JSON object for an agent host, so it does not need three calls: {schemaVersion, engine, mounts, storage} where engine is the status --json payload and mounts is the mounts list array. The same contract is documented in the repository's host-integration design note; this is a CLI/JSON surface, not an SDK.

swarmfile host state

stats#

Where this machine's read bytes actually came from - per file and in total: this computer, a colleague's computer, or the cloud - plus first-read timings. The engine counts each block once per file per counter window, at the moment that file is first served it (a cache hit is "this computer"; a LAN/WAN peer transfer is "colleague"; a fetch from cloud storage is "cloud"), including read-ahead, so the cloud and colleague figures are the bytes really downloaded and re-reading or scrubbing a timeline never inflates them.

Counters are per repository and per engine process; --reset starts a fresh window (use it between takes so each recording's numbers stand alone - it zeroes both this repository's breakdown and the engine's process-wide bandwidth counters), and the tray's Data sources page shows the same counters live with its own reset button.

--json prints the full evidence report - engine version, machine, OS/arch, the mount path/branch, file sizes, per-file source split, read counts and first-read latency - one object you can paste into an evidence log or a journalist can reproduce against. --csv prints the same as spreadsheet rows (a header, a summary row and one row per file, each carrying date/version/machine/repository) for the evidence log.

swarmfile stats              # human table
swarmfile stats --json       # the evidence report
swarmfile stats --csv        # spreadsheet rows, one take per machine
swarmfile stats --reset      # zero the counters after printing

usage#

Estimated token spend for coding-agent sessions. It has two modes:

  • Org ledger (the default): the organization's collected reports, opt-in, read through the engine. This is what the web dashboard's Usage → Agent spend card shows. Collection is off by default; an owner or admin enables it, and a member's engine then posts token counts (never content) at most every five minutes.
  • --local: a scan of this machine's harness transcripts. It works with the engine stopped, reads only the local session log, and uploads nothing. From each line it uses the message id, model, timestamp and token counts; the line's content is discarded immediately and is never retained, logged, printed or sent. The transcript's own path is kept locally (and never shown) so a later scan can find it.

Both are estimates against a versioned price table - the 5-minute and 1-hour cache-write tiers are priced separately - never an invoice, and a model the table does not know is reported unpriced with its tokens kept. One row is one harness session: a wrapper workspace and a later direct resume of the same session do not double-count.

The org ledger also reports today's spend against the owner-set daily budget (UTC day; a new agent workspace is refused agent_budget_reached, exit 2, at the budget; the text output warns at 80%). For sessions with checkpointed changes it reports landed / in-review / exploration / unknown cost: landed is the hub's default-branch commit DAG, in-review is an open merge request, and a session with no checkpoint is unknown.

The split covers the newest 10 repositories, 200 ids per repository and the newest 200 sessions, and says when it is capped. A plain member sees their own attribution and their spend, not the org budget; a member-keyed commit row keeps two members' identical harness session ids apart.

SubcommandFlagsDescription
agents--local, --session <id>, --transcript <path>, --harness <auto|claude-code|codex|opencode|cursor|copilot>, --since <when>Per-session, per-model tokens and estimated cost. Without --local, read the org ledger (your own sessions as a member; the org's as an owner/admin; --session/--transcript are local-scan options). The org text shows per-session totals and a by-model cost line; its --json carries the per-model token counts and cache-write tiers. A member's view is their own attribution. With --local, scan every agent workspace this machine recorded, one session, or a transcript file. --since takes a duration (7d, 12h) or a timestamp; a local session with no recorded time is always shown. --harness selects the local transcript format (default auto; Cursor and Copilot report unreported). A workspace whose harness left no transcript is unreported; Cursor and Copilot are unreported even when a path is recorded because they have no local token source; another harness's transcript that is gone is an error and the path is not printed. --json emits a stable object: the org ledger adds local: false and mode: "org" to the summary fields (including priceVersions, ingestTruncated and per-row truncated markers); a refusal in org mode is a JSON object too; --local emits local: true with sessions, totals, priceVersion, pricedAt and caveats. Per-model token counts include the 1-hour cache-write subset, and a transcript with no usable usage is flagged usageMissing.
swarmfile usage agents
swarmfile usage agents --since 7d --json
swarmfile usage agents --local
swarmfile usage agents --local --session claude-abc123 --json
swarmfile usage agents --local --transcript ~/.claude/repositories/-work-app/claude-abc123.jsonl

The price table's date and version are printed with the total, and an estimate below one cent is shown as <$0.01 rather than a misleading $0.00.

demo reset#

swarmfile demo reset [--repository <id>] [--force] [--yes] - start a demo take cold on this machine: empty the repository's local cache (the same whole-repository "Free up space" sweep, including "available offline" marks) and zero the stats counters - this repository's window and the process-wide bandwidth counters, so every surface the recording shows starts at zero. Run it on every machine a recording uses; a second take that quietly read from the cache is the failure this exists to prevent.

Files with saves that have not committed yet are refused (409) - their bytes may be the only copy - unless -f/--force, which proceeds while still keeping them. Cached content re-downloads on demand and nothing is deleted at the hub. The confirmation prompt is skipped with -y/--yes.

swarmfile demo reset --yes
swarmfile demo reset --repository prj_… --force

demo offline#

swarmfile demo offline on [--include-lan] [--for <duration>], swarmfile demo offline off, swarmfile demo offline status [--json] - cut this machine's network for real, on cue, for a recording of "the internet drops mid-work". It installs host firewall rules (macOS pf, Linux nftables or iptables, Windows Firewall), so the engine sees exactly what a dead office uplink looks like; it is not a simulation, and it works with no engine running.

  • The office LAN stays up by default. Everything is blocked except this machine itself, private addresses (10/8, 172.16/12, 192.168/16), link-local, IPv6 unique-local and multicast - so office computers keep serving each other while the cloud is out of reach. --include-lan blocks the LAN too (everything but this machine); a remote shell to it drops.
  • Existing connections are cut too, including the engine's long-lived connection to the hub - not just new ones.
  • It always switches itself back off. on arms an automatic off after 30 minutes (--for 90s, --for 10m, --for 1h30m; at most 24h) that survives the command, the terminal, and on Windows a restart. off ends it sooner and cancels the timer; running it when nothing is on is harmless.
  • Needs administrator rights for on and off: on macOS and Linux run it with sudo; on Windows, from an elevated terminal. Without them it exits 2 and prints the exact command to run. status needs none; --json reports offline, scope, lanStaysUp, since, restoreAt and remainingSecs for scripts.
sudo swarmfile demo offline on --for 10m   # internet off, office LAN up
swarmfile demo offline status
sudo swarmfile demo offline off            # back online

op#

Some commands do work proportional to your data - merge, commit, checkout, revert, materialize, branch create/archive, mr merge, trash restore/purge, repository delete, ignore-clean, hydrate free-space, undo/redo (except --dry-run), and opening or closing a mount. They run as operations in the engine: the command waits and prints the result as usual, however long that takes, but the work no longer depends on the terminal staying open.

  • Ctrl-C detaches instead of stopping anything: the command exits 3 and prints the operation's id, and the work carries on.
  • --no-wait returns the id at once (exit 3).
  • An operation's outcome is kept, so you can collect it later - even after the engine restarts. One still running when the engine stopped is reported as interrupted.
  • When an operation follows a hub background job - an over-cap folder delete/restore/purge or repository delete (see Trash, History & Rollback) - op status also shows its done/total progress while it runs.
SubcommandDescription
op listRecent operations, newest first.
op status <id>One operation's state and, once finished, its result. Exits 0 succeeded, 1 failed, 2 canceled, 3 still running.
op wait <id>Wait for it to finish and print its result; exits the way the original command would have.
op cancel <id>Stop an operation that can safely stop part-way (materialize, hydrate free-space, git backfill-oids, git index, and checkout/revert while still staging). A cancel that arrives once the staged apply has begun is declined (too_late) and the operation ends with the commit's real outcome. Commits, merges and deletes complete or fail on their own and refuse (not_cancellable).
swarmfile --no-wait merge --from feature-x   # prints the operation id, exit 3
swarmfile op wait 1b2c…                      # the merge's own result, when it lands

mounts#

Manage this engine process's concurrent mount points. One engine can hold several full mounts open at once - of the same repository, or (same org only) a genuinely different one via --repository - each with its own changelists, metadata, and lock manager - for running multiple isolated mounts without paying git's one-worktree-per-branch tax (the motivating case: several AI coding agents, each working against the same repository without stepping on each other's saves).

Most installs only ever run the one boot mount; this is for when you deliberately want more than one. Multiple live mounts are supported on every platform, with a bounded number of FUSE-T mounts per machine (18; a FUSE-T helper-port limit, not an OS limit): an open fails with fuse_t_helper_ports_exhausted once that limit is reached - close a mount or quit the app holding a slot.

A boot mount that never attached can retry in place (mounts retry); one that attached earlier needs a restart, and swarmfile doctor names the holders. For the headless, per-agent recipe (API key, labeled mounts, shared cache), see Coding Agents.

SubcommandFlagsDescription
list--allEvery mount this engine currently has open, (current) marking the one id-less commands (and any command run without --mount) target. --all adds each mount's workspace branch kind/expiry (ephemeral workspaces); it is not a branch inventory.
retry-Re-attempt a boot mount that failed with a coded FUSE-T exhaustion/probe error before it ever attached, in this engine process (the exhausted-slot remedy): reaps leaked FUSE-T helpers and retries without restarting the engine. A drive that attached once, a plain key/repository/config refusal and runtime mounts are not retried (restart an attached boot mount; re-open a failed runtime mount).
new [mount_point]--label <text>, --from <REF>, --repository <id>, --policy-root <DIR>, --ttl-days <1-30>, --set-current, --exclusive, --conflict-mode <soft|hard>, --waitCreate an exact agent/<label>-<6 hex> ephemeral branch and open a mount pinned to it in one step. --ttl-days overrides the hub's configured workspace TTL (otherwise 7 days); the hub archives an expired workspace on its daily sweep. Omitted mount_point = auto. --policy-root reads the policy from that directory instead of the current mount (the MCP server passes its operator-owned root so a prompt-injected agent cannot weaken paths_deny or the checkpoint cadence). --repository targets another repository (same org); with --repository, --from accepts branch:, tag:, seq:, changeset:, hash: or a bare branch name. The branch is hidden from the default branch picker (branch list --all shows it) and is not an isolation boundary - the workspace shares the repository's ACLs, caches and P2P visibility. A mount failure archives the just-created branch only when the mount list proves no mount holds it; an unreadable list or an actual mount leaves it in place. If the engine reports the branch was created in a different repository, the command refuses before opening a mismatched mount.
promote <id> <new-name>-f, --forceClose an ephemeral workspace mount and rename its agent/* branch to a named branch (stable branch id; TTL cleared). Refused if the mount has open changelists unless --force; a non-workspace branch is a no-op (exit 2).
open <mount_point>--label <text>, --set-current, --branch <name>, --repository <id>, --exclusive, --conflict-mode <soft|hard>, --waitOpen a new mount at a filesystem path, a drive letter (Windows: P:), or auto - the next free drive letter on Windows, or a new folder beside the boot mount on macOS and Linux, named after the label or branch. On Windows a folder must be empty or not exist yet (Windows creates the mount folder itself); a folder with anything in it is refused with mount_point_not_empty, and a drive letter something else holds with drive_letter_in_use, naming what holds it. The command returns once the drive has attached, or with the reason it couldn't (mount_failed, fuse_t_helper_ports_exhausted when FUSE-T's helper-port range is full, or fuse_t_helper_port_probe_failed when it could not probe for a free port) - a mount that fails to attach is not left registered. It is a full, symmetric mount, equally capable to the boot mount, not a lightweight second view of it. Does not become current unless --set-current is given, so opening one never retargets a command already running elsewhere against the existing mount. --branch is optional; omit it to mount the repository's currently-active branch - but a mount opened without --branch shares the engine's boot branch context and can't be switched independently (mounts branch refuses it with shared_branch_context). Naming a different branch opens a divergent (repository, branch) scope: the mount works that branch while every other mount stays on its own, and it can be switched later with mounts branch. --repository <id> opens a mount on a DIFFERENT repository than this engine's active one (same org only); it combines with --branch, and a cross-repository mount pinned to a branch gets that branch's own live-update feed. --exclusive opts the mount into exclusive-write mode: for as long as a file is open for writing through it, a sibling mount opened with the same flag on the same repository+branch has its write-open refused (the app sees EAGAIN, the same refusal another machine's lock produces) - a rename, delete, or atomic-save replace of that file is refused too - instead of both editing the file and letting whichever closes last win. A mount that does not set the flag neither takes nor honors claims, so existing multi-mount setups are unchanged; open every agent mount with it when several agents share one tree. The flag is fixed for the mount's lifetime and shown by mounts list/mounts status as exclusive. --conflict-mode picks how a concurrent-write refusal (the hub rejecting a save built on a stale version) reaches the writer: soft (the default) accepts the save locally and surfaces the conflict asynchronously - the tray, the file reading read-only until resolved, and a (conflict-…) copy on the save lanes; hard makes the triggering fsync (Linux also the close-time flush; Windows FlushFileBuffers - a macOS close() cannot carry the error by design) wait for the hub's answer and fail it instead, with ESTALE (Windows: "the file was externally altered") so an automated writer's loop learns its save didn't become truth and re-reads. Omitted = the repository's setting, else soft. A mode pinned per drive is shown by mounts list and mounts status (conflict:soft/conflict:hard).
close <id>-f, --force, --archiveClose a mount. Refused (exit 2, changelists_open) if it has open changelists, unless --force is given - never auto-cancels staged work. Refused (exit 2, is_default_mount) for the boot/default mount specifically: closing it shuts down the whole engine, not just one mount, so it isn't reachable through this command at all - quit the engine itself (the Desktop App's Quit, or stopping the swarmfile-engine process) if that's what you actually want. --archive archives the mount's branch afterwards when it is an exact agent/<label>-<6 hex> workspace, using the mount's own repository; any other branch is left in place and exits 2. A branch still used by another registered mount on this engine is not archived (exit 2), and an archive failure exits 1, so a script can tell the branch is still present.
current <id>-Switch which mount id-less commands target, from then on.
branch <id> [branch]--waitSwitch one mount's branch independently of every other mount (omitted = the repository's default branch). Only works on a mount that was opened with its own --branch; a mount sharing the engine's boot branch context is refused with shared_branch_context. --wait blocks until the (asynchronous) switch lands or fails.
status <id>-One mount's own detail - the same fields list shows, for just this id, without scanning the whole list.
scratch-dir <id>-That mount's repository's machine-local scratch/dependency-cache directory, plus whatever tool-cache redirects its .swarmfile/cache.yml declares (see scratch below). Creates the directory - and every declared subdirectory - if it doesn't already exist.

Anonymous public mount. mounts open <path> --public <org>/<repository> [--hub <url>] opens the same anonymous read-only public snapshot as public-mount instead of a signed-in repository mount. It runs in the foreground until Ctrl-C; --repository is refused (the flags conflict), while --label, --set-current, --exclusive, --sparse, --exclude and --conflict-mode do not apply.

mounts new --wait / mounts open --wait block until the drive is attached (and, with the global --timings, print the create/open/attach phases). Without --wait the command returns as soon as the engine accepted the open, which may be mountState: pending.

The global --mount <id> flag (see "Global flags" above) is how every OTHER subcommand targets a specific mount instead of current - e.g. swarmfile --mount mount-abc123 status runs status against that mount regardless of which one is current. It has no effect on mounts subcommands themselves, which already take the id as their own argument, nor on workspace switch (below), which retargets the whole engine's active workspace; combining the flag with either prints a warning and is otherwise a no-op for the flag.

swarmfile mounts new --label agent-3                         # agent/agent-3-<suffix>, auto mount point
swarmfile mounts new ~/agent-3 --label "Agent 3" --from feature-x --exclusive
swarmfile mounts new --label "Agent 3" --repository proj_abc123  # another repository's own default branch
swarmfile mounts open ~/mount-2 --label "Agent 2" --set-current
swarmfile mounts open auto --label agent-3 --branch feature-x   # Windows: next free drive letter
swarmfile mounts open ~/agent-3 --exclusive                     # exclusive-write mode for agent fleets
swarmfile mounts open ~/agent-4 --exclusive --conflict-mode hard  # automated writer: a stale save fails ESTALE
swarmfile mounts open ~/src-only --sparse "src/**"              # a sparse mount - only src/ is visible
swarmfile mounts open ~/no-vendor --exclude "vendor/**"         # everything except vendor/
swarmfile mounts open ~/other-repository --repository proj_abc123   # different repository, same org
swarmfile mounts list
swarmfile mounts status mount-abc123
swarmfile mounts current mount-abc123
swarmfile --mount mount-abc123 status       # target it without switching current
swarmfile mounts close mount-abc123 --archive

Sparse mount. mounts open --sparse <glob> (repeatable) exposes only the paths matching those include globs - the same dialect as materialize --sparse (a glob matching a directory includes its subtree, a leading ! excludes an earlier match, a bare name matches at any depth).

--exclude <glob> is sugar for the ! negations; with no --sparse it means "everything except".

An excluded path is invisible at that drive: no listing entry, an open fails as if it weren't there, and a write-create/mkdir/rename onto it is refused. Empty = the whole branch, and the scope is per mount (a sibling mount is unaffected); a scoped mount's offline (hydrate/Pack & Go) set matches the scope.

public-mount#

Mount a public repository read-only with no account: an anonymous snapshot of the repository's derived git head. It resolves the refs through the anonymous public clone gate (the repository must be public, git-enabled, and have anonymous cloning on), fetches tree pages and file blocks on demand through the public PoW ticket, and runs in the foreground until Ctrl-C.

swarmfile public-mount swarmfile/swarmfile-lfs ~/public
swarmfile public-mount swarmfile://hub.swarmfile.com/swarmfile/swarmfile-lfs ~/public --branch main

Every write returns EROFS; there is no lock, queue, comment, issue, MR or share surface. No API key or cookie is sent, and the engine does not need to be running.

The snapshot does not appear in mounts list and does not touch a signed-in repository cache. --branch selects another derived head; omitting it uses the repository's default branch.

--hub <url> overrides the configured hub; a swarmfile://<host>/<org>/<repository> source defaults to https://<host>. macOS (FUSE-T) and Linux (FUSE) are supported; Windows is not implemented yet.

If a repository turns anonymous cloning off, a fresh mount within the 60 s boundary-verdict window may still attach, but its first content read is refused; outside that window it fails with the same uniform refusal as the public clone surface (the git refs are served live, not from the edge cache).

A file whose stored content is an LFS pointer blob appears as that pointer text; a native large file streams its content through the mount (LFS objects are never materialized). Use the public clone/LFS path for the actual bytes, or keep LFS off the default branch of a repository you intend to show this way.

workspace#

Show or change the org/repository this engine is scoped to - the CLI equivalent of the Desktop App's org and repository pickers. A same-org repository switch usually takes the hot path (no restart), and an org switch does too while the mount is live; switching to a repository the running mount can't be re-scoped to, or switching with no live mount to work with, drains and restarts the engine, so the command may briefly drop its connection.

A target repository whose key hasn't been released yet doesn't force that restart - the switch waits for the grant and completes in place.

A same-org switch with creates still queued can also take that restart fallback - queued creates survive it and land in the repository they were created under. Refused (exit 2) while a changelist is open, or while another switch is already running.

SubcommandFlagsDescription
status-The current org and active repository for this mount.
list-Every org this account can reach, plus every repository in the current org, with (active) marking the current pair. Use these ids with switch.
switch--org <id>, --repository <id>, -y/--yes (--force), --parkMove the engine to that org, and optionally that repository in it. --org is required; omitting --repository clears the stored repository so the engine adopts the target org's default. A switch is refused (exit 2) while a changelist is open - --park sets the mount's open changelists aside first so the switch can proceed; --yes skips the confirmation prompt (which names staged files and queued/failed writes).
deps gc--repository <path>, --cache-dir <dir>, --kind <share-deps|local>, --older-than-days <n>, --keep <key>, --apply, -f/--forceList the share-deps and machine-local dependency layers and their age; a dry run by default. --apply removes layers unused for at least --older-than-days (default 14) - a live repository marker is still kept unless --force; --keep pins a key. --cache-dir reads the machine-local layers with the engine stopped.
warm--share-deps, --local, -- <command…>Run an install/build/test through the repository's shared dependency caches (the swarmfile run redirects) and print how long it took. Run it from the mount (or use hooks run, which sets the cwd); the first workspace on a machine warms the cache and later workspaces reuse it. --share-deps builds a hub-traveling installed tree; --local builds a machine-local cache layer (Unix only; conflicts with --share-deps).
swarmfile workspace status
swarmfile workspace list
swarmfile workspace switch --org org_abc --repository proj_9f2a
swarmfile workspace switch --org org_abc        # adopt that org's default repository
swarmfile workspace warm -- pnpm install         # warm the shared cache
swarmfile workspace warm --share-deps -- pnpm install  # also share the installed tree
swarmfile workspace deps gc                            # list the layers (dry run)
swarmfile workspace deps gc --apply                    # remove unused layers
swarmfile workspace deps gc --kind local --older-than-days 30 --apply

--share-deps runs an install command inside .swarmfile/deps/<OS-arch-Node-ABI>-<libc>-<lockfile-hash>/tree, stages the installed node_modules copy as tree/.packages.partial and renames it to tree/packages with a completion marker (an interrupted copy is rebuilt, not half-linked), and leaves a relative node_modules symlink to it. Use it for npm/pnpm/yarn install, not build/test, which need the workspace's source files; run it from the repository root.

--local builds/reuses a machine-local installed tree under the engine cache (never the hub) and imports it as a real local-only node_modules directory (no absolute link; a new workspace imports it in ~12-15 s, measured 14.6 s first / 12.6 s reuse, and the same branch reuses it); it preserves executable bits, so node_modules/.bin tools run, refuses a strict E2E/static mount (its blocks are plaintext), and rolls back a partial import. It is Unix-only for now, and conflicts with --share-deps.

A branch forked from the warming branch (for example swarmfile mounts new --from <branch>) inherits the tree and can run tests without reinstalling. The tree is ordinary repository content: it syncs to the hub and counts against repository storage.

.npmrc is never copied into the shared tree (registry credentials stay in place). Native modules are only portable across the same OS/CPU/Node ABI; nested node_modules from pnpm and old trees need manual cleanup. On a Windows WinFsp mount the host cannot create the node_modules symlink/junction, so --share-deps currently refuses at the link step (the install/copy still exists); use the hub-backed tree on a Unix mount. A junction works only on an ordinary NTFS directory.

Old layers are listed and removed by the dependency-layer commands below. The import is bounded at 20,000 entries and 512 MiB per file.

--local is the machine-local variant: it runs the install in <engine-cache>/layers/<OS-arch-Node-ABI>-<libc>-<manifest+command-hash>/ (never the hub), then imports that tree into the workspace as ordinary local_layer metadata entries and local block-store content. node_modules is a real local-only directory (no absolute symlink, so the cache and its siblings are not reachable through the mount and a mount sandbox cannot walk into them).

The layer is visible/readable and is not synced; a fresh workspace attaches it by re-running workspace warm --local -- npm install (the cached tree is imported/reused; no install; the CLI says the command was not run).

It is install-only, must run from the mount root, supports single-package npm/yarn/pnpm installs (pnpm's relative .pnpm store links are imported), and still refuses workspace/monorepo installs; use a plain install in the checkout (a --share-deps tree is single-package too, so it does not carry workspace package node_modules).

It merges the repository .npmrc with the user config (relative cafile/certfile/keyfile values resolve against the file that declared them; the merged 0600 temp is removed after the install, and one abandoned by a killed process is swept after a day). It is Unix-only for now; old cache layers are listed and removed by the dependency-layer commands below (a layer whose recorded repository still exists is kept; --keep/--force control the exceptions).

The CLI prints the imported key; the share-deps GC refuses any share-deps tree rather than partially deleting it.

workspace switch changes the whole engine's active workspace, not one mount, so the global --mount flag has no effect on it (the CLI prints a note if you combine them).

workspace deps#

Inspect and reclaim this machine's dependency layers. Engine-free: it reads the repository tree and the engine cache, so it works while the engine is stopped and never resolves a session.

SubcommandFlagsDescription
gc--repository <DIR>, --cache-dir <DIR>, --kind <share-deps|local>, --keep <KEY> (repeatable), --older-than-days <N> (default 14), --apply, -f, --forceList .swarmfile/deps and <cache>/layers layers and remove old, unused ones. A dry run unless --apply. Keeps the current node_modules link, a local layer whose recorded repository still exists, --keep, a live install, and any share-deps layer with a tree (a normal/fork share layer is reported BLOCKED: its tree is synced repository content and must be removed through the mount/hub, not by a host-side GC); --force also reclaims an old live local layer. Another branch/worktree's use is not auto-detected, so pass --keep. A dead install marker does not block. A symlinked .swarmfile/deps/cache layers root or layer is refused. For --kind local, the GC removes the cache-layer source only; the imported local-only metadata/blocks stay pinned until the repository detaches or the cache is resynced. Exits 2 rather than applying without a current link or --keep; re-checks before every removal.
materialize <key> <checkout>--cache-dir <DIR>, -f, --forceCopy an installed local layer into a plain (unmounted) checkout. The copy is staged and renamed (no partial node_modules), executable bits and relative symlinks are preserved, an existing node_modules is refused without --force, escaping/absolute links are refused, and the checkout is recorded as the layer's repository.
export <key> <archive.tar.gz>--cache-dir <DIR>Package a local layer for another machine. The archive includes a format/key manifest and the node_modules tree (symlinks and exec bits preserved); the key must match this machine's OS/arch/Node-ABI/libc prefix. It is structurally validated with 20k-entry/512 MiB-per-file/2 GiB-total caps; an archive inside the source is refused.
import <archive.tar.gz>--cache-dir <DIR>Validate and seed a layer archive into this machine's cache. Paths must stay under node_modules, symlinks must stay inside, the format/platform key and the 20k/512 MiB/2 GiB caps are checked; a healthy existing key is kept, a corrupt one is replaced, and a live/in-progress one is refused. Then run materialize.
swarmfile workspace deps gc                     # dry-run: list layers and what is removable
swarmfile workspace deps gc --apply             # remove old, unused layers
swarmfile workspace deps gc --kind local --keep <key> --apply  # reclaim a local layer
swarmfile workspace deps materialize <key> /path/to/checkout    # plain clone / CI workspace
swarmfile workspace deps export <key> layer.tar.gz              # move a layer to another machine
swarmfile workspace deps import layer.tar.gz                    # seed the cache there

gc is a dry run by default. The current node_modules link, a local layer whose recorded repository still exists, a --keep key, a layer with an install in progress, and any share-deps layer with a tree are never removed; --older-than-days is the retention threshold and --force also reclaims an old live local layer. It exits 2 rather than applying without a current link or --keep, and re-checks the filesystem before every removal.

materialize copies an installed local layer into a plain checkout (a regular git clone or a CI workspace with no mount). The copy is staged inside the checkout and renamed into place, so an interrupted run never leaves a partial node_modules; executable bits and relative symlinks are preserved, an existing node_modules is refused without --force, and the layer records the checkout as its repository so gc keeps it.

It reads a layer already in this machine's engine cache. For another machine, export the layer, copy the archive, import it there (the OS/arch/Node-ABI/libc prefix must match), then materialize; the archive validation rejects unsafe paths/symlinks and an existing key is kept rather than replaced.

conflicts#

Lists files that are blocked because the same file was changed in two places and the two versions haven't been reconciled yet, and resolves them.

While a file is in that state, writes to it are refused, and an application sees a plain I/O error - a filesystem has no way to explain a cross-machine change. This command is where the reason lives.

SubcommandFlagsDescription
list (default - bare conflicts is the same)--state active|resolved|allFiles blocked by an unresolved conflict, by path. --state resolved lists recent history (including resolution: local rows written by .swarmfile/conflict-policy auto-wins); all shows both. A row on another branch (a branch-merge conflict is recorded under the merge TARGET's entry id) prints the branch name, or (not on this mount's branch) when the hub couldn't name it.
show <path>--state open|active|resolved|abandoned|allOne file's conflict history (all states by default): derived lifecycle, origin and resolver. Read-only.
resolve <path>--winner local|remote|keep-bothAccept one side non-interactively, without running any tool.
resolve <path>--tool [name]Resolve via an external mergetool speaking git's own mergetool protocol. Mutually exclusive with --winner and --auto.
resolve <path>--autoRun the engine's three-way diff3 auto-merge and accept the result if it's clean - no external tool, no gitconfig needed. Exits 2 when a real conflict remains (a text collision, or a binary).
resolve --all [--auto | --winner S]-Attempt every conflicted file on this mount's branch, printing one summary at the end. Requires --auto (engine merge) or --winner <local|remote|keep-both> (accept that side everywhere). Rows on other branches are skipped and counted unless --include-other-branches is given - pass it when landing a merge (the conflict is recorded under the target branch), or use merge --diff3. Exits 2 if any file still needs a human (auto only), 1 if any request failed.
resolve --all --include-other-branches-With --all, also act on conflicts the hub reports for other branches.
$ swarmfile conflicts
1 file(s) blocked by an unresolved conflict:

  /Repositories/plan.dwg

Writes to these files are refused until the conflict is resolved.
A namespace observation is still addressed by its occupant path; add
`--conflict-id <id> --winner keep-both|abandon` (`swarmfile conflicts show`
prints the id) to name the namespace row instead of the content tracker.
Resolve a path with `swarmfile conflicts resolve <path> --auto`, `--winner
local|remote|keep-both`, or `--tool`, in the Desktop App, or in the web dashboard.

--winner picks a side directly - same three outcomes as the Desktop App/web picker (keep mine, keep theirs, keep both), just from the CLI:

swarmfile conflicts resolve /Repositories/plan.dwg --winner local

For a conflict recorded by merge --record-conflicts, local is the incoming branch's version and remote is the version already on the branch being merged into - see Branches & Merging.

When --winner remote keeps a version different from yours, your edit is preserved in the file's history (it shows in blame and the History views) and the command prints a note saying so; swarmfile rollback --at <id> can bring it back.

--auto runs the engine's own three-way diff3 merge and submits it when it comes back clean. It needs nothing installed and no gitconfig, which makes it the resolution path to reach for from a pre-flight or CI script:

swarmfile conflicts resolve /Repositories/plan.dwg --auto

It exits 2 (not 1) when auto-merge can't produce a clean result - a genuine three-way text collision, or a binary / non-diff3-eligible file - so a script can tell "a human must choose" apart from "the engine was unreachable" and fall back to --winner or --tool.

Add --all to sweep every conflicted file in the repository in one pass and clear the text ones automatically, leaving only the files that genuinely need a person:

swarmfile conflicts resolve --all --auto

--all also accepts --winner, to accept one side across every conflicted file in one pass (useful when a whole branch should keep yours, or theirs):

swarmfile conflicts resolve /Repositories/plan.dwg --conflict-id <id> --winner keep-both  # namespace row
swarmfile conflicts resolve --all --winner local

--tool [name] resolves a whole-file conflict - including binary files the Desktop App/web picker's "try automatic merge" can't touch - via an external mergetool speaking git's own protocol: $BASE/$LOCAL/$REMOTE/$MERGED temp-file substitution, same as git mergetool. This is the one resolution path that's CLI-only; it needs a real terminal/GUI session to run the tool in, which only the foreground CLI process has.

Resolution order is: swarmfile's own mergetool_cmd config (see the config reference) if you've set one - it wins over gitconfig without even reading it - else your git config's [merge] tool + [mergetool "<name>"] cmd, so anyone with git mergetool already configured and no swarmfile-specific override gets it for free. Name one explicitly to bypass both:

swarmfile conflicts resolve /Repositories/plan.dwg --tool           # configured default
swarmfile conflicts resolve /Repositories/plan.dwg --tool kdiff3    # a specific tool

A nonzero exit from the tool aborts before anything uploads - nothing is resolved, and the CLI tells you where the scratch files ($BASE/$LOCAL/$REMOTE/$MERGED) are for a manual look or retry.

throttle#

Bandwidth throttling - applies immediately, no restart.

SubcommandFlagsDescription
status-Whether throttling is on, the rate in effect right now, and why (office or off hours, and that window's percentage of the site link).
enable--download-mbps <N>, --upload-mbps <N>, --office-hours-start <HH:MM>, --office-hours-end <HH:MM>, --office-hours-wan-pct <0-100>, --off-hours-wan-pct <0-100>Turn throttling on. Omit a flag to leave that value at whatever it already resolves to.
disable-Turn throttling off.

The --office-hours-* / --off-hours-* flags shape a time-of-day schedule: WAN traffic is capped to a percentage of the site link during the office-hours window (--office-hours-start/--office-hours-end, HH:MM local time) and to a different percentage outside it, so background sync can back off while people are working and open up overnight. The window's start and end must be different times: to use one rate all day, set both percentages to the same value. These same values are file-settable as office_hours_start/office_hours_end/office_hours_wan_pct/off_hours_wan_pct (see Engine Config File).

swarmfile throttle enable --office-hours-start 08:00 --office-hours-end 18:00 \
  --office-hours-wan-pct 20 --off-hours-wan-pct 80

What the cap covers. Bulk background transfer: uploads, hydrate, and fetch. A read an application is actually waiting on - opening a file through the drive - is not throttled, so a cap set to protect the office link can't turn somebody's file open into a stall. The practical consequence is that a large hydrate or fetch is bounded by this setting: both are pre-fetches filling the cache ahead of use, not somebody sitting in front of a spinner.

cache#

Local disk cache size cap - applies immediately, no restart. This is the block cache (the repository's own synced content); for machine-local package-manager/build caches shared across mounts, see run and scratch below - a different, unrelated cache.

SubcommandFlagsDescription
status-Current cache cap and usage.
set<gib: u64>Set the local disk cache cap, in GiB.
public--clear, --dry-run, -y, --yesReport the anonymous public-mount cache (<cache>/public/<org>/<repository>), or remove it with --clear (asks first; a repository with a live mount is skipped; --dry-run previews). Needs no engine.
reclaim--dry-run, -y, --yesRemove a leftover unscoped block-cache directory if one exists (its blocks re-download on demand); does nothing otherwise. --dry-run reports without deleting; otherwise it asks first (--yes skips).
resync-Re-fetch this repository's hub change feed from the beginning - a repair for a mount whose feed cursor advanced past a change it never applied (an entry missing on that machine alone while the hub serves it correctly). Applies are idempotent; local rows and cached bytes are kept, and the walk runs in the background with the engine retrying until it catches up.

run#

Run a command with this repository's declared tool caches (see .swarmfile/cache.yml, under scratch below) redirected into environment variables - e.g. swarmfile run -- pnpm install points pnpm's store at a directory every mount of this repository, on this machine, shares, so a second mount (or a second AI agent's mount) doesn't pay to re-download what the first one already fetched. Put -- before the command so its own flags aren't parsed as swarmfile's.

Always safe to prefix onto anything: with no .swarmfile/cache.yml, a repository that declares none, a config with a bad entry, or even an unreachable engine, run just warns on stderr and runs the command completely unmodified - it never refuses to run the command over a cache-resolution problem. The wrapped command's stdio and exit code are passed straight through. For wiring several agent mounts onto one shared cache, see Coding Agents.

swarmfile run -- pnpm install
swarmfile run -- cargo build --release

--detach starts the command in the background and returns at once with its id and log path. The record and log live under the engine cache (processes/), are machine-local, and are not repository content; the process is not checkpointed when it exits. It is for a dev server, a test watcher or a long build, not for work whose output must be committed:

swarmfile run --detach -- npm run dev
# started 1761…-8123-… (pid 4812)
# log:  …/processes/1761…-8123-….log
swarmfile processes list
swarmfile processes log <id> --tail 100
swarmfile processes stop <id>

processes#

Manage commands started with run --detach. These commands read local records/logs and work while the engine is stopped or restarting.

  • list shows running/exited state, pid, cwd and argv (newest first)
  • log <id> [--previous] prints the tail of the captured log (the log rotates at 10 MiB and keeps one previous file; --previous reads <log>.1)
  • stop <id> verifies and kills the command and its process group
  • stop <id> --force (short -f) signals the recorded group after its leader has exited (a shell that left a child running) - use it only for a record you recognize; this recovery is Unix-only (Windows has leader-only group semantics), and a live leader whose start token could not be captured also requires --force; a live leader with a mismatched token is refused
  • prune [--older-than-days N] removes stopped/exited records and their logs older than 7 days (running commands are kept)

Records survive the CLI exiting but not an engine-cache wipe, and nothing here is synced or committed. The log rotates at 10 MiB (one previous file kept as <log>.1, so a chatty server cannot fill the cache); log reads at most the last 512 KiB of the current file. A detached process is not owned by the engine after a restart - records/logs remain but the engine does not restore the command; processes prune cleans them up.

swarmfile processes stop <id> --force
swarmfile processes prune --older-than-days 14
SubcommandFlagsDescription
log <id>--previousPrint the tail of the captured log; --previous reads the rotated <log>.1 file.
stop <id>-f, --forceVerify and kill the command and its process group; -f signals the recorded group after its leader has exited (Unix only; Windows is leader-only).

scratch#

This machine's per-repository scratch/dependency caches - the machine-local, non-versioned directories run (above) redirects tool caches into. One directory per repository, shared by every mount of that repository on this machine regardless of branch, the same way a developer's real ~/.cargo/registry isn't per-checkout either. The worked example (agent mounts sharing one cache, with gc) is in Coding Agents.

SubcommandFlagsDescription
list-Every repository's scratch cache on this machine: size on disk, how long since it was last used, and whether that repository is currently open in this engine.
clear <name>-f, --forceDelete ONE repository's scratch cache outright, by the name list shows. Refuses if that repository is currently open, unless --force.
gc--older-than-days <N> (default 30), --dry-run, -y, --yesDelete every scratch cache that's both closed and untouched for at least the given number of days. Reports what it removed - or, with --dry-run, what it would remove - and the total space reclaimed. Asks first (--yes skips; --dry-run never asks).
init-Write a starter .swarmfile/cache.yml into this mount's repository root. Refuses to overwrite an existing file.
swarmfile scratch init
swarmfile scratch list
swarmfile scratch clear <name> --force
swarmfile scratch gc --older-than-days 14 --dry-run

Nothing here is unrecoverable repository data: everything under a scratch cache is a re-buildable tool cache (a pnpm store, a cargo registry, ...), never repository content, so clearing one only costs a slower next build, not lost work.

.swarmfile/cache.yml#

A versioned, repository-root config file - commit it alongside the repository, like .swarmfileignore - declaring which tool caches run should redirect:

caches:
  - name: pnpm
    env: PNPM_HOME
    subdir: pnpm
  - name: cargo-registry
    env: CARGO_HOME
    subdir: cargo

Each entry needs a name (used only in messages), the env variable the tool reads for its cache location, and a subdir (relative, no ..) under the shared scratch directory. A single bad entry - an unsafe subdir, a name collision with an earlier entry, or one of a handful of env vars this refuses to redirect on principle (PATH, HOME, LD_LIBRARY_PATH, and similar) - is dropped with a warning; it never takes the other, otherwise-valid entries down with it. Run swarmfile scratch init if you'd rather start from a commented example than write one by hand.

Only redirect READ-MOSTLY, CONTENT-ADDRESSED download caches here - a pnpm store, ~/.cargo/registry, a pip wheel cache. Not build output directories (target/, an in-progress node_modules install): sharing one of those across concurrent mounts risks lock contention, not just staleness.

changeset-idle#

Changeset session-minting idle timeout - how long the engine waits after your last write before sealing the open changeset and starting a fresh one on the next write. This groups a burst of related saves into one commit rather than one commit per save. Only applies on a single-repository mount. Distinct from changesets list (the commit history) - this is the settings command, not a log.

SubcommandFlagsDescription
status-This mount's current changeset idle timeout, in seconds.
set<idle_secs: u64>Set the idle timeout. 0 disables commit grouping (writes land ungrouped).

changeset-idle set restarts the engine to take effect (the changeset manager is only constructed at startup). Persists to the config file's changeset_idle_secs - see Engine Config File.

attr-cache#

How long (in seconds) the mount may trust cached file/directory attributes before revalidating - this controls how quickly a teammate's newly-saved file stops showing a stale directory listing. 0 means "leave the platform's own default alone" (not "disabled").

SubcommandFlagsDescription
status-This mount's current attribute-cache timeout, in seconds.
set<attr_cache_secs: u64>Set the timeout. 0 keeps the platform default.

attr-cache set restarts the engine to take effect, and applies only to macOS (fuse-t) / Linux (vfs) builds - it has no effect on a Windows/winfsp mount. Persists to the config file's attr_cache_secs.

hydrate#

Bulk-materialize a scope of this mount into the local cache, pinned against eviction until released - for a machine that needs to read that scope with no network, or that wants everything local before a job starts rather than fetching lazily during it. It does not reserve anything for writing: to also keep a scope editable with no hub, use offline prepare, which reserves the whole scope.

SubcommandFlagsDescription
start[path], -y, --yes, --wait, --sparse <glob>, --exclude <glob>Download and pin every file under path - relative to the mount, or a full path inside it (default: the whole repository on the selected mount's branch - use the global --mount <id> to target another mount). Prints a size estimate and a warning if it exceeds your cache cap, and asks for confirmation, unless --yes. --sparse/--exclude (the same globs as mounts open) narrow it to the matching paths; on a sparse mount the mount's own scope already applies, and a request can't widen it. Polls progress until done, except in --json mode, which returns as soon as the job starts unless --wait is given.
status-Progress of the current (or most recent) hydrate job.
cancel-Cancel a running hydrate job. A no-op if nothing is running.
release[path]Unpin everything hydrated under path on the selected mount's branch, making it evictable again. With no path, unpin everything this machine holds for the repository - every branch, since the pin map is per machine and repository-wide.
free-space[path], --dry-runFree up space: delete the downloaded copy of everything under path so it's cloud-only on this computer, and stop keeping it offline. Files stay listed and download again when opened. Files with changes that haven't synced yet are skipped. With no path it covers the whole repository and also clears older cached versions. --dry-run only reports what would be freed.
swarmfile hydrate start ./Repositories/shots/seqA --yes
swarmfile hydrate start ./src --sparse "src/**" --exclude "src/fixtures/**"
swarmfile hydrate status
swarmfile hydrate release ./Repositories/shots/seqA
swarmfile hydrate free-space ./Repositories/shots/seqA --dry-run

Pinned blocks are never evicted by the cache's normal LRU sweep, so a large hydrate can push disk usage past your configured cache cap - hydrate start warns about this up front rather than silently growing past it. Pins are permanent until you run hydrate release, not time-limited.

sync#

Saves that aren't reaching the cloud on their own - the cloud keeps refusing them, or their upload gave up - and a way to give one up.

SubcommandFlagsDescription
stuck-List stuck saves, one per file: the file's entry id, name and path, why it's stuck (commit_refused or upload_failed) and since when. A new file refused at a protected repository's root is held, not lost: ask an owner to grant repository-wide write, or create a folder to put it in - the full reason sentence is in swarmfile status and the Desktop App's Why did my save fail?
discard<entryId>, -y, --yesDrop the file's stuck saves and put it back to its cloud version. The unsynced change on this computer is lost, so this asks first unless --yes.
swarmfile sync stuck
swarmfile sync discard 6f1c…e2 --yes

uploads#

Every live in-flight upload on this mount - your own saves and other machines' - from the hub-synced pending pointers. This is the "what is still on its way" view that the Desktop App's Uploading badge summarizes, across everyone, not just this computer.

FlagDescription
--waitPoll until nothing is uploading, instead of printing once. Useful before a checkout or a mirror in CI, where acting on a file that is still landing would read the old version.
swarmfile uploads
swarmfile uploads --wait   # block until every in-flight upload has landed

swarmfile uploads retract <path> clears one file's pending pointer when the machine that was saving it is gone for good - the case where no upload will ever finish and nobody should keep waiting on it. It needs write access to the file, reads the live pointer first, and clears against that pointer's own manifest: if the upload has re-announced since, the retract is a no-op rather than an interruption, so it can never yank a genuinely live upload out from under its writer.

swarmfile uploads retract ./Repositories/reel-04.r3d

A pointer nobody refreshes for 30 minutes stops blocking branch creates, merges from its branch, and copies even without this; retracting is for making that explicit and for the readers that wait on the pointer.

An upload that has stalled (a save this machine keeps failing to land) is a different list - see sync stuck.

materialize#

Write a ref's tree to a plain directory - no mount, no FUSE, so it works on a CI box with no kernel driver. The ref resolves through the same vocabulary as show/restore (N/#N, HEAD~N, a branch, a tag, a changeset id, or a 64-hex commit hash; a prefix like hash: or tag: forces one kind), and it defaults to the selected mount's branch head.

A commit ref - a number, HEAD/HEAD~N, a tag, a hash, or another branch's name - writes that commit's tree, exactly as it was committed. Only the default (or the mount's own branch, e.g. branch:main on a main mount) writes the branch as the mount sees it right now, including saves that haven't been committed yet. A commit archived before it had a stored tree can't be materialized (no_commit_tree); pick a newer commit or a branch.

On a protected repository, a member's checkout of a historical ref is filtered by the permissions that were in force at that commit - the hub replays its ACL log at the commit's own time, so files they could read then are written even if they're restricted now, and files they couldn't read then are left out. If the hub has no ACL history for that commit it prints a note that the listing was instead filtered against current permissions - never silently. Owners and service/CI callers (see Runner) are never filtered.

The destination must be new or empty, or a directory this tool already wrote: it keeps a .swarmfile-materialize.json marker and updates in place, pruning only paths it wrote before - so files your job created between runs (build outputs, caches) survive, and it never overwrites or deletes a directory it doesn't own.

A 64-hex hash is the most reproducible pin (tags can be repointed, branches move). Executable files (see chmod) are written executable on macOS and Linux. Exits non-zero if any file failed to materialize.

--sparse <glob> (repeatable) checks out only the paths that match - for a huge repo where a job needs one subtree. A path is written when it matches a glob or a directory in its ancestry does; *.md matches by name at any depth, src/** anchors to the root, and a leading ! excludes a path an earlier glob included (gitignore-style).

Everything else is neither fetched nor written, and a directory with no matching file isn't created. At most 64 globs, each at most 1024 characters, at least one non-!.

--exclude <glob> is sugar for the ! negations (with no --sparse, "everything except"). Omit either for a full checkout. The clone --checkout form takes both flags.

swarmfile materialize v1.0 --out "$PWD/src"
swarmfile materialize hash:8f14e45fceea167a5a36dedd4bea2543ed10d0f8f9d8f9d8f9d8f9d8f9d8f9d8 --out ./checkout
swarmfile materialize HEAD~2 --out ./prev
swarmfile materialize hash:$COMMIT --out ./checkout --sparse "src/**" --sparse "*.toml"

See Runner (Headless CI) for the full external-CI recipe, including the marker's ownership rules.

git status#

How ready this repository is to be served to git. Files at or above the git-LFS pointer threshold (default 1 MiB) would reach git as LFS pointers, and a pointer needs the file's SHA-256 object id. git status walks the selected mount's branch as the mount sees it and reports how many such files there are, how many still have no recorded id, and the first 50 of those with their sizes. It's the readiness check for turning on git access, which refuses while any counted file is missing an id.

It reports the access state first, before the readiness counts: enabled and frozen (with the conversion version and pointer threshold), not enabled (with the command that turns it on), or not available on an end-to-end-encrypted repository. When the hub can't be reached, that line is omitted rather than guessed at.

FlagMeaning
--threshold-bytes <N>Count files of at least N bytes instead of 1 MiB.

Files saved through the desktop app (or imported with swarmfile-migrate) on a managed or unencrypted repository get an id as they're saved. Files added through the web dashboard's uploader or produced by resolving a conflict get one too. Files with no recorded id show as missing until swarmfile git backfill-oids fills them in. An end-to-end encrypted repository never has ids - Swarmfile doesn't store a hash of E2E content - and says so; neither does content encrypted with a static key you supply yourself (SWARMFILE_ENCRYPTION_KEY).

It also reports how many commits on the branch are still unconfirmed (unsigned) - with how many of those are disputed and the oldest one's age - when there are any. A commit becomes servable to git as soon as it's derived, even before it's confirmed: a fetch returns the provisional hash and, from a second machine, confirms it. A teammate's app and an API key used in CI can confirm one the same way. A commit that stays unconfirmed for a long time is still worth a look; the warning never changes the exit code.

Exits 0 when every counted file has an id, 2 when some don't (or on an E2E repository, or while the hub doesn't yet know the repository's encryption tier). --json returns the counts and paths.

swarmfile git status
swarmfile git status --threshold-bytes 10485760 --json

git backfill-oids#

Records the missing ids git status reports. For each file at or above the threshold that has no id, it reads the file through the desktop app's normal read path (downloading it if it isn't cached), computes its SHA-256, and sends the ids to Swarmfile. It works through the files in batches and prints progress as it goes. Repository owners and admins only; an end-to-end encrypted repository, or one encrypted with your own SWARMFILE_ENCRYPTION_KEY, never records ids and is refused.

FlagMeaning
--threshold-bytes <N>Count files of at least N bytes instead of 1 MiB.

Exits 0 when nothing is left missing, 2 when some files couldn't be read (they're listed) or the repository doesn't record ids. Re-running it is safe: files that already have an id are skipped.

swarmfile git backfill-oids
swarmfile git status   # now reports every counted file as having an id

git enable#

Turns on git access for the selected mount's repository - the same one-way switch as the Git access… dialog in the web dashboard. Repository owners and org admins only; needs a running engine with the repository mounted. Enabling freezes the rules the repository is converted to git with: the conversion version, the size above which a file becomes an LFS pointer, and where history starts. The record is immutable afterwards (changing any rule would change commit ids a clone has already seen), so the command prints exactly what was frozen and on which repository.

Because the freeze cannot be undone, the command asks for confirmation first: -y/--yes skips the prompt, and a scripted run (--json, or no interactive terminal) must pass it rather than freeze silently.

FlagMeaning
--threshold-bytes <N>Freeze the LFS pointer threshold at N bytes instead of 1 MiB.
--no-backfillRefuse instead of recording missing object ids first. For scripts that want the fail-fast behavior; interactive runs don't need it.
-y/--yesSkip the confirmation prompt. Required with --json and when stdin isn't a terminal.

It refuses, with the reason, while the repository doesn't keep every saved version (turn that on from the repository's history settings), when an older branch or tag head can no longer be read, when history is too long to check in one pass, and on an end-to-end-encrypted repository - git access isn't available there.

If any at-or-above-threshold file still has no object id, the command records the missing ids itself first (the same work as swarmfile git backfill-oids: it hashes each file's content through the mount, fetching what isn't cached) and retries the enable once. --no-backfill skips that and surfaces the coverage refusal directly.

Exits 0 when the record was frozen, 2 on any refusal (the hub's sentence says which) or when the confirmation is missing, 1 when the hub couldn't be reached.

swarmfile git status          # everything has an id? then:
swarmfile git enable
swarmfile git clone acme/website

git clone#

Clone a repository with git through the swarmfile:// remote helper - the same as git clone swarmfile://<hub-host>/<org>/<repository> [path]. The relative swarmfile://<org>/<repository> is used when no hub is configured, when the configured hub is a path-prefixed reverse proxy, or when it is a plaintext host outside the loopback/SWARMFILE_GIT_INSECURE_HOSTS allowlist; the printed URL is the one the helper will reach as written.

It finds the git-remote-swarmfile helper next to this binary even when it isn't on your PATH. <repository> is a repository id, a bare repository name (qualified with your configured organization), or <org>/<repository>; [path] is the destination directory (git's own default when omitted). It runs git clone for you, so no running engine is needed.

The repository must have git access turned on - see Cloning a Repository with Git for what a clone contains, how it signs in, how git push works from it, and what isn't supported.

swarmfile git clone acme/website
swarmfile git clone acme/website ./website

git anonymous-clone#

Show or set whether a signed-out visitor may clone a public, git-enabled repository. Anonymous cloning is on by default; while it is on, a signed-out visitor can clone, fetch and git lfs pull (never push) only while no active branch's committed tree hides a path through .swarmfile/publicignore.yml or a ready (published) release hid paths.

While one does, anonymous clone is refused outright - within about a minute - and the boundary is anonymous-only, so member ACLs still apply. An invalid or unreadable policy, or a boundary read/walk error, refuses anonymous clone (fail closed).

A release hiding paths cannot be published while anonymous cloning is on; once it is ready, turning anonymous cloning back on does not re-expose those paths. Turn it off to refuse all anonymous git reads (clone tickets stop immediately; an already-minted ticket is re-checked on its next read, and the 1-hour TTL only bounds the ticket row).

Needs a running engine with the repository mounted; the write is owner/admin only. With no argument it prints the current state.

swarmfile git anonymous-clone          # on or off?
swarmfile git anonymous-clone off      # refuse anonymous clones
swarmfile git anonymous-clone on       # allow them again

Exits 0 normally, 2 on a refusal (not an owner/admin - the hub's sentence says so), 1 when the hub couldn't be reached.

git preflight#

Inspect a source repository - GitHub, GitLab, a local path - without creating anything. It fetches into a temporary bare mirror with your own git (so your configured credentials and git-lfs apply), then reports the default branch, every branch's verdict (import, skip or refuse), the tag policy, the LFS/submodule/octopus blockers, and the largest historical blobs against the literal-blob threshold. Nothing is created and no Swarmfile credential is read, so it works with the engine stopped and before you decide to migrate.

Exit 0 when import would create the repository, 2 when it would refuse (the report names the branch, tag or blob and the flag that changes it), and 1 on a fetch or git failure. --json prints the structured report; --keep keeps the temporary mirror.

FlagDescription
--branches <GLOB>Assume the --branches filter you would pass to import (repeatable; the default branch is always kept).
--no-tagsAssume --no-tags.
--annotated-tags <keep|convert|skip|fail>Assume the annotated-tag policy; fail reports the refusal, as import would.
--submodules <skip|fail>Assume the side-branch submodule policy.
--octopus <skip|fail>Assume the side-branch octopus-merge policy.
--threshold-bytes <BYTES>Compare historical blobs against this literal-blob threshold instead of the hub's 1 MiB default.
--max-blobs <N>How many of the largest at-or-above-threshold blobs to list (default 20; 0 skips the blob scan).
--keepKeep the temporary mirror.
swarmfile git preflight https://github.com/acme/mono.git
swarmfile git preflight ./old-repo --submodules fail --json

swarmfile git import --dry-run is the same report without a second command.

Each source git child is bounded by SWARMFILE_GIT_IMPORT_TIMEOUT_SECS (default 300 seconds; 0 disables it). A timeout is a failed preflight, not a compatibility verdict; the command kills the child's process group rather than hanging.

git import#

Bring an existing git repository - GitHub, GitLab, a local path - into a new Swarmfile repository, or into an existing one with --into. The repository is created with git access already on and every version kept, and the source's default branch becomes the repository's default branch (so upstream commit ids are preserved exactly, including a history whose default branch is master, trunk or anything else).

The source is fetched into a temporary bare mirror with your own git, so the same credentials a normal git clone would use - and a configured git-lfs - apply; each branch and tag is then pushed through the same swarmfile:// helper git clone uses. It runs without a running engine, like git clone.

The repository name from the URL becomes the repository name unless --name overrides it. Every branch the git view can hold is imported; one it cannot (submodules, Git-LFS, an octopus merge) is skipped and listed, while the same problem on the source's default branch refuses the import before anything is created - nothing can land without it.

--branches narrows which branches are attempted (wildcards; the default branch is always imported) and --no-tags skips tags; --submodules fail/--octopus fail widen the refusal to side branches too.

Annotated tags keep their exact tag object by default - message, tagger, signature and id survive (--annotated-tags keep; convert imports them as lightweight tags instead and the report says how many, skip leaves them out, and fail stops the import before creating anything).

Tags pointing at something other than a commit, or living only on a branch this import did not push, are skipped and listed.

--threshold-bytes N (positive) freezes the created repository's LFS threshold at N before the first push - needed when the repository's history already contains a blob above the 1 MiB default (it is creation-only, so it is refused with --into; enable an existing target first).

--dry-run runs the full preflight and creates nothing (the same report as git preflight).

If anything fails to land, the temporary mirror is kept and the report names the retry: swarmfile git import <url> --into <org>/<repository> resumes against what already landed; the repository is resolved and its git access verified before the source is fetched, so a typo'd or disabled target is refused up front.

The import records the source it came from, so re-running the same command without --name/--into recognizes the repository it made and syncs new upstream branches and commits into it instead of failing on the name. --new forces a fresh repository anyway (a second repository from one source), and an explicit --name always creates the named repository.

The importer refuses, before creating anything, a source whose default branch uses Git LFS (the importer does not fetch LFS objects), contains submodules, or has an octopus merge - each is a limit of the importer and git access. A repository-name collision after the source is fetched is refused too; pass --name, or --into the existing repository.

FlagDescription
--name <NAME>Repository name (default: the repository name from the URL).
--org <ORG>Organization slug or id (default: your configured organization).
--template <ID>A creation template from the repository-creation list (default: the git configuration without its starter .gitignore - an import needs the default branch to start empty, and the repository brings its own files, so a template that seeds files can't be imported into).
--publicCreate a public plaintext repository instead of the default private managed one (private repositories need a plan with them).
--into <ORG>/<REPOSITORY>Push into an existing repository instead of creating one; the repository is resolved (before the source is fetched), so an unknown name is refused up front.
--keepKeep the temporary mirror after a successful import.
--dry-runRun the full preflight and create nothing; prints the same report as git preflight.
--annotated-tags <keep|convert|skip|fail>Annotated-tag handling: keep the exact tag object (default; message, tagger, signature and id survive), convert to lightweight, skip, or fail before creating anything.
--newCreate a fresh repository even when this source was already imported (the default without --name/--into is to sync into the repository this source made).
--submodules <skip|fail>A branch containing submodules: skip (default) lists it and imports the rest, fail refuses the whole import.
--octopus <skip|fail>Same for a branch containing an octopus merge.
--branches <GLOB>Import only branches matching the wildcard (* matches any characters, / included); repeatable, and the source's default branch is always imported.
--no-tagsSkip every tag (branches still import).

Exits 0 when every ref landed or was deliberately skipped (a tag pointing at a blob or tree is listed as skipped, not failed), 2 on a refusal (the sentence names the fix) or when a branch or tag push failed (the report names the --into retry), and 1 on a failure such as the source being unreachable. --json prints the structured report. The creation-only flags (--name, --public, --template) are refused alongside --into, which already names the repository.

swarmfile git import https://github.com/acme/website.git
swarmfile git import git@github.com:acme/site.git --name website --org acme
swarmfile git import ./old-repo --into acme/website   # retry a partial import
swarmfile git import https://github.com/acme/big.git --threshold-bytes 50000000

git url#

Print a repository's swarmfile:// URL and exit, for wiring a remote by hand. <repository> is a repository id, a bare repository name (qualified with your configured organization), or <org>/<repository>.

The URL is host-qualified (swarmfile://<hub-host>/<org>/<repository>) whenever the configured hub can be written that way, so a copied link means the same repository on every machine; a path-prefixed hub, or a plaintext hub outside the loopback/SWARMFILE_GIT_INSECURE_HOSTS allowlist, keeps the relative form.

URL segments are printed ASCII-lowercased and percent-encoded where a character needs it (a display name with a space comes out as %20) - the canonical web-address form, which also repairs a caps-typed UUID (a full swarmfile:// URL is passed through unchanged; the remote helper decodes an escaped segment before resolving it).

git remote add origin "$(swarmfile git url acme/website)"

git force-forward#

The append-only form of git push --force, run inside a clone. A branch's tree can't be rewritten on Swarmfile, but the end state a force push wants - "the branch's tree is my tree" - can be landed as a new commit on top of the current head whose tree is your tip's, with your tip as its second parent.

This command fetches the branch (which also snapshots uncommitted drive saves, like any fetch), builds that commit with git's own commit-tree (so its id is derived on this machine), and pushes it through the normal helper path: every commit stays reachable, teammates fast-forward instead of diverging, and your tip's history rides the merged/<sha> side branch the helper creates and archives.

Only committed work is landed (a dirty worktree is ignored, like git push), and --dry-run still fetches - the dry run skips the push, not the fetch, so a fetch's usual effects apply.

Your local branch is deliberately not moved - the new commit's id cannot match your tip's - so the command prints the git fetch <remote> && git reset --hard <remote>/<branch> that aligns your clone.

Pass a BRANCH (default: the checked-out branch), --message <MESSAGE> for the new commit's message (default force-forward: <your tip's subject>), --remote <REMOTE> (default origin), or --dry-run to run every check and push nothing.

When your tip simply continues the remote head along its first parents (an ordinary fast-forward), a normal git push lands the same end state, and the command says so instead of building a graft; the diverged merge shape (merging the fetched branch into your line) does need the graft, and the push refusal for it names this command.

When the branch already carries your tree there is nothing to do either, and the command just prints the realignment.

A clone created through the helper enables the same translation for a plain force push by default (swarmfile.force-forward=true); an older clone, or an explicit git config swarmfile.force-forward false, keeps force pushes refused. With it on, git push --force (and --force-with-lease, whose lease check still runs client-side against the advertised head) pushes the tip as-is when it is an ordinary fast-forward, else builds the same forward commit; a note names the new id and asks you to git fetch and reset, since git's own bookkeeping points your remote-tracking ref at the tip you sent.

Exits 0 when the push landed (or there was nothing to do), 2 on a refusal - detached HEAD, an unknown local branch or branch name, a fetch that couldn't find the branch, a push the helper refused - and 1 on a transport failure. A rewritten root commit cannot be landed this way: the replaced history shares no commit with Swarmfile, so the push refuses naming the unrelated root - push that as a new branch instead. --json prints the outcome - pushed, fast-forward, already-at-tip or already-carries-tree - with the commit ids; pushed and already-carries-tree carry align, the realignment command for scripts.

swarmfile git force-forward                    # this clone's branch
swarmfile git force-forward release -m "keep our tree"
swarmfile git force-forward --dry-run
git config swarmfile.force-forward true        # let plain --force use the same path

git index#

Derives commits' Git-ready trees on this machine and hands them to Swarmfile, so a committed version can be served to git directly. For each commit it reads the branch state as of that commit's version, builds the tree objects (directories, symlinks and the large-file pointers, splitting very large directories into segments), uploads anything the hub doesn't already have, and claims the result. A second machine - a teammate's app, a fetch, or an API key used in CI - confirms the same value.

With no argument it works on the selected mount's branch head and every unconfirmed commit behind it (through merges too), back to the nearest commit that is already confirmed or that you claimed yourself. Each commit is derived independently and the claims go oldest first, so a chain someone else pushed is confirmed in one run. A run handles up to 1,000 commits and prints one line per commit. Given a commit's sequence number (#42 or a bare number), it handles just that commit.

The git remote helper also does this by itself for a small unclaimed chain: when a git clone, fetch, push or ls-remote meets a branch head that has never been derived, it derives and claims up to 200 commits inline (a clone that set swarmfile.confirm=false opts out). This command is for longer chains, or a machine without the Desktop App.

Requires a running engine and a managed or unencrypted repository. Exits 0 when every claim was accepted (including ones still waiting for a second machine to confirm), 2 when the hub disputed or rejected one (later commits in the run aren't claimed), and 3 when the hub couldn't be reached.

A commit printed as rejected (resolved_against in --json) was already settled to a different value when the hub resolved a dispute over it, so this machine's claim is kept only as evidence; compare the two with git disputes SEQ --all and report both hashes, since it is a client bug unless the repository's history changed. If the settlement left the commit provisional, an owner who believes it is wrong can override it with git clear-claim; a settlement that confirmed the commit is final.

A commit printed as provisional (your earlier claim was kept) (code self_disagreement in --json) means this machine derived a different value than its own earlier claim for the same commit. One identity deriving two values for one commit is a client bug, not a dispute: the hub keeps the first claim, records the disagreement as evidence (readable with git disputes SEQ --all), and does not alert owners. Report it with both hashes.

swarmfile git index                 # the branch head and every unconfirmed commit behind it
swarmfile git index '#42'           # one commit
swarmfile git index --json
swarmfile git index --verify-full   # ignore the cache; re-derive and check every object

--verify-full re-derives without the incremental/sparse caches and checks each derived object against its content address before uploading - a slow but complete self-check for a suspicious or freshly upgraded machine.

git clear-claim#

Owner/admin only: resets the commit claim at a sequence number on the selected mount's repository. Most claims are never cleared by hand: Swarmfile's server (for a pushed commit) or a teammate's fetch confirms a provisional one, and a disputed one is settled by Swarmfile deriving it again on the server, usually within a minute or two.

This is the escape hatch for a claimed commit that can't be served: a disputed row (two derivations disagree), a claim whose root tree is gone, or a stranded snapshot-mint head - git push mints the branch's live tree as a snapshot when it has drive saves, and if the push is then refused, that snapshot stays as the provisional head; clearing it also rolls the branch head back to the snapshot's parent, so the next fetch mints afresh from the live tree.

A healthy claim - including a member's own - is never discarded: the hub answers cleared: false and says why.

Clearing resets the hub's record of the claim, so it is confirmation-gated: -y/--yes skips the prompt, and a scripted run (--json, or no interactive terminal) must pass it. Dispute evidence is kept, not deleted: an owner or admin can read both values, their trees, parents and claimants before or after a clear with git disputes (add --all once it is cleared), or in the Commit disputes section of the repository's Commits page on the web.

Argument/flagMeaning
SEQThe changeset sequence number to clear.
-y/--yesSkip the confirmation prompt. Required with --json and when stdin isn't a terminal.

Exits 0 when the claim was cleared (an already-confirmed or archived seq prints that instead), 2 on a refusal (not an owner/admin) or when the confirmation is missing, 1 when the hub couldn't be reached.

swarmfile git index '#42'          # see what the hub holds first
swarmfile git clear-claim 42       # reset it; a stranded snapshot head rolls back
swarmfile git clear-claim 42 -y

git disputes#

Owner/admin only: lists the commit disputes on the selected mount's repository, newest first. A dispute means two derivations of the same commit produced different hashes, so git access can't serve that commit until Swarmfile settles the dispute (usually within a minute or two, by deriving the commit again on the server) or an owner or admin clears its claim.

Each block shows the commit's sequence number, when the dispute was recorded, the claim's current status, and both sides: the challenging claim and the one it contradicted, each with its commit hash, tree, parents and claimant. A claimant is a user, an API key, or Swarmfile's server-side derivation.

By default only open disputes are listed: not yet cleared, on a commit that is still disputed or provisional. Resolve one Swarmfile could not settle, or override a settlement that left the commit provisional, with git clear-claim; the evidence is kept, and Swarmfile derives the commit again on its own (unless its own derivation was part of the dispute), as does the next swarmfile git index or a teammate's fetch.

Argument/flagMeaning
SEQOnly the disputes for this commit sequence number.
--allInclude cleared and evidence-only disputes.

--json prints the hub's list unchanged. Exits 0 on success (an empty list included), 2 on a refusal (not an owner/admin), 1 when the hub couldn't be reached.

swarmfile git disputes             # open disputes on this repository
swarmfile git disputes 42 --all    # every record for commit 42, cleared ones included
swarmfile git disputes --json

offline#

Pack & Go: materialize a scope and reserve the whole scope with one long-lived offline reservation, so it stays editable with the hub unreachable. hydrate above only makes content readable offline; this is the form that also makes it writable. It runs as a background job, and the scope follows the selected mount's branch (target another mount with the global --mount <id>).

SubcommandFlagsDescription
prepare[path], --duration-secs <N>, --offline-days <D>, --no-waitMaterialize and reserve. The lease defaults to 7 days, clamped at 30; a lease is only renewed while online, so --offline-days, when longer than the lease, extends the lease to cover the trip (an explicit shorter --duration-secs is never overridden - it warns instead). Prints how many files the reservation covers. If another machine holds an overlapping reservation or is editing a file inside the scope, the prepare is refused naming the holder and nothing is reserved. Then polls to completion unless --no-wait.
status-Progress of the current (or last) job - interruptedScope names one a restart interrupted - plus what this engine holds right now (file edit locks and folder/repository reservations, with an expiring-soon and renewal-failure warning).
cancel-Ask a running prepare to stop - reservations already taken are kept, and the content download this prepare started is stopped too (only that job, never a newer one).
resume-Complete a prepare a restart interrupted; re-reserves the scope idempotently.
return[path]Release reservations: at or under one path, or with no path every reservation this engine holds (per-file locks and scope reservations alike). In-scope saves are given a few seconds to land first; any still syncing are reported.
swarmfile offline prepare ./Repositories/shots/seqA --offline-days 14
swarmfile offline status
swarmfile offline return ./Repositories/shots/seqA

fetch#

Pull a byte range of one file into the local cache - including from a version somebody else is still uploading.

On a slow link a large upload takes hours or days, and until it finishes the new version isn't readable at all. This asks the uploading machine to send the part you need first, then downloads it as it lands. What you get back is the time it takes to send that range, not the time it takes to send the file.

FlagDescription
--tail <bytes>Fetch the last N bytes. The common case for media, where the part you need is at the end. Resolved against the in-flight size, which is why it's a flag rather than arithmetic you do yourself - see below.
--start <bytes>First byte of the range. Default 0. Conflicts with --tail.
--len <bytes>How many bytes from --start. Clamped to the end of the file. Conflicts with --tail.
--version <which>newest (default - the in-flight version if there is one, otherwise the committed one), pending (fail unless something is uploading), or head (the committed version only).
--followTrack a moving reader instead of fetching a fixed range: keep a buffer ahead of wherever it is and re-target when it seeks. --start becomes the initial position; --len and --tail are rejected together with --follow.
# The last 200 MB of a file a colleague is still uploading
swarmfile fetch ./Repositories/reel-04.r3d --tail 209715200

# A specific window of the committed version
swarmfile fetch ./Repositories/site.rvt --start 0 --len 52428800 --version head

The command polls until every block has landed, printing progress as it goes:

$ swarmfile fetch ./Repositories/reel-04.r3d --tail 209715200
19/160 blocks, 25.8 MiB fetched (waiting on the upload)
...
fetch complete: 160/160 blocks, 200.0 MiB now local

"waiting on the upload" is the normal state, not a stall. The blocks you asked for may not exist yet - the other machine is still sending them at its uplink speed - so this command can legitimately run for a long time. It gives up only when nothing is arriving and the hub reports that the upload has stopped, and says so rather than hanging.

Why --tail rather than working out the offset yourself: the size to measure back from is the in-flight version's, and the file's committed size is still the old version's. A number you compute locally would measure from the wrong end of the wrong file.

--version pending fails outright when nothing is uploading, rather than quietly giving you the committed version. That is deliberate: somebody who asked for the version in progress and silently received yesterday's bytes has no way to tell.

Fetched blocks are pinned exactly like hydrate, so they aren't evicted by the cache's LRU sweep before you open the file - and they are released the same way, with swarmfile hydrate release <path>. One job runs at a time; starting a second while one is running is refused rather than queued.

You can also do this without the CLI: reading the file normally through the mount always works, and gets the committed version. fetch is for the case where the version you want is still on its way. (A mount also streams a file that has never finished uploading - see the config reference.)

Following a moving reader#

A fixed range is the right shape for "give me the last 200 MB". It's the wrong shape for watching a file as it uploads, because a viewer plays forward and seeks. --follow keeps a buffer ahead of a read position you report as it moves, and re-targets when it jumps.

CommandFlagsDescription
fetch <path> --follow--start <bytes>, --version <which>Start following from --start (default 0). Returns once the job is running; it does not complete on its own.
fetch-seek<position: u64>Report where the reader has got to. The buffer re-targets there immediately. A no-op if nothing is following.
fetch-status-Progress of the current (or last) fetch. The way to watch a --follow job.
swarmfile fetch ./Repositories/reel-04.r3d --follow --version pending
swarmfile fetch-seek 5000000
swarmfile fetch-status

For a follow job, fetch-status reports position, bufferedBytes and readRateBps rather than a block count. bufferedBytes is the number worth watching: it counts contiguous bytes from the read position, so it answers "will this play" - where a block total does not. A hole two blocks ahead stalls a reader however full the rest of the window is.

Buffer depth is derived from how fast the reader is actually consuming, not from a fixed byte count: 30 seconds of a 6 Mbit/s proxy and 30 seconds of a 200 Mbit/s master are very different numbers of bytes, and a single figure would be useless for one of them. Set the seconds with SWARMFILE_STREAM_BUFFER_SECS (default 30). A seek is not counted as playback, so scrubbing doesn't inflate the estimate.

A follow job ends when you cancel it, when the upload finishes and the buffer reaches the end of the file, or after five minutes with no fetch-seek - a paused viewer reports nothing, and one job runs at a time, so an abandoned follow would otherwise block every later fetch.

seed#

NAS/seed-node mode.

SubcommandDescription
statusCurrent seed-mode state.
enableTurn on seed mode. Requires the Pro plan or above, and is mutually exclusive with Cloud-only mode.
disableTurn off seed mode.

seed enable/disable restart the engine.

A headless cache is easiest to set up from the dashboard: Settings → Office caches generates the complete seed.env (scope and credential included) and lists the fleet's liveness and served bytes. seed enable is the toggle for an engine whose scope is already configured.

watch / unwatch / watches#

CommandDescription
watch <path>Watch a file or folder.
unwatch <path>Stop watching a file or folder.
watchesEverything you're currently watching in this repository.

lock / unlock / locks#

An explicit, up-to-30-day edit lock - like git lfs lock / Perforce's p4 edit. Not the same as the short-lived, automatic lock a plain write takes (from an app's first write to the file until it closes it); this one you take and release yourself.

CommandFlagsDescription
lock <path>--duration-secs <N>Reserve exclusive edit rights on a file, even offline. Defaults to 7 days, clamped to a 30-day maximum. Refused (exit 2) if someone else already holds it. Re-running lock on a file you already hold extends it, and a held lock is auto-renewed every 6 hours while the engine is online.
unlock <path>-Release a lock taken with lock.
lease <path>--duration-secs <N>, --release, --token <T>Hold or extend the short session lease (default 120s; the companion renews at half) on the ordinary standard lock. Unlike lock, this is not a Pack & Go checkout: the engine heartbeats it, it is not kept for offline use, and it releases within its deadline if the lease holder stops renewing. The acquire response carries a sessionToken; --release --token T drops only that caller's reference.
stems check--manifest <path>, --song <id>, --all, --project <dir>, --strict, --quiet, --max-set-mb <n>, --qualityNative Ableton handoff validator (no Node): manifest, Set media references, WAV sample rate/channels/bit depth, data length and duration alignment. --max-set-mb raises the scan cap; --quality reports sample peak/clipped samples (not LUFS/true peak).
stems setup--manifest <path>, --song <id>, --project <dir>, --add-role <id>, --writeNative per-song setup checklist; optionally add roles/folders. Never edits the ALS.
stems companion--manifest <path>, --song <id>, --project <dir>, --watch-only, --no-watch, --interval, --stems-interval, --duration, --title-match, --lease-token, --process-only, --parent-pid <pid>, --once, --dry-run, --no-notifyNative companion: short session lease, current stem content-CID (rootCid) watcher and notifications. --process-only leases a non-Live DAW project and skips Live detection; --lease-token resumes the same per-caller lease after a companion restart; --parent-pid watches a parent tray PID and exits/releases the lease if it disappears. --dry-run prints the lease commands without acquiring or releasing a lease. No Node.
stems status--manifest <path>, --song <id>, --project <dir>, --jsonNative dashboard: the Set and each role’s engine sync state and current rootCid.
locks-Every file currently locked - for editing, or being written somewhere - in this repository's current branch.
swarmfile lock ./Repositories/tower-a.rvt
swarmfile lock ./Repositories/tower-a.rvt --duration-secs 86400   # 1 day
swarmfile locks
swarmfile unlock ./Repositories/tower-a.rvt

If someone else needs the file back before you release it, they can ask via unlock-request below - there's no force-release from another user's side.

Multi-song music repositories use one manifest per song at Songs/<song>/stems.json; pass that manifest path (the Desktop App's Music page does this automatically). A repository with the Song/ layout keeps Song/stems.json as the default.

chmod#

Mark a file executable or not - the same bit chmod +x sets on the mounted drive, and the one git records as mode 100755 (a script, a build tool) versus 100644. Swarmfile stores only this one bit: there are no separate read/write bits per user.

CommandDescription
chmod +x <path>Make a file executable.
chmod -x <path>Make it a plain, non-executable file.
swarmfile chmod +x ./tools/build.sh
swarmfile chmod -x ./docs/notes.txt --json
  • Files only: a folder or symlink is refused (not_a_file).
  • Works offline. The change shows at once on this machine and is sent when the hub is reachable again; the summary line (or "queued": true under --json) says when that's still pending.
  • On the macOS and Linux drive, chmod does the same thing: any execute bit (u+x, g+x or o+x) makes the file executable, and none makes it not. The drive shows executable files as rwxr-xr-x and every other file as rw-r--r--.
  • Windows has no execute bit, so swarmfile chmod is how you set it there. Editing a file on Windows keeps its bit, and so does an app that saves through a temporary file and renames it over the original.

comment / comments#

CommandFlagsDescription
comment <path>-m, --message <String> (required)Post a comment on a file.
comments <path>--limit <N>, --offset <N>List comments on a file, newest first. The hub caps one page at 199; --offset pages through the rest.

field#

Folder profiles - the typed columns ("Net", "Gross", "Payment Ref", …) a folder subtree can carry, defined org-wide with optional per-repository overrides. Values are hub-side, ACL-gated metadata (whoever can read the file can read its values), so each command resolves the path locally on this machine and relays the hub.

Read display formatting matches the web app's spreadsheet view, and export/import share the grid's CSV shape - including its formula-injection guard on text cells and its canonical number form.

Each write command (set, unset, import) applies through one metadata commit: an aborted batch commits nothing (never a partial write), and a later command always starts a fresh one.

All three write commands answer the same summary - applied, skipped, errors, plus the hub's message when a step was refused and aborted for the two refusal classes that name themselves (conflict on a 409/field_value_conflict, forbidden on a 403; a 400-class refusal carries the hub's message with no aborted) - which --json prints raw; any skip, error or abort exits 2, with the per-item reasons on stderr.

SubcommandFlagsDescription
profile [PATH]--root, --jsonThe profile that applies to a folder - the nearest bound ancestor's, else the repository default - printed as its name then one heading (type) line per field. --root asks for the repository default directly (the tree's root level has no entry id, so no path reaches it); otherwise PATH is required and may be absolute or relative to the current directory. A folder with no profile prints the one line No folder profile is bound and still exits 0 - an explicit state, not an error.
show <path>--jsonOne entry's set field values under its resolved profile, one <heading>: <value> line per set field (absent fields are omitted): numbers grouped with thousands separators, currency pinned to 2 decimals (a profile field carrying an ISO 4217 currency code renders with its symbol in the web grid and the Desktop App's inline columns; this line stays the plain 2-decimal number), bool as Yes/No, dates and text as-is - the same formatting as the web grid. A file or folder with no bound profile exits 2 (No folder profile is bound to <path>); a profile with nothing set yet prints nothing and exits 0. --json prints the raw payload (entryId, found, profile, values).
export [FOLDER]--root, --csv, --jsonThe folder page as a spreadsheet. --root exports the repository-default profile's root page instead (one of FOLDER or --root is required, and they conflict: the tree's root level has no entry id, so no path reaches it). --csv renders RFC 4180 CSV: header name plus each field's heading, one row per listed entry with the raw stored values (never the formatted display), a cell containing a comma, quote, CR or LF quoted with " and its inner quotes doubled, and \n row separators (trailing newline included). Text cells - headings, entry names and string values - starting with =, +, -, @, a tab or a CR get a leading apostrophe so a spreadsheet treats them as text, never a formula; numbers and booleans are typed data and stay as-is (numbers render in the web's canonical form, 1e16 as 10000000000000000). Without --csv - or under --json - the raw JSON rows print instead. A folder with no bound profile refuses --csv with exit 2 (there are no headings to export); an unknown path or a hub/control failure exits 2 with a one-line reason.
set <path> <HEADING=VALUE>...--jsonSet field values on one entry under its resolved profile; the assignments are repeatable and all ride one metadata commit. Cells are pre-checked per item like the web editor's own parse: number/currency as numbers (Net=1234.50; hex/bin/oct spellings are refused), bool as true/false, date as YYYY-MM-DD with a real-calendar check, enum against the field's options, url as an absolute http(s) address, a field pattern as an anchored whole-value match, and text/url/user trimmed as typed. A blank value clears the field - the web editor's emptied-cell rule, bool included (an emptied bool cell clears it). An unknown or ambiguous heading, or an invalid cell of a locally checked type, exits 2 with the per-item reason on stderr while the remaining assignments still commit; a value the HUB rejects (the local checks are a pre-check - the hub stays the final validator) aborts the batch instead: nothing commits, and the hub's own message is reported. A conflict (a value that moved under you) likewise commits nothing and exits 2 (aborted: conflict; aborted appears for conflict/forbidden only). No bound profile is exit 2.
unset <path> <HEADING>...--jsonClear the named headings on one entry - a cleared field is a deleted value, never a null - all in one metadata commit. An unknown or ambiguous heading exits 2 with the reason on stderr; the rest still commit.
import <FOLDER>--csv <FILE>, --jsonApply a CSV to a folder page in one metadata commit - the inverse of export --csv. The header's leading name column plus the field headings (any order) map each row to a listed entry; the file follows RFC 4180 (quoted commas/quotes/newlines, CRLF or LF records, blank lines skipped, a leading BOM dropped), so the export's own output round-trips - including the export's formula guard: a leading apostrophe before a =, +, -, @, tab or CR is stripped again on import, so a guarded text cell (or a guarded entry name) returns as the original value. A blank cell clears that field for that row, like the grid's import (bool included). Rows naming no listed entry (or with an empty name cell), heading labels that match no field or match more than one, and invalid cells of the locally checked types (number/currency, date, enum, url, pattern, bool) are reported per item on stderr and exit 2 - the valid cells still commit. A value the HUB rejects aborts the whole batch instead: nothing commits and the hub's message is reported. A name repeated on several rows updates that entry once per cell (the last row wins where they disagree) - the summary counts that entry's cells once, where the web grid counts every row's; the stored result is identical. Every echoed cell in the messages carries the export's formula-injection guard. A missing or unreadable --csv file, or a folder with no bound profile, exits 2 before any request.
swarmfile field profile ./Repositories/invoices
swarmfile field profile --root
swarmfile field show ./Repositories/invoices/INV-0042.pdf
swarmfile field export ./Repositories/invoices --csv > invoices.csv
swarmfile field export ./Repositories/invoices            # raw JSON rows instead
swarmfile field export --root --csv > root-page.csv   # the repository default's root page
swarmfile field set ./Repositories/invoices/INV-0042.pdf Net=1234.50 Paid=true
swarmfile field set ./Repositories/invoices/INV-0042.pdf Note=   # a blank value clears the field
swarmfile field unset ./Repositories/invoices/INV-0042.pdf Net Paid
swarmfile field import ./Repositories/invoices --csv invoices.csv   # the export shape, back in

trash#

Soft-deleted entries in this mount's repository - the headless equivalent of the Desktop App's Trash page.

SubcommandFlagsDescription
list--limit <N> (default 50), --offset <N>Your own soft-deleted entries, newest-deleted first.
restore <entry-id>--with-nearbyUndelete back to its original location. Refused with name_conflict/parent_deleted (exit 2) if something else has since taken that name or the parent folder is itself gone - either way the response names the conflicting entry so you can resolve it by hand. A folder deleted from the desktop drive is deleted file by file, so restoring it brings back the folder and lists the items deleted inside it just before it (nearbyDeleted under --json); --with-nearby restores those too.
purge <entry-id>--preview, -y, --yesPermanently delete ("Delete Forever") - not recoverable, unlike a normal delete. --preview reports how many descendants a folder would take with it, without removing anything. Asks first; --yes skips the prompt (or refuses on a non-interactive stdin / under --json).
swarmfile trash list --limit 100
swarmfile trash restore 3f9a2b --with-nearby
swarmfile trash purge 3f9a2b --preview
swarmfile trash purge 3f9a2b --yes

unlock-request#

Ask someone to release a file they have locked - distinct from lock/unlock above (edit locks you hold); this is the "please give it back" workflow for a lock someone else holds, the same feature the Desktop App's request-unlock modal drives.

SubcommandFlagsDescription
create <path> [-m, --message]-Ask the current holder to release path. If it just freed up on its own, the hub reports that directly (noLock: true) instead of creating a request nobody needs to answer.
list [--status] [--entry-id] [--limit]--status (default pending)Unlock requests you're involved in, as requester or holder.
respond <entry-id> <request-id> --decision <granted|denied>-As the current holder, grant or deny a pending request against a file you have locked. Exit 2 if it's already resolved or isn't yours.
cancel <request-id>-As the requester, withdraw a still-pending request. Exit 2 if it's already resolved.
swarmfile unlock-request create ./Repositories/tower-a.rvt -m "need to push a fix before EOD"
swarmfile unlock-request list --status pending
swarmfile unlock-request respond 3f9a2b req_88 --decision granted

presence (alias who)#

Who's currently editing what in this repository.

check-ignore <path>#

Report whether a path is excluded from sync by .gitignore/.swarmfileignore, and by which rule - the diagnostic counterpart to ignore-clean. Answers "why isn't this file syncing?" the way git check-ignore -v does.

swarmfile check-ignore ./Repositories/node_modules/pkg.js

ignore-clean [path]#

A git rm --cached equivalent: remove already-hub-synced content that matches this machine's own .gitignore/.swarmfileignore sync-exclusion rules (see check-ignore) - for content that synced before the matching rule applied, or from a machine whose ignore rules differ.

The hub delete is a soft delete (recoverable from Trash for a while), and a matched directory's whole subtree is removed in one call rather than entry by entry.

Prints a size estimate and asks for confirmation first, unless --yes; without --yes a non-interactive stdin or --json refuses (exit 2), and --dry-run prints the estimate without confirming or deleting.

FlagDescription
[path]Mount-relative path to narrow the scope to a folder or file. Omit for the whole repository.
--dry-runPrint the size estimate and exit without deleting anything - the preview of exactly what --yes would remove.
-y, --yesSkip the confirmation prompt.
-f, --forceCross-machine safety override. Alongside --yes, proceed even if a top-level candidate was last modified by someone other than you within the last 7 days. Without --force, --yes refuses in that case. Interactive mode is never gated by this - a human already sees the same who/when detail and answers the prompt regardless.
swarmfile ignore-clean
swarmfile ignore-clean ./Repositories/old-import --yes

With --yes --json it prints {"deleted":[ids],"failed":[{"entryId","error"}],"paused":[{"entryId","jobId","retryAtSecs","message"}]}. A paused entry is a large folder the hub has already moved to Trash, but whose cleanup is paused because the repository used up today's write budget; it finishes on its own (the human output prints it as paused: …, not as removed). Exit 2 when any delete failed, 75 when none failed but one is paused, otherwise 0.

completions <shell>#

Generate a shell completion script. Works without a running engine. Supports bash, zsh, fish, elvish, powershell.

swarmfile completions zsh > ~/.zsh/completions/_swarmfile

doctor#

Connectivity diagnostics - asks the running engine to run its probe suite. --latency adds the hub latency check: it times /health, the org's repository list, and the repository's branches/changesets routes three times each and reports min/avg/max, so a slow push or download can be attributed to the edge, the organization, or the repository's service. For a machine where the engine isn't running, use the standalone swarmfile-doctor binary instead (it takes --latency too).

FlagDescription
--latencyAlso measure per-route hub latency (health, the org repository list, the repository's branches/changesets). Adds a few round trips per route.

log#

The commit log as a compact, colored feed (like git log --oneline), scoped to the branch this mount is on. Each line shows the commit's 12-char hash (the full hash is what hash: refs and CI pins use).

Argument / FlagDescription
[REF]Start the log at a commit and walk back from it. Full ref vocabulary (#N/HEAD~N, a branch, a tag, a changeset id, or a 64-hex hash). A branch or tag lists that branch's history (log feature on a main mount shows feature's commits); a bare number, hash, or changeset id walks the mount's branch. --branch wins when given.
--limit <N>Default 20
--branch <name>Log another branch's history (read-only) instead of the mount's.

steps#

The harness-written agent timeline: commits whose message is step N: ... (newest first). The PostToolUse hook writes one after each mutating tool call, so this is the "what did the agent just do" view. Restore any step with swarmfile restore --to <seq>; the web History page has the same list behind Steps only.

FlagDescription
--limit <N>Default 50.
--branch <name>Read another branch's steps (read-only).
swarmfile steps
swarmfile steps --limit 20 --branch agent/render-farm-a1b2c3
swarmfile restore --to 482

tail#

Watch this repository's activity live - comments, watched-file changes, lock conflicts. Ctrl+C to stop.

This is the engine's local event bus for the mounted repository, not the org-wide Activity feed - for that, use activity (list/export/tail). The global --mount flag has no effect on tail: the stream covers every open mount's activity, not just the current one.

Headless engines#

api-key#

Repository-scoped API keys, for an engine that runs where nobody can complete a browser sign-in - a render-farm node, a CI runner, a build box. A machine holding one authenticates without an interactive OIDC session at all.

SubcommandDescription
listEvery key for this mount's org. Never shows key material.
create <name> [--repository <id>] [--branch-scope <branch>] [--path-glob <glob>]... [--deny-glob <glob>]...Mint a key. --repository defaults to this mount's own repository; it takes the repository id, not its slug (an id the org doesn't have is refused with repository_not_found). --branch-scope binds the key to one non-default branch and keeps git, history and merge requests there; repeatable --path-glob/--deny-glob make it engine/API-only and require a branch scope. The branch must already exist and be non-default.
revoke <id>Revoke by id (from list). Immediate - the key stops authenticating right away.
rate-limit <id> [max] [--clear]Set (or, with --clear, clear) that one key's own request ceiling, in requests per minute. Capped at the plan's per-user maximum - use it to let a render-farm/agent key burst above the plan's flat default.

Minting and revoking require an admin or owner role in this mount's org. The same mint/list/revoke lives on the dashboard's API keys page and the tray's API keys panel.

On a self-hosted community server a key stands for a person, so list, create and revoke work with the key the engine runs as. An owner key (what swarmfile-server admin mint-key makes by default) manages every key in the organization; a member key manages only itself and the keys it created.

A key created here is a member key for one repository; a key scoped to one repository, an owner's included, manages only that repository's keys. There is no plan cap, and rate-limit is not available there. Scoped branch/path keys are hosted-only; the community server rejects the scope fields. Roles and the rest are described in Self-hosting: Keys and access.

Minting is capped by the plan's headless-seat allowance - Free 1, Starter 2 per seat (min 5), Pro 5 per seat (min 10), Studio 10 per seat (min 20), plus any purchased headless seats at $2/month each - and a mint past the cap is refused with keys_cap; revoke an unused key or add a headless seat under Settings → Billing. Revoking frees the slot immediately, and a downgrade never revokes keys you already have - it only blocks minting new ones past the new allowance.

create prints the raw secret once. The hub never returns it again - copy it before you scroll. With --json the secret is in the response body's key field, which is what makes it scriptable; treat that output as the credential it is.

A key is walled off to exactly one repository. It cannot read or write anything else in the org - not even repositories the admin who minted it can see - so a compromised farm node is confined to the repository it was built for, and revoking a key stops that one machine without touching anybody's own session.

A branch-scoped key is narrower still: --branch-scope pins it to one non-default branch and keeps git, history and merge requests on that branch. Adding --path-glob/--deny-glob makes it engine/API-only: git, history, the commit walk and merge requests refuse it. The branch must already exist and be non-default.

The scope is set at mint time - revoke and mint a new key to change it - and each allow/deny list holds at most 64 globs of at most 1,024 characters. Minting does not validate the branch; the hub refuses a dead or default branch on first use. The dashboard and tray use the same fields.

Using one. Set it as SWARMFILE_API_KEY on the machine, and the engine skips sign-in entirely: no browser, no refresh token, no impersonating whoever happened to mint it. If both SWARMFILE_API_KEY and SWARMFILE_OIDC_REFRESH_TOKEN are set the API key wins, and the engine says so in its log rather than choosing quietly - a leftover personal refresh token on a shared machine is the more likely mistake of the two.

swarmfile api-key create farm-node-12 --repository proj_9f2a

If the mount covers more than one repository, --repository is required: there is no single obvious answer, and guessing one would scope a credential to the wrong place.

See Deployment Topologies for how this fits with per-node config files and seed nodes.

repository#

Repository lifecycle and settings in this mount's org - the headless/scripted equivalent of the Desktop App's repository settings.

SubcommandFlagsDescription
create <name> [--e2e] [--public] [--commit-mode] [--repository-type] [--keep-full-history] [--description] [--git-compatible] [--acl-mode] [--hub-only] [--residency] [--protect-default-branch] [--initial-branch] [--option]--e2e; --public; --commit-mode <auto-commit|staged>; --repository-type <revit_worksharing>; --keep-full-history <true|false>; --description <text>; --git-compatible; --acl-mode <open|protected> (Open by default; protected needs acls); --hub-only <true|false>; --residency <eu|us|fedramp|fedramp-high> (pins this repository's region at creation - per-repository and independent of the org's, fixed thereafter; needs the plan's residency capability and provisioned storage for the region); --protect-default-branch; --initial-branch <name> (the default branch's name - most repositories keep main; fixed at creation); --option <key=value> (repeatable - any create option by manifest key, e.g. `template=blankmedia
list-Every repository in this mount's org, with the currently-active one marked.
get <repository-id>-Full settings for one repository by id (see list for ids).
rename [name] [--slug]-Rename this mount's repository and/or its slug. The old slug is reserved as an alias, so old swarmfile:// URLs keep resolving (a keyed remote should use ids).
archive / unarchive-Soft-archive this mount's repository, or reverse it.
delete [--yes]-y, --yesPermanently delete this mount's repository and all its files, for everyone in the org. A hub-side soft delete: the repository leaves active use immediately and its files, history, git-LFS objects, and stored data are permanently purged 30 days later. Recovery isn't self-serve - contact support before the purge window closes to discuss it (it isn't guaranteed; the 30-day window is fixed, and a shorter per-user trash setting does not shorten it). Prints a warning and asks for confirmation first, unless --yes; refuses outright in --json mode without --yes rather than reading stdin. Consider archive instead if you just want to hide it.
set-keep-full-history <true|false>-Opt this repository's history out of retention GC (true, every past version stays revertable forever) or back into it (false). New repositories default per the organization's new-repository default (keep every saved version unless an owner changed it); create --keep-full-history false is the create-time opt-out, and this flips an existing repository either way.
set-type <revit_worksharing|none>-Mark this repository as Revit-worksharing (native OS-file-lock enforcement, hub-cross-machine), or clear it with none.
set-commit-mode <mode>-Lock this repository to a commit mode - a branch lock overrides this while set. mode is auto-commit, staged, or omitted/unset to clear.
show [repository-id]--jsonPrint this repository's effective settings and where each value came from - the CLI view of the Desktop App's repository settings. Defaults to the active repository; --json for scripting.
set <key=value>…-Set one or more settings in a single call. Supported keys: commit-mode, keep-full-history, type, name, slug, description, archived, hub-only (true/false/inherit; false and inherit both mean "inherit the org default" - a repository can only add hub-only, never force peer-to-peer over an org hub-only policy), allow-external-collaborators (true/false/inherit; the per-repository guest policy, where inherit follows the org's), allow-public-rfi and allow-public-access-requests (true/false; the public repository's RFI and access-request toggles, on by default), allow-public-discussions (true/false; the public repository's Discussions toggle, off by default - an explicit opt-in), and allow-public-issues (true/false; the public repository's Issues toggle, off by default - the same explicit opt-in), contribution-policy (off/proposals/open; who may send a cross-repository fork proposal), and conflict-mode (soft/hard; how a save that lost a concurrent-edit race is reported - hard makes the saving call itself fail with a stale-version error for automated writers, and default clears back to soft). Refuses an unknown key rather than silently ignoring it.
rotate-key-Rotate this mount's E2E repository key: mint a new generation and re-wrap it to every current device plus the org recovery key. Owner/admin and E2E only. Content written before the rotation stays sealed under the old generation and is not re-encrypted, so a device that already unwrapped the old key can still read it.

rename/archive/unarchive/delete/set/set-keep-full-history/set-type/set-commit-mode/rotate-key are owner-or-org-owner-gated: exit 2 on forbidden or not_found, exit 1 for anything else. rotate-key also exits 2 on a 409 (stale_generation - another device rotated first - or a recipient set that kept changing).

swarmfile repository create "Tower Block A"
swarmfile repository create "Secret Repository" --e2e
swarmfile repository create "Public Dataset" --public
swarmfile repository create "Lean Repository" --keep-full-history false
swarmfile repository create "Model" --repository-type revit_worksharing --description "Central model"
swarmfile repository create "Repo" --git-compatible --acl-mode protected --protect-default-branch
swarmfile repository create "EU Dataset" --residency eu --option hub-only=true
swarmfile repository create "Repo" --git-compatible
swarmfile repository show
swarmfile repository set commit-mode=staged keep-full-history=false hub-only=inherit
swarmfile repository rename "Tower Block A - Phase 2"
swarmfile repository set-keep-full-history true
swarmfile repository rotate-key

config#

YOUR personal default commit mode for this mount's repository - advisory only. Distinct from repository set-commit-mode/branch set-commit-mode above, which are admin locks: those, when set, always win over this personal preference. Also distinct from changeset-idle/attr-cache/etc. above, which are local, per-machine engine-behavior knobs, not a hub-side preference tied to your account.

SubcommandFlagsDescription
set-commit-mode [mode]-Set (or, omitted/unset, clear) your personal default. mode is auto-commit or staged. Refused (exit 2, policy_enforced) if an admin lock already resolves for this repository+branch - a preference is never silently set unable to take effect.
get-commit-mode-Shows your personal preference (pref, null when unset) and the effective mode with its source: the response's effectiveMode is what this mount's next save or changelist open will use, and effectiveSource is branch or repository for an admin lock (a lock always wins), user_pref when your own set-commit-mode default applies, or unenforced when nothing is set.
swarmfile config set-commit-mode staged
swarmfile config get-commit-mode
swarmfile config set-commit-mode unset

runner#

Read-only run history for the headless runner-as-CI daemon - see Runner (Headless CI) for the full walkthrough. Jobs execute unsandboxed as the daemon's own local user (see Security). There is no runner create/runner edit here: rules live in .swarmfile/runner.yml on the watched branch, not on the hub, so there's nothing on the hub side for this command to create or edit.

SubcommandFlagsDescription
runs--branch <name>Run history - every branch by default, or one branch with --branch. Each row carries the matched rule's name, the triggering commit, status (running/success/failure/timed_out), exit code, and a truncated log.
swarmfile runner runs
swarmfile runner runs --branch main

ci#

Hosted CI (.swarmfile/ci.yml workflows that run on Swarmfile's own containers - see the Hosted CI guide). Requires the engine to be signed in: reads, settings/size list, run and cancel need a signed-in member; enable/disable, secrets, variables, size and image writes are owner/admin on the hub, and hosted CI stays off for a repository until an owner enables it. In some organizations hosted CI is unavailable entirely, in which case these commands answer 404 ci_not_available. The workflow dialect is documented in the Hosted CI guide.

SubcommandFlagsDescription
list--branch <name>, --limit <n>Run history, newest first - every branch by default. Rows carry the workflow name, run number, commit, status and a blocked reason when admission refused.
status<run-id>One run plus its jobs: status, size, exit code, billed seconds, metered charge and the declared dependency-cache hit/miss.
cancel<run-id>Ask the hub to cancel a queued/running run.
rerun<run-id>Re-run a finished run as a NEW run at the same branch, commit and changeset - every job starts fresh. The hub re-runs the trigger gates, so an E2E repository or an unprotected branch without the opt-in refuses exactly like the original trigger (with the same typed code).
retry<job-id>Retry ONE failed job in place (owner/admin). The job's attempt count bumps, its per-attempt fields reset, and the run reopens and re-finalizes when the job finishes. success/running jobs cannot be retried.
run--branch <name>, --input NAME=VALUEManually dispatch the branch head's workflow (workflow_dispatch). --input is repeatable for workflows declaring on.manual.inputs; the hub coerces values to the declared type.
approve<job-id>, --denyApprove (or --deny) a job waiting on an environment. A denial fails the job environment_denied and settles the run. Eligibility is re-checked at decision time: the caller must be an eligible reviewer, cannot be the run's starter when the environment forbids self-approval, and cannot decide before the environment's wait timer elapses (exit 1 with ci_environment_wait_not_elapsed and the retry delay). Waiting time is not billed.
logs<job-id>, --offset <bytes>, --followOne job's log chunk on stdout (pipe-friendly); --offset continues where the last chunk ended. --follow keeps reading from the offset cursor (~2 s apart) and stops once the job is terminal and the tail is drained; Ctrl-C stops cleanly.
fork-status<mr-number>a contribution (fork-originated) merge request's live CI approval state: the bound source head, the live approval (id + approver) and the hub's own canApprove/reason verdict.
fork-approve<mr-number>, --head <sha>bind an owner/admin approval to the MR's EXACT 64-hex source head for contribution CI. A later commit revokes it (a stale --head is 409 head_changed); the hub refuses a non-maintainer and a non-fork MR. Fork runs stay off until the deployment enables CI_FORK_RUNS.
fork-revoke<mr-number> <approval-id>revoke one fork-CI approval.
settings-The repository's hosted-CI settings, including the monthly budget.
budget[<usd>|off]Show the repository's monthly budget, or set it in dollars (owner/admin). off clears it; the hub enforces the $100,000 ceiling and refuses admission with ci_budget_exceeded. The repository comes from the current mount.
enable--allow-unprotectedEnable hosted CI for the repository. --allow-unprotected is the loud opt-in for branches without effective protection (workflows can reference secrets, so leave it off unless you mean it).
disable-Disable hosted CI for the repository.
environment list--repositoryEnvironment definitions: the org's by default, this repository's own with --repository. Rows show the scope, URL, reviewers, self-approval rule, wait timer and allowed branches.
environment set <name>--repository, --url <url>, --reviewer <user:ID|role:ROLE> (repeatable), --starter-cannot-self-approve, --wait-seconds <0-43200>, --allow-branch <pattern> (repeatable)Create or replace one definition (owner/admin). The whole definition is replaced, so an omitted reviewer or branch is cleared. --reviewer takes user:<idp-user-id> or role:<owner|admin|member> (rank-inclusive); reviewer users must be org members. --allow-branch patterns are gitignore-style (main, release/*, a leading ! negation). A repository definition composes add-only with the org definition of the same name: its reviewers join the org's, the longer wait wins, and a branch must satisfy both policies - a workflow environment: never loses an org protection.
environment delete <name>--repositoryDelete one definition (owner/admin). Deleting an org definition also deletes its environment-scoped secrets and variables; a repository deletion falls back to the org definition if one exists.
environment secret list-Environment-scoped secret names and metadata for --environment <name> (values stay write-only). Add --repository to target this repository's environment store; the environment must be one of this repository's definitions. Environment secrets are defined on the org environment a job's environment: resolves; a repository-only environment has none of its own.
environment secret set <name>--from-env <VAR>, --scope <ci|session|both>Store an environment-scoped secret for the --environment <name> definition (hidden prompt, --from-env, or piped stdin), same write-only contract as secret set (org/environment secrets are CI-only: a non-ci --scope is refused). --repository targets this repository's environment store; a repository-only value resolves only in this repository and that environment and wins over the org environment value of the same name.
environment secret delete <name>-Remove an environment-scoped secret (the environment is named with --environment <name>; add --repository for this repository's store).
environment variable list-Environment-scoped variables (plaintext) for --environment <name>. Add --repository to target this repository's environment store.
environment variable set <name> <value>-Create or update an environment-scoped variable for --environment <name> (add --repository for this repository's store).
environment variable delete <name>-Remove an environment-scoped variable (the environment is named with --environment <name>; add --repository for this repository's store).
secret list-Secret names and metadata only - values are write-only and never printed.
secret set<name>, --from-env <VAR>, --scope <ci|session|both>Store a secret value: a hidden prompt when run in a terminal, --from-env <VAR> to read it from that environment variable, or piped stdin for scripts. The value never echoes or lands in shell history. --scope selects the data class for a repository secret (new secrets default to ci; an update keeps the secret's existing class unless --scope is given); session/both are rendered into agent sessions and redacted from their output - a value under 4 characters is not redacted.
secret delete<name>Remove a secret.
variable list-Names and values of the non-secret config.
variable set<name> <value>Create or update a variable.
variable delete<name>Remove a variable.
size list-Org-defined custom runner sizes.
size set<name>, --vcpu, --memory, --diskCreate or update a custom size (quarter-vCPU steps; the platform enforces the ceilings).
size delete<name>Remove a custom size.
image list-The organization's (bring-your-own) runner images plus the curated catalog.
image set<name> <ref>Register or re-point a digest-pinned image under swarmfile-runner/<org-id>/ (Pro and above to run); prepares it automatically.
image prepare <name>-f, --forceBuild/retry the runtime snapshot artifact; pending means run it again later. -f/--force re-verifies a row already marked ready (the artifact still exists and matches this digest). The CLI runs it automatically after image set; use it to retry a failed preparation.
image import <name> <sourceRef>--waitImport a digest-pinned external image from a public or private registry (private-source credentials come from SWARMFILE_SOURCE_USERNAME / SWARMFILE_SOURCE_PASSWORD, never argv); the source is copied, the runner layer appended, and the resolved reference registered. --wait polls to ready/failed.
image import-status <id>--waitPoll an import started by image import.
image build <name>--context <dir>, --dockerfile <path>, --target <stage>, --build-arg KEY=VALUE, --secret NAME, --cache, --source-commit <sha>, --allow-dirty, --no-prepare, --waitBuild an image from a Dockerfile through the hosted builder (Pro and above; enabled where the environment sets CI_IMAGE_BUILD=on - staging and production - otherwise ci_build_disabled). The context (default .) is packed as a gzipped tar with .git excluded (64 MiB compressed cap) and pinned to the checkout's HEAD; a dirty tree is refused unless --allow-dirty, and a secret-shaped build-arg key is refused. --secret NAME (repeatable; operator-gated, off by default) exposes an organization CI secret as a BuildKit secret (RUN --mount=type=secret,id=NAME); its value is resolved server-side and never returned or logged. --cache is refused (ci_build_cache_unavailable) in the trusted-importer build shape; no CI_BUILD_CACHE switch is read. The image is scanned before pushing, then the runner layer is appended and the image registered through the import path; --wait follows it and prepares it unless --no-prepare.
image build-status <id>--waitPoll one build (status, digest, scan summary, error).
image build-logs <id>-Print a build's log tail (the row keeps at most 16 KiB).
image build-cancel <id>-Cancel a running build; the builder deletes the staging tag on any non-ready terminal state, and cancel is refused once the image import has started.
image scan <name>--waitStart a vulnerability scan of an imported image. The command prints the scan id and status; --wait polls until the scan is passed, blocked or failed (blocked and failed exit 1) for up to the hub's 35-minute scan budget. If it is still running then, the command exits 1 rather than reporting success. With --json --wait it emits the terminal scan-status body (findings, waivers, current/effective verdict), not the POST start row.
image scan-status <name>-The latest scan: status, critical/high/fixable/blocking counts, every finding (CVE, severity, package, installed and fixed versions), the scanner error when one was recorded, and waivers for that scan's digest split into active and expired (revoked and other-digest waivers are omitted). A running scan reports findings as pending and a failed scan reports them unavailable rather than "none".
image waive <name> <cve>--reason <text>, --days <n>Grant (or refresh) a waiver for one CVE in the latest scan. --reason is required (3-500 characters); --days accepts 1-30 and defaults to 7.
image unwaive <name> <cve>-Revoke an active CVE waiver.
image delete<name>Remove an org image; jobs selecting it fail ci_image_unknown until it is registered again.
runner list-The organization's live self-hosted runners: name, labels, project allowlist, last seen and managed/E2E caps.
runner create <name>--label <label> (repeatable), --repository <id> (repeatable), --allow-managed, --allow-e2eEnroll one runner (owner/admin). Prints the one-time sf_shr_ enrollment token; only its hash is stored, so copy it into the installer now.
runner delete <id>-Revoke a runner; in-flight leases and the enrolled E2E device key are cut.
runner token <name>--label, --repository, --max-runners <n>, --ttl-hours <n>, --allow-managed, --allow-e2eMint a mint-only sf_srt_ registration token for an autoscaled fleet. The token is printed once; it cannot be shown again.
runner tokens-Registration-token metadata (not the values).
runner revoke-token <id>-Revoke a registration token and every ephemeral runner it minted.
runner queue-This repository's per-label self-hosted demand: queued jobs waiting for a runner and running jobs that hold one (owner/admin). The reference autoscaler polls the same route across the org's repositories.
provenance <file>--pin-key <jwk>Verify a hub-signed provenance/attestation JSON offline; --pin-key pins the signer key instead of trusting the statement's own key. No engine or hub is needed.
oidc--audience <aud>, --aws-role <arn>, --gcp <provider>, --azure, --azure-client-id <id>, --azure-tenant-id <id>, --export-env <file>Mint a short-lived OIDC token for a cloud provider. Only available INSIDE a hosted or self-hosted CI job whose workflow declared write: [oidc]; the job token is the credential, so there is no engine sign-in. The audience must exactly match one the organization's owner/admin allowed (an empty allowlist disables OIDC). The token is short-lived (10 minutes) and the command refuses after 10 mints for one job. --aws-role writes the AWS web-identity env, --gcp <provider-resource> writes a Google external-account credential file, and --azure (with --azure-client-id/--azure-tenant-id) writes the Azure federated-credential env; pick one provider per run. Without --export-env the command writes the provider env to .swarmfile-oidc-token (mode 0600).
metrics-Queue/cache SLO inputs for this repository (owner/admin): queued/running counts, waiting reasons, oldest queued, 24h terminal counts, started-job queue-time avg/p95/max, and cache declared/hit/miss/rate.
swarmfile ci list --branch main
swarmfile ci status 018f3c2e-…
swarmfile ci logs 018f3c2e-… --offset 65536 | less
swarmfile ci logs 018f3c2e-… --follow          # live until the job ends
swarmfile ci rerun 018f3c2e-…                  # clone a finished run
swarmfile ci retry 018f3c2e-…                  # re-queue one failed job
swarmfile ci approve 018f3c2e-…                # approve a waiting environment job
swarmfile ci approve 018f3c2e-… --deny         # deny it instead
swarmfile ci fork-status 12                    # a contribution MR's CI approval
swarmfile ci fork-approve 12 --head <sha>      # approve that exact source head
swarmfile ci fork-revoke 12 <approval-id>      # revoke it
swarmfile ci run --branch main
swarmfile ci environment list                  # the org's definitions
swarmfile ci environment list --repository        # this repository's own
swarmfile ci environment set production --reviewer role:admin --wait-seconds 600 --allow-branch main
swarmfile ci environment set staging --repository --reviewer user:idp_9f2a --allow-branch 'release/*'
swarmfile ci environment secret set DEPLOY_KEY --environment production   # org env
swarmfile ci environment secret set DEPLOY_KEY --environment production --repository  # repository env
swarmfile ci variable set REGION eu
swarmfile ci secret set NPM_TOKEN            # hidden prompt for the value
swarmfile ci secret set NPM_TOKEN --from-env NPM_TOKEN   # read it from the environment
swarmfile ci variable set REGION eu
swarmfile ci size set big --vcpu 4 --memory 12 --disk 20
swarmfile ci image list
swarmfile ci image set our-rust "$BYO_IMAGE_REF"   # the digest-pinned ref from the Hosted CI guide
swarmfile ci image prepare our-rust
swarmfile ci image import our-rust docker.io/library/python@sha256:<64 hex> --wait
# Or build it yourself from a Dockerfile (Pro and above; a clean checkout):
swarmfile ci image build our-rust --context . --dockerfile docker/Dockerfile --wait
swarmfile ci image scan our-rust --wait
swarmfile ci image scan-status our-rust
swarmfile ci image waive our-rust CVE-2024-1234 --reason "not reachable from a workflow" --days 7
swarmfile ci image unwaive our-rust CVE-2024-1234
swarmfile ci runner list
swarmfile ci runner create linux-builder --label linux --label x64 --repository <project-id>
swarmfile ci runner token fleet --label linux --repository <project-id> --max-runners 20 --ttl-hours 24
swarmfile ci runner tokens
swarmfile ci runner revoke-token <token-id>
swarmfile ci runner delete <runner-id>
swarmfile ci runner queue              # this repository's per-label demand
swarmfile ci oidc --audience sts.amazonaws.com   # inside a `write: [oidc]` job
swarmfile ci oidc --audience sts.amazonaws.com --aws-role arn:aws:iam::123456789012:role/ci --export-env "$GITHUB_ENV"
swarmfile ci oidc --audience <gcp-pool-audience> --gcp projects/p/locations/global/workloadIdentityPools/pool/providers/gh --export-env "$GITHUB_ENV"
swarmfile ci oidc --audience api://AzureADTokenExchange --azure --azure-client-id <app-id> --azure-tenant-id <tenant-id> --export-env "$GITHUB_ENV"
swarmfile ci provenance attestation.json --pin-key signer.jwk
swarmfile ci metrics                   # queue/cache SLO inputs

billing#

Prepaid compute credit for hosted-CI overage (owner-only). A pack is bought once through Stripe Checkout; unused credit expires after 12 months and never raises the spend cap.

SubcommandFlagsDescription
packs--buyThe current mount's org's compute-credit balance, recent packs and their remaining credit. --buy starts a one-time Stripe Checkout and prints the URL.
swarmfile billing packs
swarmfile billing packs --buy

office#

Peer-discovery office grouping - applies immediately, no restart.

SubcommandFlagsDescription
status-This mount's current office_id and whether lan_from_office is on.
set<office_id>, --lan-from-officeSet the office-grouping label this mount announces for peer discovery. Pair with --lan-from-office on a network that blocks mDNS multicast - see ec-placement above.

Seed nodes are the one exception to --lan-from-office: a seed node joins another peer's placement roster purely by matching office_id, with no flag and no shared network required at all - see Self-Hosted Seed Nodes for using this to give a cloud-hosted render farm deliberate redundancy among its own nodes.

acl#

Folder-ACL repository mode and the ACL change log - the headless equivalent of the dashboard's ACL settings panel.

SubcommandFlagsDescription
mode get-Whether this mount's repository is open (default-readable) or protected (default-denied, entries need an explicit grant).
mode set <open|protected>-Switch repository ACL mode. Admin-or-owner-gated: exit 2 on forbidden/not_found. Switching to protected additionally needs the org's plan to include folder ACLs - exit 2 with plan_restricted (402) if not.
audit [--entry-id] [--limit] [--offset]-The ACL change log - every grant/revoke, repository- or entry-scoped.
entry get <entry-id>-The ACL roster on one entry (direct + inherited rows). <entry-id> accepts a mount path too (resolved first). Admin-gated: 403s for a member who is neither an org admin nor an entry admin (exit 2), since the roster reveals who else has access.
entry set <entry-id>--principal <id>, --permission <read|comment|comment_upload|write|admin>, --effect <allow|deny> (default allow), --inheritAdd or update a grant. Creating one needs the org's plan to include folder ACLs - exit 2 with plan_restricted (402) on Starter.
entry remove <entry-id> <principal-id>-Revoke a principal's grant on an entry.
principals [--query] [--limit] [--offset]-Look up an ACL principal id - the value entry set --principal and mr assign take. --query searches display name/email case-insensitively; without it, lists the org's principals. One page is capped at 50 rows; --offset pages past it, for a search as well as the full list.
swarmfile acl mode get
swarmfile acl mode set protected
swarmfile acl audit --entry-id 3f9a2b --limit 50
swarmfile acl principals --query "Priya"
swarmfile acl entry get 3f9a2b
swarmfile acl entry set 3f9a2b --principal u_9f2a --permission write --inherit
swarmfile acl entry remove 3f9a2b u_9f2a

acl entry is the per-entry grant surface the repository-wide mode toggle doesn't cover; the same grants are editable from the dashboard's permissions panel, and (on Windows) projected as NTFS DACLs on the mount.

e2e-key#

End-to-end encryption device keys.

SubcommandDescription
statusThis device's own enrolled key - id and public key - read straight from the local cache file, no hub round trip. enrolled: false means this device hasn't finished enrolling yet (or the binary was built without the e2e feature at all, flagged with e2eBuild: false).
listEvery device key on this account - every machine, not just this one. For finding the id of a lost device to revoke.
revoke <id>Revoke a device key by id (see list) - e.g. after a lost laptop.

There's no enroll here - a device enrolls its own key automatically at startup.

swarmfile e2e-key status
swarmfile e2e-key list
swarmfile e2e-key revoke key_9f2a

device-transfer#

Move a device's end-to-end repository keys onto a second device without going through the org's recovery-key quorum - a one-time, ten-minute code links the new device to an already-enrolled one and moves the wrapped repository keys across, entirely client-side. The private key never touches the hub.

SubcommandDescription
startRun on the device that already has the repository's key. Prints a one-time code, waits for a new device to link, then uploads this mount's currently-mounted repository key to it automatically. Requires an enrolled E2E key and a mounted E2E repository on this engine.
link <code> [--label]Run on the new device with the code from start. Waits for the other device to upload, then finalizes - re-wrapping every recovered repository key to this device's own already-enrolled key. --label names the device (shown later in e2e-key list and Settings → My Devices).

Both commands poll every couple of seconds until the handshake completes or the code expires; past 10 minutes either side reports a clear "expired, run start again" rather than hanging.

# On the device that already has the repository:
swarmfile device-transfer start
# Transfer code: 7F3K-9QRT
# On the new device, within 10 minutes, run:
#     swarmfile device-transfer link 7F3K-9QRT

# On the new device:
swarmfile device-transfer link 7F3K-9QRT --label "Jordan's laptop"

start transfers only the mount's currently-configured repository - run it again, once per mounted repository, on a device that holds more than one. There's no --enroll step on the new device: every engine enrolls its own long-term device key automatically at startup, and link/finalize re-wrap to that key directly.

If nobody's engine is online to complete an ordinary access grant, an org member can also fulfill it manually from the web dashboard rather than running this at all - see End-to-End Encryption Setup.

admin nodes#

The hub's P2P mesh node allow-list - owner-only. node_id is the 64-hex-char Ed25519 public key an engine self-generates (visible in the engine's own startup log, or in a not-yet-authorized node's connection-refused message). The same list, with an authorize form and a revoke button, is also available from Settings → Nodes in the web dashboard.

SubcommandFlagsDescription
list-Every node currently on the org's allow-list.
authorize <node-id> <user-id> [--label]-Add a node, authenticating as user-id.
revoke <node-id>-Remove a node - it can no longer join the mesh.
swarmfile admin nodes list
swarmfile admin nodes authorize a1b2c3...64hex user_88 --label "render-farm-3"

admin retention#

The organization's trash/history retention window and its size-adaptive floor, plus the history-retention default for NEW repositories - owner-only. When a repository approaches its storage limit, the hub automatically shrinks the retention window under pressure; the floor is the tightest it may ever shrink to. Both are null (the global defaults) until set.

keepFullHistoryDefault decides what newly created repositories start with: true (the product default) keeps every saved version, false starts them on named commits only - a creator's explicit choice at creation still wins. The same controls are in Settings → Organization in the web dashboard.

SubcommandFlagsDescription
get-The current window, floor, and new-repository retention default.
set--days <1-3650>, --floor <1-3650>, --clear-days, --clear-floor, --keep-full-history-default <true|false>Set and/or clear the day values, and/or set the new-repository default. Omitted fields are left unchanged. The hub rejects a floor above the window (it would be inert).
swarmfile admin retention get
swarmfile admin retention set --days 120 --floor 30
swarmfile admin retention set --clear-floor
swarmfile admin retention set --keep-full-history-default false

admin rate-limits#

The organization's request budgets: the per-org and per-user request ceilings, in requests per minute - owner/admin-configurable. The same limits appear in the tray's Settings → Developer panel and the web dashboard's Settings → Organization page. show reports the current values alongside each plan default and maximum; set changes them. The Free plan's limits are fixed, Starter/Pro cap at their tier maxima, and Enterprise's org ceiling can be removed entirely. A PAT shares its owner's per-user window; an API key gets its own window at the plan's default per-user value; content streaming isn't counted here.

SubcommandFlagsDescription
show-The current per-org and per-user ceilings, their plan defaults and maxima, and whether each is configurable.
usage-This minute's usage against the ceilings, for the whole org and for you (the caller), including the separate media-read windows.
set--org <n>, --user <n>, --clear-org, --clear-user, --unlimited-org, --for <dur>Set and/or clear either ceiling. Omitted fields are left unchanged. --clear-* resets a field to the plan default; --unlimited-org removes the org ceiling entirely (Enterprise only); --for 6h (units s/m/h/d, max 30 days) makes a raise auto-revert. The hub rejects a value above the plan's max and refuses any change on the Free plan.

rate-limits is also available at the top level (swarmfile rate-limits …) - the same subcommands, without the admin prefix.

swarmfile admin rate-limits show
swarmfile admin rate-limits usage
swarmfile admin rate-limits set --org 4000 --user 450
swarmfile admin rate-limits set --org 8000 --for 6h
swarmfile rate-limits set --clear-org
swarmfile rate-limits set --unlimited-org

notifications#

This account's notification inbox - comments, mentions, unlock requests, merge requests, RFIs, quarantine, failed uploads, and more. list/unread-count/read/read-all hit the hub's full notification feed (the same inbox the dashboard's bell shows), not just this machine's own upload failures.

SubcommandFlagsDescription
list--kind, --unread, --since <time>, --limitNotification history, newest first. --since accepts Unix seconds, epoch milliseconds, a duration (2h, 7d), or an RFC 3339 timestamp. --kind accepts a hub notification kind (the same open vocabulary - comments, mentions, unlocks, RFIs, MRs, quarantine, uploads, storage, …); an unknown value is rejected with the accepted list and exit 2, so a typo can't silently return the whole inbox.
unread-count-Cheap count for a shell prompt or a CI/cron check.
read <id>-Mark one notification read.
read-all [--kind]-Mark every notification read, optionally narrowed to one kind. An unknown --kind is rejected (exit 2) rather than marking the whole inbox read.
preferences get-Current email/webhook delivery preferences - the webhook status (url/enabled/configured) rides along in this same output.
preferences set--email-enabled [<true|false>] (bare = on), --quiet-start/--quiet-end (HH:MM), --timezone, --kind <KIND=on|off|default> (repeatable)Update one or more fields - omitted flags leave the existing value untouched. --quiet-start/--quiet-end must both be set together or both left unset. Clearing quiet hours or the timezone is dashboard-only: the API takes an explicit null for it, but the CLI has no null form (an empty value is a validation refusal), so there is no CLI clear. --kind sets a per-kind email override (off mutes that event, on forces it, default clears that kind's whole override - email and webhook - back to the kind's defaults: the global switches plus that kind's own default, where one applies); the CLI merges into your current overrides, so other kinds and their webhook flags are preserved. An unknown kind or malformed spec exits 2. Exit 2 on a 400 (mismatched pair or malformed time).
preferences webhook set <url>--enabled [<true|false>] (bare = on)Set (or change) YOUR OWN personal webhook - a third notification channel next to the in-app bell and email, one URL per user. The <url> argument is required on every call (no partial "just flip --enabled" shorthand - pass the same URL again to toggle it alone). Mints a fresh signing secret whenever the URL changes, or is set for the first time, and prints it ONCE. Distinct from the org-wide swarmfile webhook command group below: this one is fire-and-forget, with no delivery log or auto-disable.
preferences webhook clear-Remove your personal webhook.
preferences webhook rotate-secret-Mint a fresh signing secret without changing the URL. Hard cutover - the old secret stops verifying immediately. Prints the new secret ONCE.
preferences webhook test-Fire one synthetic event at your configured webhook right now, synchronously. Nothing is logged - this channel has no delivery log - the result prints directly.
swarmfile notifications list --unread --limit 20
swarmfile notifications list --kind comment_mention
swarmfile notifications read-all
swarmfile notifications preferences set --quiet-start 22:00 --quiet-end 07:00 --timezone America/New_York
swarmfile notifications preferences set --kind file_changed_by_other=off
swarmfile notifications preferences set --kind comment_added=default   # clears email + webhook for that kind

share#

Share links - a read/comment/respond link to one file, handed to someone outside the org. This covers only the member-authed management side: creating your own links, listing/revoking them, and (owner-only) the access log and email block-list. The anonymous recipient's own side of a link is the web-hosted /s/:token page, not a CLI surface.

SubcommandFlagsDescription
create <entry-id>--expires-at <unix-secs>, --max-accesses <N>, --password <string>, --allow-comments, --allow-responsesCreate a link for one file. <entry-id> accepts a mount path too (the path is resolved first). Exactly one of --allow-comments/--allow-responses is meaningful - the hub picks the more permissive one if both are set. --allow-responses is the RFI share-link path (needs a directory entry, not a file) - see RFI attachments. Exit 2 on a 400 (missing/invalid entry-id, or wrong entry type for the requested permission) or a 404 (entry gone).
list--entry-idThe caller's own share links, optionally narrowed to one file.
revoke <id>-Revoke a link. Exit 2 on 404 (not found, or not yours).
access-log <id>--limit, --offsetWho has actually opened this link (the mandatory-email-gating log, not just a hit count). Owner (creator) only - exit 2 on 404.
block <id> <email>-Block one email from this link going forward. Owner only. Takes effect on that email's next gated request - an already-issued 30-day session cookie isn't separately revoked.
unblock <id> <email>-Unblock a blocked email address. Owner only.
swarmfile share create e-1a2b3c --allow-comments --expires-at $(( $(date +%s) + 7*86400 ))   # one week from now
swarmfile share list --entry-id e-1a2b3c
swarmfile share access-log shr_9f2a --limit 20
swarmfile share block shr_9f2a spammer@example.com
swarmfile share revoke shr_9f2a

activity#

The org/repository activity feed - commits, branch switches, comments, CI runs, membership/ACL changes, who did what and when. An org owner sees everything; everyone else only what they have read access to (owner-only sources like quarantine and org-policy events repository to empty for them).

SubcommandFlagsDescription
list--since/--until <time>, --limit, --kind <csv>, --repository-id, --entry-id, --actor-id, --cursorThe feed, newest-filtered-window first. Defaults to the last 7 days when --since/--until are omitted. --since/--until accept Unix seconds, epoch milliseconds, a duration (2h, 7d), or an RFC 3339 timestamp. --kind takes a comma-separated list of event kinds. --cursor resumes from a previous response's pagination cursor.
export--since/--until, --kind, --repository-id, --out <path>Unbounded CSV export (capped at 100k rows hub-side) - org-owner-only, and needs the Pro+ audit_log entitlement (exit 2 on the 403 either gate returns). Prints CSV to stdout by default; --out writes it to a file instead. Not paginated - narrow --since/--until if you need a complete window (a response is capped at 100k rows).
tail--interval <secs> (default 3), --since <time>, --kind, --repository-id, --actor-idFollow the feed: print new events as they land, until Ctrl+C. Starts from now unless --since is given (same time shapes as list).

tail follows by polling the same feed list reads - polling is the supported way to follow the feed. Expect a few seconds of latency, bounded by --interval. With --json it prints one event per line (JSON-lines), so a consumer can process the stream incrementally instead of re-parsing a document that repeats each poll.

swarmfile activity list --kind mr_merged,commit_created --limit 50
swarmfile activity list --since 30d --repository-id p_9f2a
swarmfile activity tail --kind commit_created
swarmfile activity export --since 1767225600 --until 1798675200 --out audit-2026.csv

webhook#

Manages this org's outbound webhook subscriptions - signed HTTP callbacks fired on file/branch/merge/ACL/membership events, into Slack, Zapier, a SIEM, or your own endpoint. Deliveries are dispatched when the event is recorded, typically within seconds; the hourly tick is a backstop. Everything the web dashboard's webhook settings page does is available here too; this is the org-wide subscription list, distinct from the single personal channel under notifications preferences webhook above.

SubcommandFlagsDescription
list-Every webhook subscription for this mount's org. Never shows signing secrets.
create <url>--event <kind> (repeatable), --descriptionSubscribe a URL to org activity events. Prints the raw signing secret ONCE - copy it now, the hub never returns it again. --event may be repeated to subscribe to specific kinds only; omit it to receive every kind.
delete <id>-Remove a subscription. Immediate.
reenable <id>-Clear a subscription's auto-disable - the hub disables one automatically after too many consecutive delivery failures.
rotate-secret <id>-Mint a fresh signing secret. Hard cutover - the old secret stops verifying immediately. Prints the new secret ONCE.
update <id>--url, --description, --clear-descriptionUpdate a subscription's URL and/or description. An omitted flag keeps its current value. Doesn't touch which event kinds it receives or its custom headers.
deliveries <id>--limit, --cursorA subscription's delivery log, newest first, cursor-paginated (use the previous response's nextCursor).
test <id>-Fire one synthetic event at a subscription's URL right now, synchronously. Recorded in the delivery log, but never counts toward auto-disable health tracking.
retry-delivery <id> <delivery-id>-Manually re-send one past delivery. A delivery with no stored payload can't be retried.
swarmfile webhook create https://hooks.example.com/swarmfile --event mr_merged --event commit_created
swarmfile webhook list
swarmfile webhook deliveries wh_9f2a --limit 20
swarmfile webhook rotate-secret wh_9f2a

Scripting against the CLI#

Pass the global --json (before or after the subcommand - both work) and it prints the engine's raw response, which is the intended path for automation - commit from CI, hydrate before a render, check conflicts in a pre-flight script (conflicts resolve <path> --auto clears text conflicts headlessly, exiting 2 when a human is needed). A usage error under --json emits {"code":"usage_error",…} rather than clap's prose, so the same parser handles both. Pair it with an API key and no part of the loop needs a human.

To react to changes as they happen, activity tail polls the activity feed every --interval seconds and prints new events as they land. If your integration shouldn't run a poller at all, swarmfile webhook create (org owner) or notifications preferences webhook set (personal) both set up a signed HTTP callback to a URL you control instead.

They differ in delivery: org webhooks are dispatched when the event is recorded - typically within seconds, with the hourly tick as a backstop - and carry retries and a delivery log; the personal channel is fire-and-forget, enqueued as each notification happens, with no delivery log, retry, or auto-disable.

Something wrong or missing? Report a docs issue.