一键导入
tigris-object-operations
Use when working with objects in Tigris Storage - uploading, downloading, deleting, listing, getting metadata, or generating presigned URLs
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when working with objects in Tigris Storage - uploading, downloading, deleting, listing, getting metadata, or generating presigned URLs
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Back up and restore the OpenClaw state directory (config, workspace, sessions, skills) to a Tigris bucket. Scheduled backups, safe SQLite handling, point-in-time rollback via bucket snapshots, and zero-copy clones via forks. Use when the user wants their assistant's state to survive machine loss, move to a new machine, or roll back to before a bad update.
Use when migrating from AWS S3, Google Cloud Storage, or Azure Blob to Tigris — shadow buckets via `tigris buckets set-migration`, active drain via `tigris buckets migrate`, bulk copy, SDK endpoint swap, zero-downtime migration
Use when working with Tigris file storage - uploading, downloading, deleting, listing files, presigned URLs, client uploads, or setting up Tigris CLI and SDK. Covers Next.js, Remix, Express, Rails, and Laravel. For Python/Django, see the tigris-python-sdk skill.
Use when backing up databases to Tigris, scheduling exports, archiving data, or setting up automated backup pipelines — covers Next.js, Remix, Rails, Django, Laravel, Express
Use when working with Tigris from Python — boto3 setup, Django uploads via django-storages, snapshots, bucket forking, in-place object rename, conditional writes (IfMatch/IfNoneMatch), and the Bundle API for batch ML data fetches. Covers the tigris-boto3-ext extension library (context managers, decorators, helpers) plus framework integration.
Use when choosing between Tigris-native SDKs and AWS S3-compatible SDKs — covers which SDK to use per language, CLI preference, and when AWS SDKs are the only option
| name | tigris-object-operations |
| description | Use when working with objects in Tigris Storage - uploading, downloading, deleting, listing, getting metadata, or generating presigned URLs |
Before doing anything else, install the Tigris CLI if it's not already available:
tigris help || npm install -g @tigrisdata/cli
If you need to install it, tell the user: "I'm installing the Tigris CLI (@tigrisdata/cli) so we can work with Tigris object storage."
Tigris Storage provides object operations: upload (put), download (get), delete (remove), list, metadata (head), and presigned URLs.
All methods return TigrisStorageResponse<T, E> - check error property first.
| Operation | Function | Key Parameters |
|---|---|---|
| Upload | put(path, body, options) | path, body, access, contentType |
| Download | get(path, format, options) | path, format (string/file/stream) |
| Delete | remove(path, options) | path |
| List | list(options) | prefix, limit, paginationToken |
| Metadata | head(path, options) | path |
| Presigned URL | getPresignedUrl(path, options) | path, operation (get/put) |
import { put } from "@tigrisdata/storage";
// Simple upload
const result = await put("simple.txt", "Hello, World!");
if (result.error) {
console.error("Error:", result.error);
} else {
console.log("Uploaded:", result.data?.url);
}
// Large file with progress
const result = await put("large.mp4", fileStream, {
multipart: true,
onUploadProgress: ({ loaded, total, percentage }) => {
console.log(`${loaded}/${total} bytes (${percentage}%)`);
},
});
// Prevent overwrite
const result = await put("config.json", config, {
allowOverwrite: false,
});
| Option | Values | Default | Purpose |
|---|---|---|---|
| access | public/private | - | Object visibility |
| addRandomSuffix | boolean | false | Avoid naming collisions |
| allowOverwrite | boolean | true | Allow replacing existing |
| contentType | string | inferred | MIME type |
| contentDisposition | inline/attachment | inline | Download behavior |
| multipart | boolean | false | Enable for large files |
| onUploadProgress | callback | - | Track upload progress |
import { get } from "@tigrisdata/storage";
// Get as string
const result = await get("object.txt", "string");
if (result.error) {
console.error("Error:", result.error);
} else {
console.log("Content:", result.data);
}
// Get as file (triggers download in browser)
const result = await get("object.pdf", "file", {
contentDisposition: "attachment",
});
// Get as stream
const result = await get("video.mp4", "stream");
const reader = result.data?.getReader();
// Process stream...
| Option | Values | Default | Purpose |
|---|---|---|---|
| contentDisposition | inline/attachment | inline | Download behavior |
| contentType | string | from upload | MIME type |
| encoding | string | utf-8 | Text encoding |
| snapshotVersion | string | - | Read from snapshot |
import { remove } from "@tigrisdata/storage";
const result = await remove("object.txt");
if (result.error) {
console.error("Error:", result.error);
} else {
console.log("Deleted successfully");
}
import { list } from "@tigrisdata/storage";
// List all objects
const result = await list();
console.log("Objects:", result.data?.items);
// List with prefix (folders)
const result = await list({ prefix: "images/" });
// List with pagination
const allFiles = [];
let currentPage = await list({ limit: 10 });
allFiles.push(...currentPage.data?.items);
while (currentPage.data?.hasMore) {
currentPage = await list({
limit: 10,
paginationToken: currentPage.data?.paginationToken,
});
allFiles.push(...currentPage.data?.items);
}
| Option | Purpose |
|---|---|
| prefix | Filter keys starting with prefix |
| delimiter | Group keys (e.g., '/' for folders) |
| limit | Max objects to return (default: 100) |
| paginationToken | Continue from previous list |
| snapshotVersion | List from snapshot |
import { head } from "@tigrisdata/storage";
const result = await head("object.txt");
if (result.error) {
console.error("Error:", result.error);
} else {
console.log("Metadata:", result.data);
// { path, size, contentType, modified, url, contentDisposition }
}
import { getPresignedUrl } from "@tigrisdata/storage";
// Presigned URL for GET (temporary access)
const result = await getPresignedUrl("object.txt", {
operation: "get",
expiresIn: 3600, // 1 hour
});
console.log("URL:", result.data?.url);
// Presigned URL for PUT (allow client upload)
const result = await getPresignedUrl("upload.txt", {
operation: "put",
expiresIn: 600, // 10 minutes
});
| Option | Values | Default | Purpose |
|---|---|---|---|
| operation | get/put | - | URL purpose |
| expiresIn | seconds | 3600 | URL expiration |
| contentType | string | - | Require for PUT |
| Mistake | Fix |
|---|---|
Not checking error first | Always check if (result.error) before result.data |
Wrong format in get() | Use 'string', 'file', or 'stream' |
Forgetting multipart: true | Enable for files >100MB |
| Ignoring pagination | Use hasMore and paginationToken |
For browser uploads, use the client package to upload directly to Tigris:
import { upload } from "@tigrisdata/storage/client";
const result = await upload(file.name, file, {
url: "/api/upload", // Your backend endpoint
onUploadProgress: ({ percentage }) => {
console.log(`${percentage}%`);
},
});
For initial setup, see file-storage.