Skip to content

CLI reference

Every command inherits two persistent flags from the root command:

FlagDefaultMeaning
--configOS-resolved default (~/.squirrel/config.toml)TOML config file path (env: SQUIRREL_CONFIG).
--dbfrom config, else ~/.squirrel/index.dbSQLite database path; overrides db in config.

Resolution precedence for the database path is --db > config db field > $HOME/.squirrel/index.db.

squirrel index <volume> [--shallow] [--dry-run] [--workers N] [--progress]
squirrel sync [<volume>] [--to DEST] [--shallow] [--dry-run] [--init] [--progress]
squirrel status [<volume>]
squirrel verify [<destination>]
squirrel verify ack <destination>
squirrel offload <volume> [path...] [--older-than DUR] [--dry-run] [--per-file]
squirrel query [<hash-or-path>] [--history] [--duplicates] [--missing] [--from NODE]
squirrel runs [--volume NAME] [--limit N] [--failed] [--changes]
squirrel runs fail <id>
squirrel hooks [--volume NAME] [--limit N]
squirrel volumes
squirrel conflicts
squirrel conflicts resolve <volume> <path>
squirrel restore <volume> [--from NAME] [--to PATH] [--shallow] [--dry-run] [--in-place]
squirrel recover --from NAME [--snapshot NAME] [--execute] [--yes] [--force]
squirrel destination reset <dest> [--yes] [--dry-run]
squirrel audit [<volume>] [--deep | --folders]
squirrel config check
squirrel node pair <peer> [--local-endpoint URL] [--peer-endpoint URL]
[--peer-fingerprint sha256:HEX]
squirrel peer-sync history <volume> <peer>
squirrel peer-sync pull-durability <volume> <peer> [--allow-rewind]
squirrel db backup [--to PATH] [--keep N]
squirrel db check
squirrel db restore <snapshot> [--force]
squirrel db schema
squirrel tui
squirrel agent
squirrel agent cert [--force]
squirrel version

Commands split into two families (UX principle 2): introspection (status, runs, query, volumes, hooks, conflicts, config check, peer-sync history, db schema, db check, tui) is safe at any time and mutates nothing; change (sync --init, offload, restore, recover --execute, destination reset, conflicts resolve, verify ack, db restore, agent cert, node pair) is deliberate and typed by hand on purpose. recover without --execute belongs to the introspection half: it answers “what is recoverable here” and stops.

verify straddles the two on purpose, and is listed in neither: it is read-only against the remote, but writes what it learns locally — recording fingerprints, upgrading a durability vector, and latching an alarm on a mismatch. It is a question whose answer squirrel keeps.


Local content-addressed file indexer.

A bare squirrel with no subcommand opens the TUI when both stdin and stdout are TTYs; otherwise it prints help.


Walk a config-declared volume, hash regular files, and update the index.

squirrel index <volume>

Takes exactly one positional argument — a volume name declared in config. Indexing by raw path is not supported. See Indexing.

FlagDefaultMeaning
--shallowfalseSkip rehash when (size, mtime) match the stored row.
--dry-runfalseReport what would change without writing to the database.
--workers0 (= NumCPU())Number of hashing workers.
--progress, -Pauto on a TTYShow live progress; --progress=false forces off.

Push configured volumes to their destinations.

squirrel sync [<volume>]

Optional single positional. No arg = every (volume, destination) pair; one arg = every destination for that volume; --to narrows to one pair. See Syncing & first use.

FlagDefaultMeaning
--toallLimit to this destination name.
--shallowfalseSkip the checksum comparison on rclone mirror destinations; trust rclone’s size+mtime comparison. Refused on a native mirror (local, or sftp without crypt), which has no comparison to skip. A peer sync hashes every byte on both ends regardless.
--dry-runfalsePreview what a push would transfer without transferring; no runs row is written.
--initfalseAuthorise first-use destination bootstrap.
--progress, -Pauto on a TTYShow live transfer progress (files, bytes, rate, ETA).

Show per-target sync coverage and durability, and the offload-ready total.

squirrel status [<volume>]

