swarmfile-search
swarmfile-search searches file, folder, repository and people names in the local Swarmfile metadata cache, with fallback to the hub. It's a standalone binary for searching from a terminal or a script, rather than the dashboard omnibox. Every desktop installer carries it, and the Linux .deb, macOS .pkg and Windows installers put it on PATH (/usr/bin on Linux, /usr/local/bin on macOS, or the Windows install folder); a macOS .dmg-only install needs one .pkg (or Diagnostics → Reinstall) run for that entry.
The local cache is entries-only: it indexes file and folder names in a local full-text index, and it's what a plain query checks first. Repository and people (principal) name matches only come from the hub fallback - the local cache doesn't mirror those, so a query for a repository or person name needs a hub round-trip (or --remote) to find anything.
On the hub the two halves also live in different places: entries are indexed per repository, while repository and people names are org-wide. A query scoped with --repository (or $SWARMFILE_REPOSITORY_ID) therefore asks both routes and merges them, so you still get repository/people matches alongside the file hits; an unscoped hub query searches repository and people names only - file hits from the hub need --repository, or a warm local cache.
Either way, it's a metadata search - it finds things by name, not by file contents.
For the conceptual overview of how search resolves results and where else you can search from, see Search.
Usage#
swarmfile-search <query>
Flags#
| Flag | Description |
|---|---|
--repository | Scope the search to a single repository by ID. Defaults to $SWARMFILE_REPOSITORY_ID when set |
--limit | Maximum results. Default 20 |
--remote | Force the search against the hub. Conflicts with --local-only |
--local-only | Force the search against the local cache only. Conflicts with --remote |
--json | Print raw JSON instead of a human-readable list. Emits the hub's {files, folders, repositories, principals} shape plus a top-level source field |
Examples#
Plain query across the local cache, falling back to the hub if needed:
swarmfile-search "concept_v3"
Scoped to a repository, capped at 5 results, local cache only:
swarmfile-search "elevation" --repository proj_xyz789 --local-only --limit 5
JSON output for scripting:
swarmfile-search "plan.dwg" --json
Alongside the hub-shaped {files, folders, repositories, principals} object, --json adds a top-level source field so a script can tell where the results came from without changing the other keys - local, local (no fallback), remote, or remote (local fallback).
Something wrong or missing? Report a docs issue.