Skip to content
Luna
Esc
↑↓navigate↵open⌘Jpreview
On this page

luna files

List, download, upload and delete the files in a luna's buckets, and sign a URL for one.

luna files works with the files of one luna, in the buckets its code declares.

luna files list User u_42 uploads

Reference

luna files <COMMAND>

Every subcommand names the luna by its type and key, and the bucket by its name. Each one also takes these options.

Option Type Default Does
--dir <DIR> path . The app’s folder. Its env file names the project and environment.
--env <ENV> text LUNA_ENV, then production The environment, by name.
--project <PROJECT> text LUNA_PROJECT The project, by name or as organisation/project.
--tenant <TENANT> text The environment’s own A tenant added to the environment, by name.
--token <TOKEN> text LUNA_TOKEN, then your login An API token or account key to act with.

luna files list

Prints one folder of a bucket: the folders in it, then its files with their size and content type.

luna files list [OPTIONS] <TYPE> <KEY> <BUCKET> [FOLDER]
Option Type Default Does
<TYPE> text Required The luna type, by name.
<KEY> text Required The luna’s key.
<BUCKET> text Required The bucket, by name.
[FOLDER] text The top of the bucket The folder to list, such as photos/2026/.
--limit <LIMIT> number 100 How many folders and files to print, at most 1000.
--json flag Off Prints the answer as JSON.

luna files get

Downloads a file.

luna files get [OPTIONS] <TYPE> <KEY> <BUCKET> <PATH>
Option Type Default Does
<PATH> text Required The file’s path in the bucket.
-o, --output <OUTPUT> path The file’s name, in this folder Where to write it. - writes it to standard output.

luna files put

Uploads a file to a path in a bucket, and replaces what is there.

luna files put [OPTIONS] <TYPE> <KEY> <BUCKET> <PATH> <FILE>
Option Type Default Does
<PATH> text Required The path to store it at in the bucket.
<FILE> path Required The file on this machine to upload.
--type <CONTENT_TYPE> text Guessed from the file’s name The content type to store with it.

luna files delete

Deletes a file. It asks first.

luna files delete [OPTIONS] <TYPE> <KEY> <BUCKET> <PATH>
Option Type Default Does
<PATH> text Required The file’s path in the bucket.
--yes flag Off Deletes without asking.

luna files url

Prints a signed URL that downloads the file without a token, until it expires.

luna files url [OPTIONS] <TYPE> <KEY> <BUCKET> <PATH>
Option Type Default Does
<PATH> text Required The file’s path in the bucket.
--expires <EXPIRES> duration 1h How long the URL works, such as 90s, 15m, 2h or 3d. At most 7d.

Good to know

  • A key with one field is given as its value, such as u_42. A key with several fields is given as JSON, such as '{"board":"b1","card":"c7"}'.
  • put guesses the content type from the extension: png, jpg, gif, webp, svg, pdf, json, txt, md, log, csv, html, mp4 and mp3. Any other file is stored as application/octet-stream unless you pass --type.
  • Anyone who has a URL from url can download the file until it expires. Pass the shortest --expires that does the job.
  • list, get and url need the data:read scope. put and delete need data:write.
  • Without a terminal to ask at, delete stops with exit code 6 unless you pass --yes.

Examples

List a folder

luna files list User u_42 uploads photos/2026/
luna files get User u_42 uploads notes/today.txt -o -

Upload a file with its content type

luna files put User u_42 uploads notes/today.txt ./today.txt --type text/plain

Share a file for a day

luna files url User u_42 uploads photos/2026/me.png --expires 1d

Delete a file in a script

luna files delete User u_42 uploads photos/2026/me.png --yes

Was this page helpful?