Optional single positional; omitted = every declared volume. No flags. The read-only “am I safe?” answer: per volume, when it was last indexed, then one row per configured target with its role, last sync, state, durability coverage, verify method, and evidence age — then the fleet block below, and the volume’s offload readiness.

docs /home/you/Documents [amber]
index: 8s ago
TARGET ROLE LAST SYNC STATE DURABLE METHOD EVIDENCE
nas sync never never-synced — — —
offload: no policy
overall: amber

The agent applies a config edit itself, but part of one can need a restart — its listener, its credentials, its scan loop. When it does, a line above the grid names exactly which keys, and holds the report at amber until the restart happens:

config on disk has changed; the agent applied what it could and agent.auth.token still need a restart (/home/you/.squirrel/config.toml, noticed 12m ago)

The same line reports an edit the agent could not adopt at all — a file that no longer parses — in which case it is still running the last config it loaded.

Below the target grid, a fleet block answers where else the volume lives — the other machines as well as the destinations — and how current each copy is relative to this one:

FLEET KIND STATE MISSING LAST CHANGE LAST VERIFIED AS OF
nas node same 0 4m ago 2h ago 4m ago
htpc node behind 12 6d ago 6d ago 5m ago
usb destination same 0 1h ago 1h ago 1h ago
s3archive relayed ahead 0 unknown 9h ago 1h ago
laptop node unknown — 20m ago unknown 20m ago

KIND says what sort of place it is, in this config’s terms: a peer node, a destination this machine drives itself, or relayed — a name this machine has no config for, whose evidence arrives via a peer’s durability pull. An offload_requires entry only the hub can reach is relayed from every edge machine’s seat, and so is a destination dropped from the config that still holds copies of this content.

STATE compares that place’s content with this machine’s: same, behind (it has not received everything here — MISSING counts how many files), ahead (it holds content this machine has never seen), diverged (both), or unknown. A MISSING of — is not zero: it means nothing here records what that place holds, which is the normal reading for a machine that pushes to this one, and for any pair that compares by size+mtime rather than by content.

LAST CHANGE is when content there last moved as far as this machine knows. LAST VERIFIED is the age of the oldest verification behind that place’s coverage, so one freshly checked component cannot make the rest look checked. AS OF is when this machine last heard from that place at all — every other cell in the row is a fact as of that moment and no later. A place that has gone dark past its cadence keeps its last known figures and its STATE reverts to unknown, so it reads as out of contact rather than healthy. A row’s severity is the age of what this machine knows, judged against the same cadence the grid uses — so the block sharpens the answer without ever reddening a report the grid calls green, and a backlog waiting for the next scheduled sync is not a fault.

Every figure is computed from this machine’s own index — the durability watermarks that already flow between peers — so the block costs no network round trip and works the same on a laptop as on the hub. The one thing it cannot count is the ahead direction: a watermark says content exists somewhere this machine has not seen, but not how many files, so MISSING never fills in for it.

The exit code carries the worst level, so the same command scripts a health check without parsing the grid:

ExitLevelMeaning
0green / neutralCaught up within cadence and durable where policy requires; nothing to report.
1amberNot caught up yet, needs a one-time bootstrap, evidence aged past policy, or the agent’s config has drifted from the file on disk. Recoverable and expected.
2redA latched alarm, a failed or regressed sync, or a pair far past its cadence.

Passing a volume name scopes both the grid and the exit code to that volume, so a per-volume check is not reddened by an unrelated one. Config drift is the one exception: it is node-wide — every volume’s paths, targets, and cadences came out of that file — so it is reported and counted on every scope. The TUI dashboard renders the same facts from the same query layer — see Terminal UI.


Re-check what squirrel recorded storing on a destination: objects and packs against their upload fingerprints, a native mirror’s copies by size and mtime, and on a local disk a rotating tenth of them by BLAKE3.

squirrel verify [<destination>]

Optional single positional. If omitted, verifies every content-addressed or packed destination and every native mirror in config (sorted). An explicit destination must be one of those, else it errors: a mirror rclone writes records nothing to re-check. No flags. See Offsite verification.

