Moving & Deleting

Because contents are stored under random IDs, moving a file — or a directory of ten thousand files — is a single database transaction. Deleting is just as safe: files go to the trash first. To put a file in a second place without moving it, create a symlink.

Moving and renaming with vela mv

vela mv FROM TO [--force]
CommandEffect
vela mv notes/a.md notes/b.mdRename a file
vela mv report.pdf archive/Move a file into a directory, keeping its name → archive/report.pdf
vela mv docs/math/ archive/math/Move a whole directory — everything below docs/math/ — in one atomic step
$ vela mv docs/hello.txt docs/welcome.txt
Moved 1 object(s): docs/hello.txt -> docs/welcome.txt

$ vela mv docs/guides/ docs/handbook/
Moved 1 object(s): docs/guides/ -> docs/handbook/

What changes and what does not

  • Public URLs change. Old URLs return 404; Vela does not create redirects. Update links you have published, or configure redirects in your proxy.
  • Signed links and symlinks keep working. Both are bound to the object ID, not the path. Moving a symlink moves only the symlink.
  • IDs, metadata, visibility and content stay the same. No bytes are copied.
  • Directory policies move along with a recursive move, in the same transaction (see below).

Conflicts and overwriting

By default a move never replaces anything. If any target exists, nothing moves and you get exit code 4:

  • For a directory move, the server reports up to 100 conflicting paths in details.conflicts (visible with --json).
  • File/directory clashes (moving a file to a while a/… exists, or into a/b while a file a exists) fail with path_conflict.
  • A directory cannot be moved into itself: vela mv a/ a/b/ is rejected.

With --force, existing targets are moved to the trash first, then the move happens — still atomically.

Moves and directory policies

A recursive move carries the directory policies stored under the source prefix to the target prefix, and the output reports how many moved. If the target already has policies that would not be replaced, the move fails with 409 conflict listing details.conflicting_policies; with --force the target's entire policy set is replaced. Moving files never touches policies, and you can move a prefix that has only policies and no files.

Moves and key prefixes

A prefix-restricted key must cover both the source and the target. A ci/ key cannot move ci/build.zip to releases/. Moving a policy onto the root requires an unrestricted admin key.

Moving by tag

vela mv --by-tag q1 docs/ archive/q1/ moves every object tagged q1 below docs/ into archive/q1/ — flat, or with --save-structure keeping relative paths. All conflicts are reported before the first move, and the plan is confirmed first. See Tag Selection.

Deleting with vela rm

vela rm PATH... [-r] [--purge] [-y]
$ vela rm notes/old.md
Moved notes/old.md to the trash (1 object(s))
Restore with: vela trash restore <path>

$ vela rm -r drafts/
Delete drafts/ (recursively)? [y/N] y
Moved drafts/ to the trash (12 object(s))
  • Deleted objects go to the trash and can be restored until VELA_TRASH_RETENTION (14 days) passes.
  • Directories (paths ending in /) require -r; without it you get an error with a hint.
  • Deleting the whole root recursively is refused by the server.
  • -r and --purge ask for confirmation. -y skips it and is required when stdin is not a terminal — a script never deletes silently by accident.
  • Signed links to a trashed file stop working; they work again after a restore if they have not expired.
  • Deleting a file breaks the symlinks pointing at it, and the CLI says how many. Deleting a symlink never touches its file.
  • vela rm --by-tag draft deletes every object with a tag, after showing them and asking; --dry-run only lists them.

Cleaning up broken symlinks

vela rm --broken -r sorted/ -y

--broken trashes the broken symlinks directly in the given directories, or with -r also below them. Regular files and working symlinks are left alone.

Permanent deletion

vela rm --purge -y secret.pdf

--purge bypasses the trash and requires an admin key. Purging also deletes the object's signed-link records. Content is physically removed by the garbage collector after a short grace period.

Purged files cannot be restored except from a backup.

Expired objects

Objects with an expires_at in the past disappear from the public side immediately and are moved to the trash by the janitor's next pass. Until then you can still read them with the API — or simply remove the expiry with vela meta PATH --expires none. See Metadata & Expiry.

Changing visibility in bulk

Changing who can see files is covered in Visibility:

vela vis -r docs/internal/ private