tcb storage objects download
Download an object from a Storage bucket to the local machine.
v3.4.0+
PG mode storage commands have been available since @cloudbase/cli@3.4.0.
Usage
tcb storage objects download <key> [localPath] -b <bucketId> [options]
Parameters
| Parameter | Required | Description | Default |
|---|---|---|---|
<key> | Yes | Object name | — |
[localPath] | No | Local path; writes to stdout when omitted; when it points to an existing directory the basename of key is appended | stdout |
-b, --bucket <bucketId> | Yes | Bucket ID | — |
-m, --method <method> | No | GET / HEAD | GET |
--download <filename> | No | Trigger a browser download, equivalent to ?download=<filename> | — |
--if-none-match <etag> | No | If-None-Match header, authenticated download path only | — |
--if-modified-since <date> | No | If-Modified-Since header | — |
--range <range> | No | Range header for resumable downloads | — |
--overwrite | No | Allow overwriting an existing local file | false |
--json | No | Return metadata only { status, headers }, writes nothing to disk | — |
When logged in, the command uses the authenticated download path and reaches both private and public buckets; when logged out it falls back to a public download that only reaches public buckets. --method HEAD and --json write no local file.
Examples
tcb storage objects download test/hello.txt ./hello.txt -b my-bucket
tcb storage objects download test/hello.txt -b my-bucket --range bytes=0-1023
tcb storage objects download test/hello.txt -b my-bucket --json