SwarmOps
ReferenceCLI reference
View as Markdown

CLI reference#

Every command of swarmops and so, its short form: the same program by a shorter name. This page and the command pages are generated from the command line's own definition, so they say what swarmops <command> --help says. -h prints the short help and --help the long help that the pages give.

Every command but mcp prints one JSON envelope on stdout; its op names the operation the command runs (cat runs read_file). Errors lists every error code an envelope can carry, with its exit code.

Each command's page gives its syntax, its arguments, an example recorded by the tests, what it returns and the errors it fails with. Its yaml metadata block says the same for programs: group, mutates (it can change what the store holds, its changesets and refs, or make the store; a write to the store's caches alone does not count), identity_required (it refuses to run without --as or SWARMOPS_AGENT), mcp_tool, envelope_op, exit_codes, errors and syntax.

Global options#

Every command takes these, before or after its subcommand.

OptionRequiredDescriptionDefault
--repo <STORE>noThe store to use (default: $SWARMOPS_REPO).
--as <AGENT>noThe agent to act as, <family>/<instance> (default: $SWARMOPS_AGENT).
--jsonnoPrint the JSON envelope: the default, unless $SWARMOPS_FORMAT is human.
--humannoPrint a short text rendering instead of JSON.
--pretty[=<BOOL>]noPretty-print the JSON (default: when stdout is a terminal).

-h prints a command's short help and --help its long help, as plain text, not an envelope. swarmops --version prints the version.

Commands#

25 of 25 commands
CommandMCP toolSummary
Store
swarmops initCreate a store in DIR, and describe it.
swarmops inforepo_infoDescribe the store.
swarmops whoamiShow the identity this caller's changes carry.
swarmops schemaPrint the JSON Schema of every request and response type, or of TYPE's.
swarmops deriveDerive the eager derived values of new changesets, ahead of any reader.
Write
swarmops commitcommitRecord a changeset from a list of changes; with --advance, also move that ref to it.
swarmops landlandMerge a change three-way onto a ref and publish it there as one new changeset.
swarmops blobStore content as a blob for a commit to name by its id, or ask which blobs the store holds.
swarmops blob putblob_putStore FILE's content as a blob, outside any commit, and print its id, which a change names it by: {"blob": ID}. A change list holds at most 64 MiB and a commit's contents 1 GiB together; a blob named by id counts toward neither.
swarmops blob hasblob_hasOf the IDs given, list those the store holds blobs under.
Read
swarmops resolveresolve_revName the changeset REV names, and whether REV is a ref's name.
swarmops catread_filePrint one file at a revision, or part of it: from a byte, or a range of lines.
swarmops lsread_treeList one directory at a revision (the root without a PATH), and with --depth the directories below it.
swarmops showshowShow one changeset.
swarmops loglogList history along first parents, newest first.
swarmops historypath_historyList the changesets that changed a path, newest first, along first parents.
swarmops diffdiffList the files that differ between two revisions, a page at a time.
Refs
swarmops refList refs, or move one by compare-and-swap.
swarmops ref listref_listList every ref.
swarmops ref setref_setPoint ref NAME at REV: move it from --expect, or --create it.
swarmops ref deleteref_deleteDelete ref NAME.
Operations
swarmops opList the store's operations, or undo one.
swarmops op logop_logList the store's operations, newest first: each write transaction, its changesets and its ref moves.
swarmops op undoundoMove every ref operation OP moved back to what it named before, all or none.
Integrity
swarmops verifyverifyCheck the store's consistency.
Git
swarmops gitBring history in from git, or send it back.
swarmops git importBring a git repository's history in: every commit --ref reaches that the store does not hold, then move --into to it.
swarmops git exportSend the store's history to git: write every commit of --ref's history that --branch's last export does not reach into the git repository at PATH, then move --branch to it.
Server
swarmops mcpServe the store's operations to an agent as an MCP server on stdin and stdout.
Edit on GitHub

On this page