Tag Selection
Tags are not just labels for the index. With --by-tag and --by-tags, most commands act on every object carrying certain tags instead of on paths — list a quarter's handouts, publish them in one go, move them into an archive, or keep a sorted view of them up to date with symlinks.
New in v0.6Tag selection works against any API v1 server: newer servers filter listings by tag, and the CLI re-checks every result itself, so an older server can never widen a selection.
Selecting by tag
--by-tag TAGrepeatableObjects with this one tag. Repeated flags are alternatives: --by-tag q1 --by-tag q2 selects either.
--by-tags "TAG TAG…"repeatableObjects with all of these space-separated tags.
All flags combine with OR, so --by-tag q1 --by-tags "math draft" means “q1, or both math and draft”. Up to 32 selections; tags follow the usual rules and are checked before any request (an invalid tag exits with code 2).
$ vela ls --by-tag q1
docs/math/q1.pdf
docs/physics/q1.pdf
$ vela ls --by-tags 'math draft' -l
- public 3 B 2026-10-31 08:57 docs/math/q1.pdf
Narrowing with paths
With a tag selection, paths become an optional scope. Without paths, the search covers everything your key can see; a directory narrows it to everything below (always recursively); a file is included only if it has the tags.
vela ls --by-tag q1 docs/math/ # only below docs/math/
vela stat --by-tag q1 docs/ notes/a.md # below docs/, plus notes/a.md if it matches
Symlinks are selected by their own tags, which they copied from their file when they were created. When nothing matches, listings print an empty result and every other command fails with not_found (exit code 3).
Which commands take a selection
| Group | Commands | Behavior |
|---|---|---|
| Read | ls, stat, url, get, links ls, trash ls | Run immediately |
| Change metadata | meta, vis | Run immediately, like -r |
| Everything else | rm, mv, ln, share, open, links revoke, trash purge, trash restore | Show the plan and ask first |
Reading
vela stat --by-tag q1 docs/ # every match; --json prints an array
vela url --by-tag handout # one URL per line
vela get --by-tag q1 docs/ ./q1 # download, keeping paths relative to docs/
vela links ls --by-tag review # signed links of the matching files
url reports private matches on stderr, since they have no public URL. get treats its first argument as the directory to search (/, the default, means everything) and recreates the structure below it in the local directory.
Changing metadata and visibility
vela meta --by-tag inbox --tag sorted --untag inbox
vela vis --by-tag handout public
These follow the rules of recursive meta: tags are edited per object, objects that already match are left alone, and --title and --content-type are refused.
Plans and confirmation
A tag can reach files you did not think of. Commands that delete, move, link, share or open a selection therefore print what they are about to do and ask once:
$ vela rm --by-tag scratch
tmp/a.txt
tmp/b.txt
Move 2 object(s) to the trash? [y/N] y
--dry-runonly prints the plan, on stdout — with--json, as JSON.-yskips the question. Without a terminal it is required; a script never acts on a selection silently.- The plan goes to stderr, so stdout keeps the command's result.
vela rm --by-tag draft --dry-run
vela share --by-tag review --ttl 7d -y # one signed link per match
vela open --by-tag slides # one browser tab per match; private ones are skipped
vela links revoke --by-tag review docs/ # active links of the matches
Moving a selection
vela mv --by-tag TAG [FROM...] TO/ [--save-structure] [--force]
Every match moves into the directory TO/ — flat, under its own name, or with --save-structure under its path relative to FROM (to the root when FROM is omitted):
$ vela mv --by-tag q1 docs/ archive/q1/ --save-structure --dry-run
docs/math/q1.pdf -> archive/q1/math/q1.pdf
docs/physics/q1.pdf -> archive/q1/physics/q1.pdf
$ vela mv --by-tag q1 docs/ archive/q1/ --dry-run
vela: nothing moved: 1 conflict(s):
docs/math/q1.pdf and docs/physics/q1.pdf would both move to archive/q1/q1.pdf
hint: use --force to overwrite existing destinations (they go to the trash)
All conflicts are collected before the first move: two matches with one destination, an existing destination without --force, a destination that is a directory, one of the objects being moved, or lies below a file. If there is any, nothing moves (exit code 4). A selection is moved with one request per object, not in a single transaction — checking every destination first is what keeps a conflict from leaving it half moved.
The trash
In the trash, a selection matches the tags the file had when it was deleted, and paths narrow by original path:
vela trash ls --by-tag travel
vela trash restore --by-tag q1 docs/ # the newest entry of every matching original path
vela trash purge --by-tag scratch --older-than 7d
trash restore checks first that every original path is free — otherwise nothing is restored (exit code 4) unless --force trashes what is in the way. --to cannot be combined with a selection.
Linking a selection
vela ln --by-tag TAG [SCOPE...] DEST/ [--save-structure] [--skip | --skip-explicitly] [--skip-symlinks]
Like mv --by-tag, but each match gets a symlink in DEST/ and stays where it is. The originals are never touched.
$ vela ln --by-tag travel originals/ sorted/travel/ --dry-run
sorted/travel/lisbon.jpg -> originals/2026/lisbon.jpg
sorted/travel/porto.jpg -> originals/2026/porto.jpg
Conflicts are collected before the first symlink, and by default the whole plan is refused. Choose how to handle them:
--skipLeave conflicting objects out silently and link the rest. Of two objects with one destination, the second by path is skipped.
--skip-explicitlyThe same, but report every skipped object as a warning.
-f, --forceReplace existing destinations, as in vela ln -f.
--skip-symlinksLeave symlinks out of the selection. New symlinks copy their file's tags, so a scope that includes DEST/ would otherwise select them on the next run.
-r cannot be combined with a selection.
Keeping a view current with --sync
A plain run is a snapshot. --sync makes it repeatable: it links only files that have no symlink in DEST/ yet, so you can rerun it whenever you tag new files.
$ vela ln --by-tag travel originals/ sorted/travel/ --sync -y
2 symlink(s) up to date.
sorted/travel/faro.jpg -> originals/2026/faro.jpg
https://store.example.com/sorted/travel/faro.jpg
- Existing symlinks are matched by the file they point at, not by name. If a file was renamed or moved, its symlink stays where it is, a warning says so, and no duplicate is created.
- Symlinks are never selected —
--skip-symlinksis implied. - Anything else in a destination's place is still a conflict.
Removing stale symlinks with --prune
With --prune, the same run also moves to the trash the symlinks in DEST/ whose file lies in the scope but is no longer selected:
$ vela ln --by-tag travel originals/ sorted/travel/ --sync --prune --dry-run
1 symlink(s) up to date.
+ sorted/travel/faro.jpg -> originals/2026/faro.jpg
- sorted/travel/porto.jpg (no longer selected)
What gets pruned is deliberately narrow:
| Symlink in DEST/ points at | With --prune |
|---|---|
| A file in the scope that lost its tags | Trashed (no longer selected) |
| A file in the trash | Kept — restoring the file repairs it, URL and signed links included. Trashed only with --prune-trashed. |
| A file outside the scope that still has the tags | Trashed (the file moved out of scope) |
| Any other file outside the scope | Kept |
Nothing (gone: purged or outside your key's prefix) | Kept — it may work for another key |
Pruning runs before linking, so a new symlink may take the place of a pruned one; a warning tells you. With --strict such a place counts as taken and is reported as a conflict. With --json, the plan and the result are {"created": […], "pruned": […]}.
# a nightly job that keeps sorted/travel/ in line with the "travel" tag
vela ln --by-tag travel originals/ sorted/travel/ --save-structure --sync --prune -y
Refreshing metadata with --copy-meta
A symlink's metadata is a snapshot taken when it was created. With --sync --copy-meta, the same run copies each selected file's metadata again to its symlinks in DEST/ — wherever they lie — when their title, description, tags, disposition or visibility differ:
$ vela ln --by-tag travel originals/ sorted/travel/ --sync --copy-meta --dry-run
2 symlink(s) up to date.
~ sorted/travel/porto.jpg (title, tags)
- Symlinks are updated in place: their IDs, URLs and signed links keep working.
--copy-meta=title,tagslimits the copy to these fields;all(the default) copies all five. Fields you leave out stay as they are.- Changes made to the symlinks themselves in the copied fields are overwritten.
- Updates are part of the plan and confirmed with the rest of it; the result reports
Updated PATH (fields), and--jsonaddsupdateto the plan andupdatedto the result.
# keep titles and tags of the travel view in line with the originals
vela ln --by-tag travel originals/ sorted/travel/ --sync --prune --copy-meta=title,tags -y
Known limitations
- Vela cannot tell a symlink created by
--syncfrom one you made by hand:--prunealso removes a manual symlink inDEST/that points at an unselected file from the scope. - A run is not a transaction. Deletions come first, then creations; a failure in between leaves a partial result (exit code 7). Rerun the command and restore from the trash if needed.
- With
--save-structure, the symlink of a file moved within the scope is not moved along. The warning repeats on every run until you move the symlink withvela mv. - In flat mode, a name collision repeats on every run; with
--skipthe second file silently never gets a symlink. - The plan is computed before anything runs; changes made in between cause individual errors, never damage.
Tag filters over HTTP
GET /api/v1/objects and GET /api/v1/trash accept a repeated tag parameter. Each value is a comma-separated group the object must have all of; groups are OR-ed:
# (math and draft) or q1
curl -H "Authorization: Bearer $VELA_KEY" \
'https://store.example.com/api/v1/objects?recursive=true&tag=math,draft&tag=q1'
See the endpoint reference. Older servers ignore the parameter, which is why the Go client and the CLI check the results again.