A clean pass does two things beyond reporting: it fills any pending fingerprints and then upgrades the destination’s durability vector to a content-verified method, which is what lets offload accept it. A mismatch latches a standing alarm on the destination that survives the run and shows on every surface until acknowledged. On a native mirror, a copy found gone or changed is also marked lost, and the next push writes it again.

Acknowledge and clear a standing verify alarm on a destination.

squirrel verify ack <destination>

Exactly one positional — the destination name. No flags. Clears the latch raised by a verify mismatch so the destination stops showing red; the raise and the clear both survive in the audit trail with the operator recorded. A subsequent clean verify pass also clears the alarm on its own.


Delete local bytes whose content is durable on every required target.

squirrel offload <volume> [path...]

First positional is the volume; remaining positionals are volume-relative file or directory-prefix paths. At least one selector (a path or --older-than) is required; a volume without an offload_requires policy is refused. Gate refusals are reported in aggregate — grouped by target and cause, with each required target’s satisfied count — see Reading a refusal.

FlagDefaultMeaning
--older-than—Only files whose indexed mtime is older than this duration (Go durations like 720h, or whole days like 90d).
--dry-runfalseReport the durability gate decisions without deleting anything.
--per-filefalseAlso list every blocked file with its own gate reasons; refusals are aggregated by target and cause otherwise.

Look up the index by hash, path, or list duplicates/missing.

squirrel query [<hash-or-path>]

Optional single positional — a 64-char hex BLAKE3 digest or a path. (A 64-char hex string that also exists on disk, or contains a path separator, is treated as a path.) Requires one of: <hash>, <path>, --duplicates, --missing, or --from.

FlagDefaultMeaning
--duplicatesfalseList hashes that appear at more than one path. Rejects a positional argument.
--missingfalseList previously-indexed paths no longer on disk. Rejects a positional argument.
--historyfalseWhen querying a path, also print the full content history at that path. (Path queries only.)
--from—Restrict results to rows whose content originates at this node.

List runs of every kind (most recent first).

squirrel runs

Takes no arguments. Lists every kind of run — index, sync, restore, audit, offload — not just index runs. (squirrel verify is recorded under audit, not as a kind of its own.) See Runs & the audit trail.

FlagDefaultMeaning
--volumeallFilter to runs against this volume name.
--limit20Maximum number of runs to show (0 for no limit).
--failedfalseShow only runs that need attention: failed, refused, aborted, or partial.
--changesfalseHide clean no-op runs; show only runs that moved content or need attention.

Under routine cadences most rows are no-ops (a pair checked, nothing to do). --changes keys on the count of files a run actually changed, so it folds away destination pushes and index runs too, not just peer-sync no-ops. Runs recorded before that count existed are shown rather than silently folded — their change count is genuinely unknown.

Mark a stuck running run as failed.

squirrel runs fail <id>

Exactly one positional — a run id. Only runs currently in status running may be failed; it writes a manual-fail audit row and preserves the running row’s file count. No flags.


List external-tool hook runs (most recent first).

squirrel hooks

Takes no arguments. See Hooks.

FlagDefaultMeaning
--volumeallFilter to hooks for this volume name.
--limit20Maximum number of hook runs to show (0 for no limit).

List known indexing volumes.

squirrel volumes

Takes no arguments and has no flags. Output is id<TAB>name<TAB>path per line.


List unresolved contested paths (frozen peer-sync conflicts).

squirrel conflicts

Takes no arguments and has no flags. When the same path is edited on two machines between cadences, the receiver preserves the loser under .squirrel-conflicts/ and raises a contested freeze on the path. While the freeze stands, a divergent re-assertion from any peer is refused instead of minting another conflict copy — the ping-pong stops at the first conflict. Both versions stay reachable: the winner is live, the loser is on disk.

no contested paths — nothing frozen

Every node mirrors the freeze into its own index, so the losing edge machine sees it too, not just the hub. See Peer sync.

Clear a contested freeze so syncs flow again (explicit human act).

squirrel conflicts resolve <volume> <path>

Two positionals: volume then the volume-relative path. No flags. Clearing the latch lets syncs resume for that path; the raise and the clear are both recorded with the operator’s name. Squirrel never resolves a conflict on its own.

