Tigris Object Operations

tigrisdata/skills/skills/tigris-object-operations

by tigrisdata668ea424758eNo license2 starsListed Oct 8, 2026Updated Oct 8, 2026Repository updated 2 months ago

Use when working with objects in Tigris Storage - uploading, downloading, deleting, listing, getting metadata, or generating presigned URLs

AI-generated overview

Reference for Tigris object storage operations: upload, download, delete, list, metadata and presigned URLs.

What it does
This skill is an instruction-only reference for working with objects in Tigris Storage using the @tigrisdata/storage package. It documents the put, get, remove, list, head and getPresignedUrl functions with code samples, option tables and common pitfalls. It also covers client-side browser uploads through the client package and notes that the Tigris CLI may need installing first.
When to use it
Use it when a task involves uploading, downloading, deleting, listing or inspecting objects in Tigris Storage, or when generating presigned URLs for temporary access or client uploads. It is also useful when handling large multipart uploads, pagination or overwrite and visibility options.
Requirements
Requires the @tigrisdata/storage package (and its client entry point for browser uploads), plus the Tigris CLI (@tigrisdata/cli), which the skill says to install via npm if unavailable. Network access and Tigris credentials are implied by the storage operations. No scripts ship with the skill; it contains instructions and code examples only.

Tigris Object Operations

Prerequisites

Before doing anything else, install the Tigris CLI if it's not already available:

bash
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."

Overview

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.

Quick Reference

OperationFunctionKey Parameters
Uploadput(path, body, options)path, body, access, contentType
Downloadget(path, format, options)path, format (string/file/stream)
Deleteremove(path, options)path
Listlist(options)prefix, limit, paginationToken
Metadatahead(path, options)path
Presigned URLgetPresignedUrl(path, options)path, operation (get/put)

Upload (put)

typescript
import { put } from "@tigrisdata/storage";
// Simple uploadconst 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 progressconst result = await put("large.mp4", fileStream, {  multipart: true,  onUploadProgress: ({ loaded, total, percentage }) => {    console.log(`${loaded}/${total} bytes (${percentage}%)`);  },});
// Prevent overwriteconst result = await put("config.json", config, {  allowOverwrite: false,});

Put Options

OptionValuesDefaultPurpose
accesspublic/private-Object visibility
addRandomSuffixbooleanfalseAvoid naming collisions
allowOverwritebooleantrueAllow replacing existing
contentTypestringinferredMIME type
contentDispositioninline/attachmentinlineDownload behavior
multipartbooleanfalseEnable for large files
onUploadProgresscallback-Track upload progress

Download (get)

typescript
import { get } from "@tigrisdata/storage";
// Get as stringconst 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 streamconst result = await get("video.mp4", "stream");const reader = result.data?.getReader();// Process stream...

Get Options

OptionValuesDefaultPurpose
contentDispositioninline/attachmentinlineDownload behavior
contentTypestringfrom uploadMIME type
encodingstringutf-8Text encoding
snapshotVersionstring-Read from snapshot

Delete (remove)

typescript
import { remove } from "@tigrisdata/storage";
const result = await remove("object.txt");if (result.error) {  console.error("Error:", result.error);} else {  console.log("Deleted successfully");}

List Objects

typescript
import { list } from "@tigrisdata/storage";
// List all objectsconst result = await list();console.log("Objects:", result.data?.items);
// List with prefix (folders)const result = await list({ prefix: "images/" });
// List with paginationconst 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);}

List Options

OptionPurpose
prefixFilter keys starting with prefix
delimiterGroup keys (e.g., '/' for folders)
limitMax objects to return (default: 100)
paginationTokenContinue from previous list
snapshotVersionList from snapshot

Object Metadata (head)

typescript
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 }}

Presigned URLs

typescript
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});

Presigned URL Options

OptionValuesDefaultPurpose
operationget/put-URL purpose
expiresInseconds3600URL expiration
contentTypestring-Require for PUT

Common Mistakes

MistakeFix
Not checking error firstAlways check if (result.error) before result.data
Wrong format in get()Use 'string', 'file', or 'stream'
Forgetting multipart: trueEnable for files >100MB
Ignoring paginationUse hasMore and paginationToken

Client-Side Uploads

For browser uploads, use the client package to upload directly to Tigris:

typescript
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.

Source and attribution

Source:tigrisdata/skillsinskills/tigris-object-operationsat commit668ea42

License: No license

Content belongs to its original authors. SourceWeft indexes it from a public repository.

Report or request removal