/APIs & SDKs/Checks, documents and data/buckets

OptiTech CLI command: buckets

Manage branch object-storage buckets and their objects

Beta

The OptiTech Object Storage is in Beta. Share your feedback on Discord or via the OptiTech Console.

The buckets command manages branch object-storage buckets and their objects. Buckets belong to a branch; the object subcommands work with the objects inside a bucket.

Subcommands: create, delete, list, object

optitech buckets create

Creates a bucket on a branch.

optitech bucket create <name> [options]
OptionDescriptionTypeDefaultRequired
--access-levelThe visibility of the bucket Possible values: private, public_readstringprivateNo
--branchBranch ID or namestringNo
--project-idProject IDstringNo

Create a private bucket on a branch:

optitech buckets create my-bucket --access-level private

optitech buckets list

Lists the buckets on a branch.

optitech bucket list [options]
OptionDescriptionTypeDefaultRequired
--project-idProject IDstringNo

List the buckets on a branch with json output:

optitech buckets list --output json

optitech buckets delete

Deletes a bucket from a branch.

optitech bucket delete <name> [options]
OptionDescriptionTypeDefaultRequired
--project-idProject IDstringNo
optitech buckets delete my-bucket

Bucket objects

Lists, downloads, uploads, or deletes objects in a bucket.

Subcommands: delete, get, list, put

optitech buckets object list

Lists objects in a bucket.

optitech bucket object list <bucket>[/<prefix>] [options]
OptionDescriptionTypeDefaultRequired
--branchBranch ID or namestringNo
--cursorPagination cursor returned as next_cursor by a previous callstringNo
--delimiterCollapse keys sharing this prefix separator into folders. Defaults to "/" (folder view); ignored when --recursive is setstringNo
--limitMaximum number of items (objects + folders) to returnnumberNo
--project-idProject IDstringNo
--recursiveList every key flat, descending into nested folders (no delimiter). Mutually exclusive with --delimiter. Mirrors "aws s3 ls --recursive"booleanfalseNo

List the objects under a prefix, collapsing keys into folders:

optitech buckets object list my-bucket/images --delimiter /

optitech buckets object get

Downloads an object from a bucket to a local file.

optitech bucket object get <bucket>/<key> [options]
OptionDescriptionTypeDefaultRequired
--branchBranch ID or namestringNo
--filePath to write the downloaded object to (defaults to the object filename in the current directory)stringNo
--project-idProject IDstringNo
optitech buckets object get my-bucket/images/logo.png --file ./logo.png

optitech buckets object put

Uploads a local file to a bucket as an object.

optitech bucket object put <bucket>/<key> [options]
OptionDescriptionTypeDefaultRequired
--branchBranch ID or namestringNo
--content-typeContent-Type to store the object with (e.g. text/plain)stringNo
--filePath to the local file to uploadstringYes
--project-idProject IDstringNo

Upload a file, optionally setting the Content-Type to store it with:

optitech buckets object put my-bucket/images/logo.png --file ./logo.png
optitech buckets object put my-bucket/notes/readme.txt --file ./readme.txt --content-type text/plain

optitech buckets object delete

Deletes an object, or every object under a prefix.

optitech bucket object delete <bucket>/<key> [options]
OptionDescriptionTypeDefaultRequired
--branchBranch ID or namestringNo
--project-idProject IDstringNo
--recursiveDelete every object under the given prefix. The prefix must end with "/"booleanfalseNo

With --recursive, the target is treated as a prefix, which must end with /.

Delete a single object, or every object under a prefix:

optitech buckets object delete my-bucket/images/logo.png
optitech buckets object delete my-bucket/images/ --recursive
Was this page helpful?

On this page

Copy neon init command