Resolve does not choose a version. It unfreezes the path with the current winner live. Adopting the preserved version instead is a deliberate restore, never a side effect of resolving.


Pull a volume back from one of its destinations.

squirrel restore <volume>

Exactly one positional — the volume name. See Restoring.

FlagDefaultMeaning
--from—Destination name to pull from, or peer node name to filter by content origin.
--tovolume’s declared pathLocal target path.
--shallowfalseSkip the checksum comparison on the way down from an rclone mirror. Native mirrors and the content-addressed and packed layouts are always re-hashed to BLAKE3.
--dry-runfalsePreview what the restore would fetch without transferring.
--in-placefalsePermit restore against a non-empty live path; overwritten files move to .squirrel-restore-history/run-<id>/.

A native mirror restore needs no rclone: with an index it checks each path against it, and without one it walks the mirror and checks each file against the mirror’s receipts.

Restore from an encrypted (crypt) mirror is always a size+mtime comparison (recorded shallow) even without --shallow, because rclone crypt remotes don’t expose content hashes. An encrypted content-addressed or packed restore re-hashes every file to BLAKE3.


Walk through recovering this machine from a destination that holds its index and bytes.

squirrel recover --from <destination>

The guided form of the disaster runbook: it sequences the three phases that must happen in order — install the index, restore the volumes, re-pair the peers — and confirms each one. It decides nothing on its own.

It reports and stops by default. Without --execute it discovers what the destination holds, prints the full plan, and touches nothing, so it is safe to run purely to find out what is recoverable.

FlagDefaultMeaning
--from—Destination name to recover from. Required. A peer node is rejected: recovering a dead edge machine is a reverse peer push from the surviving hub, not a recover run.
--snapshotnewest foundIndex snapshot filename to install. Run without it to list what is there.
--executefalseCarry out the plan instead of only describing it.
--yesfalseAnswer every phase confirmation with yes, for a rehearsed recovery. Without it a non-interactive stdin stops rather than proceeding.
--forcefalseSkip the running-agent check when installing the index.

Phase 1 installs the index and is the only destructive step; it preserves any existing index beside the new one rather than deleting it, and records the recovery as an audit run in the recovered database — the one it replaced is no longer the trail anyone reads. Phase 2 runs a normal restore per volume, each with its own run row. Phase 3 prints the agent cert and node pair commands; pairing needs both machines, so squirrel names them rather than running them.

A failure stops the sequence where it happened rather than half-recovering. Re-running continues from the volume that failed.


Manage a destination’s recorded state.

On its own it prints help. See Recovery & disaster runbooks.

Forget a destination’s recorded upload and durability state (audit-preserving).

squirrel destination reset <destination>

One positional — the destination name. Clears the remote_objects/remote_packs/remote_paths upload ledgers, the durability vector, and the push-freshness rows for the destination, so the next sync treats it as fresh and re-uploads. The runs table and the append-only durability advance log are preserved, and the reset is recorded as an audit run; the remote bytes are untouched.

FlagDefaultMeaning
--yesfalseConfirm the reset; required to actually clear state.
--dry-runfalsePrint what would be cleared without changing anything.

Use it to recover a wrecked or repointed destination — see Resetting a wrecked destination.


Walk a volume looking for out-of-band drift since the last index.

squirrel audit [<volume>]

Optional single positional; omitted = every declared volume (sorted). See Auditing for drift.

FlagDefaultMeaning
--deepfalseRe-hash every file (bit-rot check) instead of the size+mtime shortcut.
--foldersfalseRe-derive folder Merkle hashes from the index and report divergence (no disk walk).

--deep and --folders are mutually exclusive.


Inspect the squirrel configuration.

On its own it prints help.

Parse and resolve the config, stat its paths, and report what it declares.

squirrel config check

Takes no arguments and has no flags. The first command to run after writing or editing a config: it reads the config file, not the database, so a declared but never-indexed volume still shows up. Each volume, destination, and node is stated with its resolved path and an ok or a flagged problem, and the summary line affirms what was found.

config: ~/.squirrel/config.toml
volumes (1)
ok docs /home/you/Documents
destinations (1)
ok nas local mirror
nodes (0)
1 volumes, 1 destinations, 0 nodes — all resolvable

