Skip to content

CLI reference

ry bucket

Markdown

Manage object storage buckets (files for your apps).

ry bucket [options] [command]

Create a bucket you can attach to an app.

ry bucket create [options] <name>

Example:

ry bucket create my-uploads

Is this bucket name still available in this region?

ry bucket check [options] <name>

Example:

ry bucket check my-uploads

List buckets.

ry bucket list [options]

Example:

ry bucket list

Bucket detail with object count and size.

ry bucket show [options] <name>

Example:

ry bucket show my-uploads

List objects in a bucket.

ry bucket ls [options] <name>

Options:

  • --prefix <prefix>: Only keys starting with this prefix.
  • --limit <n>: Objects per page (max 1000). Default: 100.
  • --cursor <cursor>: Continue from a previous page.

Example:

ry bucket ls my-uploads --prefix reports/

Delete one object from a bucket (irreversible).

ry bucket rm [options] <bucket> <key>

Options:

  • -y, --yes: Skip confirmation (required in automation).

Example:

ry bucket rm my-uploads reports/2026-10.pdf --yes

Get a time-limited URL for one object (GET by default, –put to upload).

ry bucket presign [options] <bucket> <key>

Options:

  • --put: Sign an upload (PUT) instead of a download (GET).
  • --expires <seconds>: How long the URL stays valid. Default: 900.
  • --content-type <type>: PUT only: the Content-Type the uploader must then send.

Example:

ry bucket presign my-uploads reports/2026-10.pdf
ry bucket presign my-uploads reports/2026-10.pdf --put --content-type application/pdf

Attach a bucket to an app (injects S3_* into its environment).

ry bucket attach [options] <bucket>

Options:

  • --to <app>: App that should get access.
  • --as <name>: Name this attachment: <NAME>_S3_BUCKET etc. instead of S3_BUCKET (required from the second bucket of an app).
  • -y, --yes: Skip the re-attach warning.

Example:

ry bucket attach my-uploads --to web
ry bucket attach my-uploads --to web --as uploads

Detach a bucket from an app (removes S3_*, revokes its key; the files stay).

ry bucket detach [options] <bucket>

Options:

  • --from <app>: App that should lose access.

Example:

ry bucket detach my-uploads --from web

Show the CORS rules of a bucket (browsers need them for direct uploads).

ry bucket cors [options] <name>

Example:

ry bucket cors my-uploads

Replace the CORS rules of a bucket (needed for direct browser uploads).

ry bucket cors-set [options] <name>

Options:

  • --allow-origin <origins>: Comma-separated, or ‘*’. Default: *.
  • --allow-method <methods>: Comma-separated. Default: GET,PUT,HEAD.
  • --allow-header <headers>: Comma-separated. Default: *,authorization.
  • --expose-header <headers>: Comma-separated. Default: ETag.
  • --max-age <seconds>: How long a browser may cache the preflight. Default: 3000.
  • --clear: Remove the configuration entirely.

Example:

ry bucket cors-set my-uploads --allow-origin https://www.example.com

Destroy a bucket and everything in it (irreversible).

ry bucket destroy [options] <name>

Options:

  • -y, --yes: Skip confirmation (required in automation).
  • --force: Also destroy a bucket that still holds objects.

Example:

ry bucket destroy my-uploads --yes
ry bucket destroy my-uploads --force --yes