tigris-objects

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Tigris Object Operations

Tigris 对象操作

Quick Reference

快速参考

CommandDescription
tigris ls [path]
List objects under a bucket/prefix
tigris cp <src> <dest>
Copy files local↔remote or remote↔remote
tigris mv <src> <dest>
Move/rename objects within Tigris
tigris rm <path>
Delete objects or folders
tigris touch <path>
Create an empty object
tigris stat <path>
Show object metadata or storage stats
tigris presign <path>
Generate a presigned URL
tigris objects list <bucket>
List objects (low-level)
tigris objects get <bucket> <key>
Download an object (low-level)
tigris objects put <bucket> <key> <file>
Upload an object (low-level)
tigris objects delete <bucket> <key>
Delete an object (low-level)
tigris objects set <bucket> <key>
Update object settings (low-level)
命令描述
tigris ls [path]
列出存储桶/前缀下的对象
tigris cp <src> <dest>
在本地↔远程或远程↔远程之间复制文件
tigris mv <src> <dest>
在Tigris内移动/重命名对象
tigris rm <path>
删除对象或文件夹
tigris touch <path>
创建空对象
tigris stat <path>
显示对象元数据或存储统计信息
tigris presign <path>
生成预签名URL
tigris objects list <bucket>
列出对象(底层命令)
tigris objects get <bucket> <key>
下载对象(底层命令)
tigris objects put <bucket> <key> <file>
上传对象(底层命令)
tigris objects delete <bucket> <key>
删除对象(底层命令)
tigris objects set <bucket> <key>
更新对象设置(底层命令)

URI Scheme

URI 格式

Remote paths use
t3://bucket/key
or
tigris://bucket/key
. Bare
bucket/key
paths are also accepted.
远程路径使用
t3://bucket/key
tigris://bucket/key
。也支持直接使用
bucket/key
格式的路径。

Unix-Style Commands (primary interface)

Unix风格命令(主界面)

tigris ls [path]
(alias:
list
)