Nodes report their endpoint. Whether a peer answers is a sync-time question, not one a read-only check can settle — the same way a destination’s remote reachability is left to the sync that needs it.


Manage peer node relationships.

On its own it prints help. See Peer sync.

Emit matching config halves (tokens, endpoints, fingerprints) for a peer relationship.

squirrel node pair <peer>

Exactly one positional — the peer’s node name. A single peer relationship needs four token bindings across two machines’ config files, each side’s [agent.auth.peers.X] matching the other side’s [nodes.Y].auth.bearer. Writing those by hand is the most error-prone part of bootstrap, and nothing catches a mismatch until a sync fails with 401. This generates both halves so they match by construction.

FlagDefaultMeaning
--local-endpoint—This node’s agent endpoint as the peer dials it (e.g. https://nas.home:8443).
--peer-endpoint—The peer’s agent endpoint.
--peer-fingerprint—The peer’s TLS cert fingerprint (sha256:…), as printed by agent cert.

It emits config; it never edits a file. Paste each half into the machine it names.


Inspect node-sync state and exchange peer metadata.

On its own it prints help. See Peer sync.

List the watermark transition log for a (volume, peer) pair.

squirrel peer-sync history <volume> <peer>

Two positionals: volume then peer (a node name). Output oldest-first, columns AT and LAST_SHARED_RUN_ID. No flags.

Fetch a peer’s destination durability vectors for a volume into the local index.

squirrel peer-sync pull-durability <volume> <peer>

Two positionals: volume then peer (a node name from config).

FlagDefaultMeaning
--allow-rewindfalseAccept peer components below the locally recorded value (recovery override).

SQLite index hygiene: backup, integrity check, restore.

Parent command; prints help with no subcommand. See Index snapshots.

Write a consistent online snapshot of the index database.

squirrel db backup
FlagDefaultMeaning
--to~/.squirrel/backups/index-<ISO8601>.dbSnapshot destination path.
--keep0After writing, rotate the backups directory to keep at most N snapshots (0 = no rotation).

Run PRAGMA integrity_check on the index database.

squirrel db check

No flags. Prints ok when clean; otherwise prints each issue line and exits non-zero.

Replace the live index database with a previously taken snapshot.

squirrel db restore <snapshot>

Exactly one positional — the snapshot path. Refuses if the snapshot path equals the live DB path, or if the snapshot schema version differs from the binary’s schema version.

FlagDefaultMeaning
--forcefalseSkip the running-agent check; required when another process legitimately holds the DB open.

Print the index database’s DDL (tables, indexes, triggers).

squirrel db schema

No flags. Opens the DB (running the normal migration chain first), then prints the flattened DDL.


Open the interactive terminal UI.

squirrel tui

No arguments, no flags. Always opens the TUI regardless of TTY state. See Terminal UI.


Run the squirrel agent (HTTP server + scheduled audits + cadence-driven index/sync).

squirrel agent

No arguments, no flags. Requires an [agent] block in config. See The agent.

A machine that only runs cadences and never receives from a peer does not need a listener: omit listen and the agent runs listener-less, with no HTTP surface and no auth token to configure.

Generate the agent’s self-signed TLS cert+key and print its sha256: pin.

squirrel agent cert

No positionals. Writes the cert and key to the paths in [agent.tls] and prints the fingerprint peers must pin — the same sha256:<hex> string node pair takes as --peer-fingerprint. Certificate pinning is the documented trust anchor between agents; this removes the openssl incantations that used to be the only way to produce its ingredients.

FlagDefaultMeaning
--forcefalseOverwrite an existing cert/key. This changes the fingerprint — every peer must re-pin.

Print the squirrel version and build information.

squirrel version

No arguments, no flags. Prints the release, commit, build time, Go version, and platform, so you can confirm which build a machine is running:

squirrel v1.2.3
commit: a1b2c3d
built: 2026-07-24T10:00:00Z
go: go1.26.1
platform: linux/amd64

A source build reports 0.0.0-dev — the version is stamped only into released binaries. The agent reports the same string on GET /v1/health.