TeraBox Storage Skill
TeraBox cloud storage management tool supporting upload, download, transfer, share, and file listing. All operations are restricted to the application sandbox directory.
Compatible with: OpenClaw, Claude Code, DuClaw, Ducc, etc.
Beta stage - see reference/notes.md for important notes
Installation
If the terabox CLI tool is not installed, run the installation script:
CODEBLOCK0
The script will:
- 1. Detect your OS and architecture
- Download the terabox binary from CDN
- Install it to INLINECODE1
Make sure ~/.local/bin is in your PATH:
CODEBLOCK1
Trigger Rules
Execute only when BOTH conditions are met:
- 1. User explicitly mentions TeraBox - message contains "TeraBox", "terabox", "Tera", etc.
- Clear operation intent - can determine one of: upload, download, transfer, share, list, login, logout
Do NOT execute any terabox commands if conditions are not met.
Confirmation Rules
Must confirm with user first in these scenarios:
| Scenario | Description |
|---|
| Path unclear | User did not specify file path or target path |
| Remote path exists |
Upload target has same-name file - ask: overwrite/rename/cancel |
| Local path exists | Download target has same-name file - ask: overwrite/rename/cancel |
| Ambiguous intent | "process files" → confirm upload or download; "sync" → confirm direction; "backup" → confirm direction |
Confirmation format:
CODEBLOCK2
Pre-execution Checks
Before every terabox command:
- 1. Run Skill auto-update (silently, do not block on failure):
- Skill update:
bash @skills/terabox-storage/scripts/update.sh --yes
- CLI auto-update is handled automatically by the CLI itself (built-in update check on every command execution)
- If update fails, continue with the user's requested operation
- 2. Run
terabox whoami to check login status; if not logged in, guide user to INLINECODE5 - Validate path legality (no
../, path must be within application sandbox)
Core Features
Upload
CODEBLOCK3
Supports single file and directory upload. When uploading a directory, all files are recursively uploaded.
Steps: Confirm local path exists → Confirm remote path → Use terabox ls to check if remote exists → Execute upload
Download
CODEBLOCK4
Supports single file and directory download. When downloading a directory, all files are recursively downloaded.
Steps: Use terabox ls to confirm cloud path exists → Confirm local path → Check if local exists → Execute download
Transfer (Save shared files to your cloud storage)
CODEBLOCK5
Steps: Validate link format → Confirm password exists → Confirm target directory → Execute transfer
Share Operations
CODEBLOCK6
File Operations
CODEBLOCK7
User Information
CODEBLOCK8
Update CLI
CODEBLOCK9
The CLI also checks for updates automatically on every command execution. Use --no-check-update global flag to disable this behavior.
Login
Must use the login script:
CODEBLOCK10
Requirements:
- - Must use
@skills/terabox-storage/scripts/login.sh script - Do NOT use
terabox login directly (even in GUI environments)
The login script includes complete security disclaimers and authorization flow to ensure informed user consent.
Logout
CODEBLOCK11
Path Rules
All remote paths are relative to the application sandbox directory /From:Other Applications/app-name/.
| Scenario | Rule | Example |
|---|
| In commands | Use relative paths | INLINECODE13 |
| Display to user |
Use full paths | "Uploaded to: /From:Other Applications/app/docs/f.txt" |
Prohibited:
- - Paths containing
.. or INLINECODE15 - Paths outside the application sandbox
Reference Documentation
See the reference directory for detailed information (consult when encountering issues):
Login authentication flow details, config file locations, Token management |
|
examples.md | Need more usage examples |
|
troubleshooting.md | Encountering errors that need diagnosis |
|
notes.md | Beta stage important notes |
TeraBox 存储技能
TeraBox 云存储管理工具,支持上传、下载、转存、分享和文件列表查看。所有操作仅限于应用沙箱目录。
兼容:OpenClaw、Claude Code、DuClaw、Ducc 等。
测试阶段——重要说明请参见 reference/notes.md
安装
如果未安装 terabox 命令行工具,请运行安装脚本:
bash
bash @skills/terabox-storage/scripts/install.sh
该脚本将:
- 1. 检测您的操作系统和架构
- 从 CDN 下载 terabox 二进制文件
- 将其安装到 ~/.local/bin/terabox
确保 ~/.local/bin 已添加到您的 PATH 环境变量中:
bash
export PATH=$HOME/.local/bin:$PATH
触发规则
仅当同时满足以下两个条件时才执行:
- 1. 用户明确提到 TeraBox —— 消息中包含 TeraBox、terabox、Tera 等关键词
- 明确的操作意图 —— 可确定为以下之一:上传、下载、转存、分享、列表查看、登录、退出登录
如果条件不满足,请勿执行任何 terabox 命令。
确认规则
在以下场景中必须先与用户确认:
| 场景 | 描述 |
|---|
| 路径不明确 | 用户未指定文件路径或目标路径 |
| 远程路径已存在 |
上传目标存在同名文件——询问:覆盖/重命名/取消 |
| 本地路径已存在 | 下载目标存在同名文件——询问:覆盖/重命名/取消 |
| 意图模糊 | 处理文件→确认上传或下载;同步→确认方向;备份→确认方向 |
确认格式:
操作:[上传/下载/分享/列表查看]
来源:[路径]
目标:[路径]
确认执行?
执行前检查
在执行每个 terabox 命令之前:
- 1. 运行技能自动更新(静默执行,失败不阻塞):
- 技能更新:bash @skills/terabox-storage/scripts/update.sh --yes
- CLI 自动更新由 CLI 本身自动处理(每次命令执行时内置更新检查)
- 如果更新失败,继续执行用户请求的操作
- 2. 运行 terabox whoami 检查登录状态;如果未登录,引导用户执行 bash @skills/terabox-storage/scripts/login.sh
- 验证路径合法性(无 ../,路径必须在应用沙箱内)
核心功能
上传
bash
terabox upload <本地路径> [远程路径]
terabox upload ./file.txt # 上传到根目录
terabox upload ./file.txt docs/ # 上传到 docs 目录
terabox upload ./file.txt --progress # 显示上传进度
terabox upload ./my-dir/ backup/ # 上传整个目录
支持单个文件和目录上传。上传目录时,将递归上传所有文件。
步骤:确认本地路径存在 → 确认远程路径 → 使用 terabox ls 检查远程是否存在 → 执行上传
下载
bash
terabox download <远程路径> [本地路径]
terabox download report.pdf # 下载到当前目录
terabox download report.pdf ./saved/ # 下载到指定目录
terabox download report.pdf --progress # 显示下载进度
terabox download docs/ ./local-docs/ # 下载整个目录
支持单个文件和目录下载。下载目录时,将递归下载所有文件。
步骤:使用 terabox ls 确认云端路径存在 → 确认本地路径 → 检查本地是否存在 → 执行下载
转存(将分享文件保存到您的云存储)
bash
基本用法
terabox share-save <分享链接> --pwd <密码> [--path <目标路径>]
指定保存目录
terabox share-save https://terabox.com/s/1xxxxx --pwd abcd --path my-folder/
按文件 ID 转存特定文件
terabox share-save https://terabox.com/s/1xxxxx --pwd abcd --fsid 12345,12346
步骤:验证链接格式 → 确认密码存在 → 确认目标目录 → 执行转存
分享操作
bash
查看分享详情
terabox share-info <分享链接>
列出分享文件
terabox share-list <分享链接> --pwd <密码>
terabox share-list <分享链接> --pwd <密码> --by name --order asc # 按名称排序
terabox share-list <分享链接> --pwd <密码> --by size # 按大小排序
terabox share-list <分享链接> --pwd <密码> --by time -p 2 # 按时间排序,第2页
直接下载分享文件
terabox share-download <分享链接> [本地路径] --pwd <密码>
terabox share-download <分享链接> --pwd <密码> --fsid 12345 # 下载特定文件
创建分享链接
terabox share-create <路径>... # 创建分享,自动生成密码
terabox share-create file.txt --pwd abcd # 创建分享,自定义密码
terabox share-create file.txt --period 7 # 创建分享,有效期7天
terabox share-create file.txt --public # 创建公开分享(无密码)
文件操作
bash
terabox ls [目录] # 列出文件
terabox ls -l [目录] # 列出文件(含详细信息)
terabox ls --order name # 按名称排序列出
terabox ls --order size --asc # 按大小升序列出
terabox search <关键词> # 搜索文件
terabox search <关键词> --order name # 搜索并排序
terabox info <文件路径> # 获取文件详情
terabox info <文件路径> --dlink # 获取文件详情(含下载链接)
terabox mv <来源> <目标> # 移动文件
terabox cp <来源> <目标> # 复制文件
terabox rename <路径> <新名称> # 重命名文件
用户信息
bash
terabox uinfo # 获取用户信息
terabox quota # 查询存储配额
更新 CLI
bash
terabox update # 检查并更新 CLI
terabox update check # 仅检查更新
terabox update apply # 应用待处理更新
terabox update rollback # 回滚到上一版本
terabox update list # 列出已安装版本
CLI 还会在每次命令执行时自动检查更新。使用 --no-check-update 全局标志可禁用此行为。
登录
必须使用登录脚本:
bash
bash scripts/login.sh
要求:
- - 必须使用 @skills/terabox-storage/scripts/login.sh 脚本
- 请勿直接使用 terabox login(即使在图形界面环境中)
登录脚本包含完整的安全声明和授权流程,以确保用户知情同意。
退出登录
bash
terabox logout
路径规则
所有远程路径均相对于应用沙箱目录 /From:Other Applications/app-name/。
| 场景 | 规则 | 示例 |
|---|
| 命令中 | 使用相对路径 | terabox upload ./f.txt docs/f.txt |
| 向用户展示 |
使用完整路径 | 已上传至:/From:Other Applications/app/docs/f.txt |
禁止:
参考文档
详细信息请参见参考目录(遇到问题时查阅):
登录认证流程详情、配置文件位置、Token 管理 |
|
examples.md | 需要更多使用示例时 |
|
troubleshooting.md | 遇到需要诊断的错误时 |
|
notes.md | 测试阶段重要说明 |