tigris ls [path]
(别名:
list

List all buckets (no arguments) or objects under a bucket/prefix path.
bash
tigris ls                                  # list all buckets
tigris ls my-bucket                        # list objects in bucket
tigris ls my-bucket/images/                # list objects under prefix
tigris ls t3://my-bucket/prefix/
FlagAliasDescriptionDefault
--snapshot-version
--snapshot
Read from a specific bucket snapshot
--format
-f
Output format (
json
,
table
,
xml
)
table
--json
Output as JSON
列出所有存储桶(无参数)或存储桶/前缀路径下的对象。
bash
tigris ls                                  # 列出所有存储桶
tigris ls my-bucket                        # 列出存储桶中的对象
tigris ls my-bucket/images/                # 列出前缀下的对象
tigris ls t3://my-bucket/prefix/
标志别名描述默认值
--snapshot-version
--snapshot
从指定的存储桶快照读取数据
--format
-f
输出格式(
json
,
table
,
xml
table
--json
以JSON格式输出

tigris cp <src> <dest>
(alias:
copy
)

tigris cp <src> <dest>
(别名:
copy

Copy files between local filesystem and Tigris, or between paths within Tigris. At least one side must be a remote
t3://
path. Quote wildcard patterns to prevent shell expansion.
bash
tigris cp ./file.txt t3://my-bucket/file.txt               # upload
tigris cp t3://my-bucket/file.txt ./local-copy.txt          # download
tigris cp t3://my-bucket/src/ t3://my-bucket/dest/ -r       # remote-to-remote
tigris cp ./images/ t3://my-bucket/images/ -r               # recursive upload
FlagAliasDescription
--recursive
-r
Copy directories recursively
--format
-f
Output format (
json
,
table
; default:
table
)
--json
Output as JSON
在本地文件系统与Tigris之间,或Tigris内部的路径之间复制文件。至少有一方必须是远程
t3://
路径。请为通配符模式添加引号,避免shell展开。
bash
tigris cp ./file.txt t3://my-bucket/file.txt               # 上传
tigris cp t3://my-bucket/file.txt ./local-copy.txt          # 下载
tigris cp t3://my-bucket/src/ t3://my-bucket/dest/ -r       # 远程到远程复制
tigris cp ./images/ t3://my-bucket/images/ -r               # 递归上传
标志别名描述
--recursive
-r
递归复制目录
--format
-f
输出格式(
json
,
table
; 默认:
table
--json
以JSON格式输出

tigris mv <src> <dest>
(alias:
move
)

tigris mv <src> <dest>
(别名:
move

Move (rename) objects within Tigris. Both source and destination must be remote paths. Quote wildcard patterns to prevent shell expansion.
bash
tigris mv t3://my-bucket/old.txt t3://my-bucket/new.txt -f
tigris mv t3://my-bucket/old-dir/ t3://my-bucket/new-dir/ -rf
tigris mv my-bucket/a.txt my-bucket/b.txt -f
FlagAliasDescription
--recursive
-r
Move directories recursively
--force
-f
Skip confirmation prompt
--format
Output format (
json
,
table
; default:
table
)
--json
Output as JSON
在Tigris内移动(重命名)对象。源路径和目标路径都必须是远程路径。请为通配符模式添加引号,避免shell展开。
bash
tigris mv t3://my-bucket/old.txt t3://my-bucket/new.txt -f
tigris mv t3://my-bucket/old-dir/ t3://my-bucket/new-dir/ -rf
tigris mv my-bucket/a.txt my-bucket/b.txt -f
标志别名描述
--recursive
-r
递归移动目录
--force
-f
跳过确认提示
--format
输出格式(
json
,
table
; 默认:
table
--json
以JSON格式输出

tigris rm <path>
(alias:
remove
)

tigris rm <path>
(别名:
remove

Remove a bucket, folder, or object from Tigris. A bare bucket name deletes the bucket itself. Quote wildcard patterns to prevent shell expansion.
bash
tigris rm t3://my-bucket/file.txt -f
tigris rm t3://my-bucket/folder/ -rf
tigris rm t3://my-bucket -f                                 # deletes the bucket
tigris rm "t3://my-bucket/logs/*.tmp" -f                    # wildcard delete
FlagAliasDescription
--recursive
-r
Remove directories recursively
--force
-f
Skip confirmation prompt
--format
Output format (
json
,
table
; default:
table
)
--json
Output as JSON
从Tigris中删除存储桶、文件夹或对象。直接使用存储桶名称会删除存储桶本身。请为通配符模式添加引号,避免shell展开。
bash
tigris rm t3://my-bucket/file.txt -f
tigris rm t3://my-bucket/folder/ -rf
tigris rm t3://my-bucket -f                                 # 删除存储桶
tigris rm "t3://my-bucket/logs/*.tmp" -f                    # 通配符删除
标志别名描述
--recursive
-r
递归删除目录
--force
-f
跳过确认提示
--format
输出格式(
json
,
table
; 默认:
table
--json
以JSON格式输出

tigris touch <path>

tigris touch <path>

Create an empty (zero-byte) object at the given bucket/key path.
bash
tigris touch my-bucket/placeholder.txt
tigris touch t3://my-bucket/logs/
FlagAliasDescription
--format
-f
Output format (
json
,
table
; default:
table
)
--json
Output as JSON
在指定的存储桶/键路径下创建一个空(零字节)对象。
bash
tigris touch my-bucket/placeholder.txt
tigris touch t3://my-bucket/logs/
标志别名描述
--format
-f
输出格式(
json
,
table
; 默认:
table
--json
以JSON格式输出

tigris stat [path]

tigris stat [path]

Show storage stats (no args), bucket info, or object metadata.
bash
tigris stat                                # overall storage stats
tigris stat t3://my-bucket                 # bucket info
tigris stat t3://my-bucket/my-object.json  # object metadata
FlagAliasDescriptionDefault
--snapshot-version
--snapshot
Read from a specific bucket snapshot
--format
-f
Output format (
json
,
table
,
xml
)
table
--json
Output as JSON
显示存储统计信息(无参数)、存储桶信息或对象元数据。
bash
tigris stat                                # 整体存储统计信息
tigris stat t3://my-bucket                 # 存储桶信息
tigris stat t3://my-bucket/my-object.json  # 对象元数据
标志别名描述默认值
--snapshot-version
--snapshot
从指定的存储桶快照读取数据
--format
-f
输出格式(
json
,
table
,
xml
table
--json
以JSON格式输出

Presigned URLs

预签名URL

tigris presign <path>

tigris presign <path>

Generate a presigned URL for temporary access to an object without credentials.
bash
tigris presign my-bucket/file.txt
tigris presign t3://my-bucket/report.pdf --method put --expires-in 7200
tigris presign my-bucket/image.png --format json
tigris presign my-bucket/data.csv --access-key tid_AaBb
FlagAliasDescriptionDefault
--method
-m
HTTP method (
get
,
put
)
get
--expires-in
-e
URL expiry time in seconds
3600
--access-key
Access key ID for signing (resolved from credentials if not provided)
--format
-f
Output format (
url
,
json
)
url
--json
Output as JSON
Use cases:
  • Temporary sharing of private objects (GET)
  • Client-side uploads without exposing credentials (PUT)
生成预签名URL,无需凭证即可临时访问对象。
bash
tigris presign my-bucket/file.txt
tigris presign t3://my-bucket/report.pdf --method put --expires-in 7200
tigris presign my-bucket/image.png --format json
tigris presign my-bucket/data.csv --access-key tid_AaBb
标志别名描述默认值
--method
-m
HTTP方法(
get
,
put
get
--expires-in
-e
URL过期时间(秒)
3600
--access-key
用于签名的访问密钥ID(未提供时从凭证中获取)
--format
-f
输出格式(
url
,
json
url
--json
以JSON格式输出
使用场景:
  • 临时共享私有对象(GET)
  • 客户端上传时无需暴露凭证(PUT)

Low-Level
objects
Subcommand

底层
objects
子命令

For programmatic and granular control over individual objects.
用于对单个对象进行程序化和精细化控制。

tigris objects list <bucket>
(alias:
l
)

tigris objects list <bucket>
(别名:
l

List objects in a bucket, optionally filtered by a key prefix.
bash
tigris objects list my-bucket
tigris objects list my-bucket --prefix images/
tigris objects list my-bucket --json
FlagAliasDescription
--prefix
-p
Filter objects by key prefix
--snapshot-version
--snapshot
Read from a specific bucket snapshot
--format
-f
Output format (
json
,
table
,
xml
; default:
table
)
--json
Output as JSON
列出存储桶中的对象,可选择按键前缀过滤。
bash
tigris objects list my-bucket
tigris objects list my-bucket --prefix images/
tigris objects list my-bucket --json
标志别名描述
--prefix
-p
按键前缀过滤对象
--snapshot-version
--snapshot
从指定的存储桶快照读取数据
--format
-f
输出格式(
json
,
table
,
xml
; 默认:
table
--json
以JSON格式输出

tigris objects get <bucket> <key>
(alias:
g
)

tigris objects get <bucket> <key>
(别名:
g

Download an object by key. Prints to stdout by default, or saves to a file with
--output
.
bash
tigris objects get my-bucket config.json
tigris objects get my-bucket archive.zip --output ./archive.zip --mode stream
FlagAliasDescription
--output
-o
Output file path (prints to stdout if not specified)
--mode
-m
Response mode:
string
(loads into memory) or
stream
(writes in chunks)
--snapshot-version
--snapshot
Read from a specific bucket snapshot
--format
-f
Output format (
json
,
table
; default:
table
)
--json
Output as JSON
按键下载对象。默认输出到标准输出,使用
--output
可保存到文件。
bash
tigris objects get my-bucket config.json
tigris objects get my-bucket archive.zip --output ./archive.zip --mode stream
标志别名描述
--output
-o
输出文件路径(未指定时输出到标准输出)
--mode
-m
响应模式:
string
(加载到内存)或
stream
(分块写入)
--snapshot-version
--snapshot
从指定的存储桶快照读取数据
--format
-f
输出格式(
json
,
table
; 默认:
table
--json
以JSON格式输出

tigris objects put <bucket> <key> <file>
(alias:
p
)

tigris objects put <bucket> <key> <file>
(别名:
p

Upload a local file as an object. Content-type is auto-detected from extension unless overridden.
bash
tigris objects put my-bucket report.pdf ./report.pdf
tigris objects put my-bucket logo.png ./logo.png --access public --content-type image/png
FlagAliasDescriptionDefault
--access
-a
Access level (
public
,
private
)
private
--content-type
-t
Content type (auto-detected if omitted)
--format
-f
Output format (
json
,
table
,
xml
)
table
--json
Output as JSON
上传本地文件作为对象。内容类型会根据扩展名自动检测,除非手动覆盖。
bash
tigris objects put my-bucket report.pdf ./report.pdf
tigris objects put my-bucket logo.png ./logo.png --access public --content-type image/png
标志别名描述默认值
--access
-a
访问级别(
public
,
private
private
--content-type
-t
内容类型(未指定时自动检测)
--format
-f
输出格式(
json
,
table
,
xml
table
--json
以JSON格式输出

tigris objects delete <bucket> <key>
(alias:
d
)

tigris objects delete <bucket> <key>
(别名:
d

Delete one or more objects by key. Accepts comma-separated keys.
bash
tigris objects delete my-bucket old-file.txt --force
tigris objects delete my-bucket file-a.txt,file-b.txt --force
FlagDescription
--force
Skip confirmation prompt
--format
/
-f
Output format (
json
,
table
; default:
table
)
--json
Output as JSON
按键删除一个或多个对象。支持逗号分隔的多个键。
bash
tigris objects delete my-bucket old-file.txt --force
tigris objects delete my-bucket file-a.txt,file-b.txt --force
标志描述
--force
跳过确认提示
--format
/
-f
输出格式(
json
,
table
; 默认:
table
--json
以JSON格式输出

tigris objects set <bucket> <key>
(alias:
s
)

tigris objects set <bucket> <key>
(别名:
s

Update settings on an existing object such as access level or key name.
bash
tigris objects set my-bucket my-file.txt --access public
tigris objects set my-bucket my-file.txt --access private
FlagAliasDescription
--access
-a
Access level (
public
,
private
) — required
--new-key
-n
Rename the object to a new key
--format
-f
Output format (
json
,
table
; default:
table
)
--json
Output as JSON
更新现有对象的设置,例如访问级别或键名称。
bash
tigris objects set my-bucket my-file.txt --access public
tigris objects set my-bucket my-file.txt --access private
标志别名描述
--access
-a
访问级别(
public
,
private
)—— 必填项
--new-key
-n
将对象重命名为新的键
--format
-f
输出格式(
json
,
table
; 默认:
table
--json
以JSON格式输出

Common Patterns

常见模式

bash
undefined
bash
undefined

Recursive upload

递归上传

tigris cp ./dist/ t3://my-bucket/static/ -r
tigris cp ./dist/ t3://my-bucket/static/ -r

Download an entire directory

下载整个目录

tigris cp t3://my-bucket/backups/ ./local-backups/ -r
tigris cp t3://my-bucket/backups/ ./local-backups/ -r

Wildcard delete (quote the pattern!)

通配符删除(请为模式添加引号!)

tigris rm "t3://my-bucket/logs/*.tmp" -rf
tigris rm "t3://my-bucket/logs/*.tmp" -rf

Generate a presigned upload URL for client-side uploads

生成预签名上传URL用于客户端上传

tigris presign my-bucket/user-uploads/photo.jpg --method put --expires-in 600
undefined
tigris presign my-bucket/user-uploads/photo.jpg --method put --expires-in 600
undefined