Communitygithub.com

cli-anything-tigris

一个无状态命令行接口,用于 Tigris 对象存储,包装官方 Tigris CLI,通过统一的 `--json` 入口提供所有 Tigris 原语(快照、IAM、作用域凭据、OAuth)。

cli-anything-tigris 是什么?

cli-anything-tigris 是一个为 AI 代理设计的有状态 CLI 工具,专门用于与 Tigris 对象存储(https://www.tigrisdata.com)交互。它包装了官方的 `tigris` CLI,通过单个、对代理友好的入口点暴露所有 Tigris 原语,包括快照、IAM、作用域凭据和 OAuth。其关键特性是普遍支持 `--json` 标志,确保所有命令的输出对机器可解析,从而便于 AI 代理编程使用。 该工具支持多种平台(macOS、Linux 等),要求安装 Python 3.10+ 和官方的 Tigris CLI(通过 `npm install -g @tigrisdata/cli` 或 `brew` 安装)。认证通过 `tigris login` 以浏览器 OAuth 方式或通过 Tigris 访问密钥完成。 该工具提供了针对 Tigris 存储操作的命令组,包括 `bucket`(增删改查)、`object`(上传、下载、复制、删除)、`presign`(生成有时限的预签名 URL)、`snapshot`(创建和管理点时间快照——这是一个 Tigris 特有的原语)、`access-key`(创建和管理作用域访问密钥以实现每代理隔离)以及 `iam`(管理策略和用户)。 对于 AI 代理,建议在关键操作中使用 `--json` 以获取可解析的输出,并在需要确认的破坏性操作(如删除资源)中必须显式提供 `--yes` 标志。工具支持用于依赖数据缓存或存储的 AI 工作流的持久存储,无需复杂配置。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/HKUDS/CLI-Anything/tree/main/skills/cli-anything-tigris

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

cli-anything-tigris 是做什么的?

一个无状态命令行接口,用于 Tigris 对象存储。包装官方 tigris CLI,使每个 Tigris 原语(快照、IAM、作用域凭据、OAuth)都能通过单个对代理友好的入口点使用,并普遍支持 --json。

范围

此封装仅用于官方 Tigris CLI。它通过 tigris 二进制文件执行命令,并假设通过 tigris login 或 Tigris 访问密钥进行身份验证。这不是一个通用的 S3 端点工具,也不管理 MinIO、Cloudflare R2、AWS S3 或任意兼容 S3 的端点。

安装

# 1. 安装底层 Tigris CLI
npm install -g @tigrisdata/cli
# 或:
brew install tigrisdata/tap/tigris

# 2. 进行身份验证(浏览器 OAuth)
tigris login

# 3. 安装此封装
pip install cli-anything-tigris

前提条件:

  • Python 3.10+
  • tigris CLI 位于 PATH 中(该二进制文件的别名为 t3)

用法

基本命令

# 显示帮助
cli-anything-tigris --help

# 启动交互式 REPL
cli-anything-tigris

# 查看当前用户(JSON 输出供代理使用)
cli-anything-tigris --json auth whoami

# 列出存储桶
cli-anything-tigris --json bucket list

# 上传本地文件
cli-anything-tigris --json object put --bucket my-bucket --key path/to/file.txt --file ./local.txt

# 下载对象
cli-anything-tigris --json object get --bucket my-bucket --key path/to/file.txt --output ./out.txt

# 服务端复制
cli-anything-tigris --json object cp t3://my-bucket/src.txt t3://my-bucket/dst.txt

# 创建快照
cli-anything-tigris --json snapshot take my-bucket --name baseline-v1

# 删除存储桶;必须使用 --yes
cli-anything-tigris --json bucket delete --name old-bucket --yes

# 为代理运行创建作用域访问密钥
cli-anything-tigris --json access-key create my-agent-key
cli-anything-tigris --json access-key assign tid_AaBb --bucket my-bucket --role Editor

# 轮换或删除访问密钥;必须使用 --yes
cli-anything-tigris --json access-key rotate tid_AaBb --yes
cli-anything-tigris --json access-key delete tid_AaBb --yes

# 预签名下载 URL(1 小时)
cli-anything-tigris --json presign get --bucket my-bucket --key path/to/file.txt --expires 3600

REPL 模式

当不带子命令调用时,CLI 会进入一个交互式 REPL,支持 Tab 补全和历史记录。

命令组

auth

基于 OAuth 的身份验证。

命令描述
login浏览器 OAuth 登录(tigris login)
logout退出当前会话
whoami打印已验证的用户/组织

bucket

存储桶 CRUD。

命令描述
list列出所有存储桶
create --name NAME创建存储桶
delete --name NAME --yes删除空存储桶(必须使用 --yes)
info NAME获取存储桶信息

object

对象操作(包装 tigris ls/cp/rm/stat)。

命令描述
list --bucket B [--prefix P] [--limit N]列出对象
put --bucket B --key K (--file F | --text T)上传对象
get --bucket B --key K --output F下载对象
delete --bucket B --key K删除对象
info --bucket B --key K对象元数据(HEAD / stat)
cp SRC DST [-r]复制。接受 t3:// 或 tigris:// URI。

presign

有时限的 URL。

命令描述
get --bucket B --key K [--expires SEC]预签名下载 URL
put --bucket B --key K [--expires SEC]预签名上传 URL

snapshot

时间点存储桶快照——Tigris 特有的原语。

命令描述
list BUCKET列出存储桶的快照
take BUCKET [--name N]创建快照

access-key

作用域编程凭据——与 snapshot 结合使用以实现每代理隔离。

命令描述
list列出所有访问密钥
create NAME创建新的访问密钥(密钥仅显示一次)
get KEY_ID显示密钥详情
delete KEY_ID --yes永久删除密钥(必须使用 --yes)
assign KEY_ID --bucket B --role R将密钥作用域到存储桶和角色
rotate KEY_ID --yes轮换密钥的密钥(必须使用 --yes)

iam

策略和组织用户。

命令描述
policy list列出 IAM 策略
policy create NAME --document FILE从 JSON 文件创建策略
user list列出组织用户
user invite EMAIL [--role R]邀请用户

输出格式

所有命令都支持双输出模式:

  • 人类可读(默认):表格、颜色、格式化文本
  • 机器可读(--json):JSON 信封(或上游 CLI 的 --format json 输出,原样回显)

针对 AI 代理

当以编程方式使用此 CLI 时:

  1. 始终传递 --json 以获得可解析的输出。
  2. 检查返回码——0 表示成功,非零表示错误。
  3. 读取 stderr 以获取错误消息。
  4. object cp 接受 t3://bucket/key 或 tigris://bucket/key URI;服务端复制(t3 → t3)完全跳过往返行程。
  5. presign 在人类模式下在 stdout 上返回 URL;在 JSON 模式下,它是 url 字段。
  6. 针对破坏性操作:存储桶删除、访问密钥删除和访问密钥轮换需要显式的 --yes;首先对目标存储桶创建 snapshot,然后执行操作,然后保留快照或丢弃它。
  7. 针对每代理隔离:使用 access-key create + access-key assign --bucket B --role Editor 创建一个作用于单个存储桶的密钥;当代理运行结束时,使用 access-key delete 撤销它。

为什么选择 Tigris

  • 全球分布。 数据放置在最常读取的位置附近。
  • 无出站费用。 从任何地方拉取工件的代理不会产生按区域带宽费用。
  • 快照 + 作用域凭据。 通用兼容 S3 的提供商不提供的原语——每代理隔离的基础。
  • 兼容 S3。 可与兼容 S3 的工具一起使用,但此封装本身不是一个通用的 S3/MinIO/R2/AWS 端点管理器。

版本

1.0.0

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

cli-anything-adguardhome

>-

cli-anything-anygen

>-

cli-anything-audacity

>-

cli-anything-blender

>-

cli-anything-browser

Browser automation CLI using DOMShell MCP server. Maps Chrome

cli-anything-calibre

>-

cli-anything-ccswitch

CLI interface for CC Switch — manage AI coding tool configurations from the terminal

cli-anything-chromadb

>-

cli-anything-cloudanalyzer

Command-line interface for CloudAnalyzer — Agent-friendly harness for CloudAnalyzer, a QA platform for mapping, localization, and perception outputs. Supports 27 commands across 8 groups: point cloud evaluation, trajectory evaluation, ground segmentation QA, config-driven quality gates, baseline evolution, processing, visualization, and interactive REPL.

cli-anything-cloudcompare

Command-line interface for CloudCompare — Agent-friendly harness for CloudCompare, the open-source 3D point cloud and mesh processing software. Supports 41 commands across 9 groups: project management, session control, point cloud operations (subsample, filter, segment, analyze), mesh operations, distance computation (C2C, C2M), transformations (ICP, matrix), export (LAS/LAZ/PLY/PCD/OBJ/STL/E57), and interactive REPL.

cli-anything-comfyui

>-

cli-anything-dify-workflow

Wrapper for the Dify workflow DSL CLI. Create, inspect, validate, edit, and export Dify workflow files through a CLI-Anything harness.

cli-anything-drawio

>-

cli-anything-eez-studio

Use EEZ Studio from the command line: inspect and modify native .eez-project files, edit LVGL screens/widgets, manage SCPI commands, and invoke the real EEZ Studio backend for LVGL builds.

cli-anything-eth2-quickstart

>-

cli-anything-exa

>-

cli-anything-firefly-iii

Firefly III CLI - Personal finance management via CLI-Anything

cli-anything-freecad

Complete CLI harness for FreeCAD parametric 3D CAD modeler (258 commands). Covers ALL workbenches: Part (29 primitives + boolean + mirror + loft + sweep), Sketcher (26 cmds: geometry + constraints + editing), PartDesign (38 cmds: pad/pocket/groove/fillet/chamfer/patterns/hole/datum), Assembly (11 cmds), Mesh (16 cmds), TechDraw (15 cmds: views + dimensions + PDF/SVG), Draft (33 cmds: 2D shapes + arrays + transforms), FEM (12 cmds), CAM/CNC (10 cmds), Surface (6 cmds), Spreadsheet (7 cmds), Import (13 formats), Export (17 formats), Measure (12 cmds), Materials (21 presets). Headless FreeCAD export to STEP/IGES/STL/OBJ/DXF/PDF/glTF/3MF.

cli-anything-gimp

>-

cli-anything-godot

>-

相关技能