Uploading Files

Two commands create files. vela put streams local files of any size, whole directory trees or stdin. vela new creates small files from a string, stdin or your editor. Neither overwrites an existing file unless you ask.

vela put

vela put LOCAL... [REMOTE] [flags]

Choosing the destination

The last argument is the remote destination when there is more than one argument. A trailing slash makes it a directory:

CommandResult
vela put report.pdfreport.pdf at the root
vela put report.pdf docs/math/docs/math/report.pdf
vela put report.pdf docs/math/q1.pdfexactly docs/math/q1.pdf
vela put a.pdf b.pdf docs/docs/a.pdf and docs/b.pdf — with several files the destination must end in /
vela put -r ./site docs/site/The contents of ./site below docs/site/, keeping the structure
vela put - notes/x.txtstdin into notes/x.txt

After a successful upload, put prints the public URL of each file — or, for private files, a reminder of how to share them:

$ vela put report.pdf docs/q3/ --public
https://store.example.com/docs/q3/report.pdf
$ vela put contract.pdf legal/ --private
legal/contract.pdf (private; share it with: vela share legal/contract.pdf)

Uploading directories

With -r, directories are uploaded recursively. Their contents land below the remote directory, like cp -r DIR/. REMOTE/:

$ vela put -r ./site docs/site/ --public --dry-run
would upload site/css/app.css -> docs/site/css/app.css (2 B)
would upload site/index.html -> docs/site/index.html (2 B)
2 file(s), 4 B

$ vela put -r ./site docs/site/ --public
uploaded docs/site/css/app.css
uploaded docs/site/index.html
https://store.example.com/docs/site/css/app.css
https://store.example.com/docs/site/index.html
  • Symlinks are skipped (with a warning); they are never followed.
  • Hidden files and directories (names starting with .) are skipped unless you pass --hidden. In the example above, site/.git/ was ignored.
  • Files upload in parallel: -j 4 by default.
  • --dry-run shows what would be uploaded and where, without uploading.
  • If some files fail, the others still upload and the command exits with code 7 (partial success).

An index.html inside an uploaded directory is an ordinary file. Vela always shows its own directory index; it is not a static-site host.

Uploading from stdin

Use - as the local name to stream anything into Vela — a database dump, a tarball, generated output:

pg_dump app | vela put - backups/app.sql --private --expires 7d
tar -czf - ./logs | vela put - archives/logs-$(date +%F).tar.gz --private

Stdin uploads use chunked transfer and are limited by VELA_MAX_UPLOAD while streaming. They are sent without a checksum header because the content cannot be read twice.

Overwriting

Without --force an existing file is never replaced:

$ vela put report.pdf docs/q3/
vela: object already exists: docs/q3/report.pdf
  hint: use --force to overwrite
$ echo $?
4

With --force, the content is replaced and the object keeps its ID, signed links and any metadata you do not pass, including visibility. Its revision increases and the content type is re-detected unless you set it. The previous content is garbage-collected later, so in-flight downloads of the old version finish normally. Symlinks to the file serve the new content right away.

A path held by a symlink cannot be written to, not even with --force (409 is_symlink, exit code 4): remove the symlink with vela rm or retarget it with vela ln -f.

Setting metadata while uploading

vela put q3.pdf reports/ \
  --public \
  --title "Q3 financial report" \
  --description "Unaudited figures" \
  --tag finance --tag q3 \
  --disposition attachment \
  --expires 90d
--public | --unlisted | --private

Mutually exclusive. Without one, the profile's default_visibility applies, then the server's default (unlisted). When overwriting, omitting all three keeps the current visibility.

--title, --description

Shown in the public index. Up to 256 and 4096 characters.

--tagrepeatable

Up to 32 tags of at most 64 characters from a-z 0-9 - _ . (lower-cased).

--content-type

Override detection, e.g. text/plain.

--disposition

inline (display in the browser) or attachment (download).

--expires

Self-destruct after a duration (7d) or at an RFC 3339 time.

See Metadata & Expiry for what each field does.

Integrity and progress

  • For regular files the CLI computes the SHA-256 first and sends it as X-Vela-SHA256; the server rejects a mismatch with 400 checksum_mismatch and stores nothing.
  • The server publishes a file only after the whole body arrived and matched — a cancelled upload leaves nothing behind.
  • Files larger than 1 MiB show a progress bar on stderr in an interactive terminal. -q and --json hide it.
  • Uploads are retried on network errors; see retries.

JSON output

With --json, put prints an array of the created or updated objects — useful for capturing IDs and URLs in scripts:

url=$(vela --json put build.zip releases/ --public | jq -r '.[0].url')

vela new

vela new REMOTE [--content TEXT | --stdin | --edit] [flags]

new creates a new small file from raw content — notes, configs, Markdown — through the inline-create endpoint. It never overwrites and is limited to VELA_MAX_CREATE (1 MiB by default). For anything larger, use put.

# from a string
vela new notes/todo.md --content '# Todo'

# from stdin
echo hello | vela new hello.txt --stdin --public

# in $VISUAL / $EDITOR (vi by default); an empty buffer cancels
vela new notes/idea.md --edit

new accepts the same metadata flags as put: visibility, --title, --description, --tag, --content-type, --disposition and --expires. If the path exists you get exit code 4 and a hint to use vela put --force.

How content types are detected

When you do not set --content-type (or send application/octet-stream), the server decides:

  1. by file extension, using Go's MIME table plus a built-in list of common types;
  2. otherwise by sniffing the first 512 bytes;
  3. otherwise application/octet-stream.

Text types get ; charset=utf-8 when no charset is given, so notes.md is served as text/markdown; charset=utf-8.

Limits at a glance

LimitDefaultError
Upload size (put)VELA_MAX_UPLOAD = 2 GiB413 payload_too_large
Inline create (new)VELA_MAX_CREATE = 1 MiB413 payload_too_large
Path length1024 bytes, 255 per segment400 invalid_path
Concurrent uploads (server)VELA_MAX_CONCURRENT_UPLOADS = 4Extra uploads wait

Check your server's limits with vela --json whoami | jq .limits.