Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问clear审计通过

cloud-storage-web云存储网络

Agent Skill

cloud-storage-web 用于记录任务执行中的错误、用户纠正、经验和能力缺口,适合在 Codex、Claude、Cursor、Gemini CLI 中希望让 Agent 持续沉淀问题、修正和最佳实践时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

17,448

周安装

727

GitHub Stars

50

下载量

5,816
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:cloud-storage-web(云存储网络)
来源仓库:https://github.com/tencentcloudbase/skills
仓库路径:skills/cloud-storage-web
安装命令:
npx skills add https://github.com/tencentcloudbase/skills --skill cloud-storage-web
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/tencentcloudbase/skills --skill cloud-storage-web

简介

通过 JavaScript SDK 对 CloudBase 云存储进行基于 Web 的文件上传、下载和管理。

  • 支持四种核心操作:从浏览器上传文件并跟踪进度、生成临时下载 URL、删除文件、下载到本地存储
  • 需要在CloudBase控制台进行CORS配置;将您的前端域添加到安全域以防止错误
  • 使用格式为 cloud://env-id/path/filename 的文件 ID
  • 并支持带有 / 的文件夹层次结构
  • 分隔符
  • 包括文件组织、清理和安全域白名单的错误处理模式和最佳实践

SKILL.md

Standalone Install Note

If this environment only installed the current skill, start from the CloudBase main entry and use the published cloudbase/references/... paths for sibling skills.

  • CloudBase main entry: https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/SKILL.md
  • Current skill raw source: https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/cloud-storage-web/SKILL.md

Keep local references/... paths for files that ship with the current skill directory. When this file points to a sibling skill such as auth-tool or web-development, use the standalone fallback URL shown next to that reference.

Cloud Storage Web SDK

Activation Contract

Use this first when

  • A browser or Web app must upload, download, or manage CloudBase storage objects through @cloudbase/js-sdk.
  • The request mentions uploadFile, getTempFileURL, deleteFile, or downloadFile in frontend code.

Read before writing code if

  • The task is browser-side storage work but you still need to separate it from Mini Program storage, backend storage management, or static hosting deployment.
  • The request may be blocked by security domains or frontend auth.

Then also read

  • Web login and identity -> ../auth-web/SKILL.md (standalone fallback: https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/auth-web/SKILL.md)
  • General Web app setup -> ../web-development/SKILL.md (standalone fallback: https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/web-development/SKILL.md)
  • Direct storage management through MCP tools -> ../cloudbase-platform/SKILL.md (standalone fallback: https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/cloudbase-platform/SKILL.md)

Do NOT use for

  • Mini Program file APIs.
  • Backend or agent-side direct storage management through MCP.
  • Static website hosting deployment via uploadFiles.
  • Database operations.

Common mistakes / gotchas

  • Uploading from browser code without configuring security domains.
  • Using this skill for static hosting instead of storage objects.
  • Mixing browser SDK upload flows with server-side file-management tasks.
  • Assuming temporary download URLs are permanent links.
  • On local Vite or dev-server tasks, forgetting to whitelist the exact current browser host:port before testing app.uploadFile().

Minimal checklist

  • Confirm the caller is a browser/Web app.
  • Initialize the Web SDK once.
  • Check security-domain/CORS requirements.
  • Pick the right storage method before coding.

Local dev recipe

When the app runs on a local browser origin and must upload files from the frontend:

  1. Use envQuery with action="domains" to inspect the current security-domain whitelist.
  2. Convert the browser origin into the CloudBase whitelist entry format:

- Browser origin http://127.0.0.1:4173 -> whitelist entry 127.0.0.1:4173 - Browser origin http://localhost:5173 -> whitelist entry localhost:5173

  1. If the exact current host entry is missing, call envDomainManagement with action="create" and add that host entry before relying on app.uploadFile().
  2. If the runtime port may change between runs, do not assume any fixed default port list is sufficient. Re-check the actual browser origin you are really using for testing or final validation, then add that exact host:port.
  3. Tell the user that security-domain changes may take several minutes to propagate.
  4. Only after that should you implement and test browser-side app.uploadFile() flows.

If the task uses browser-side file upload, treat this as a prerequisite rather than an optional cleanup.

Overview

Use this skill for browser-side cloud storage operations through the CloudBase Web SDK.

Typical tasks:

  • upload files from a browser
  • generate temporary download URLs
  • delete files
  • trigger browser downloads

SDK initialization

import cloudbase from "@cloudbase/js-sdk";

const app = cloudbase.init({
  env: "your-env-id"
});

Initialization rules:

  • Use synchronous initialization with a shared app instance.
  • Do not re-initialize in every component.
  • If the operation depends on user identity, handle auth before storage operations.

Method routing

  • Upload from browser -> app.uploadFile()
  • Temporary preview/download URL -> app.getTempFileURL()
  • Delete existing files -> app.deleteFile()
  • Trigger browser download -> app.downloadFile()

Upload

const result = await app.uploadFile({
  cloudPath: "uploads/avatar.jpg",
  filePath: selectedFile
});

Upload rules

  • cloudPath must include the filename.
  • Use / to create folder structure.
  • Validate file type and size before upload.
  • Show upload progress for larger files when UX matters.
  • On local dev origins, confirm the exact frontend origin already exists in environment security domains before assuming the upload path is usable.
  • Match against the whitelist entry format returned by envQuery(action="domains"), which is typically host:port instead of a full http://... URL.
  • After app.uploadFile() succeeds, do not fabricate a public-looking URL by concatenating envId, bucket domain, or cloudPath. Use the returned fileID with app.getTempFileURL() and store or display the SDK-resolved URL instead.

Progress example

await app.uploadFile({
  cloudPath: "uploads/avatar.jpg",
  filePath: selectedFile,
  onUploadProgress: ({ loaded, total }) => {
    const percent = Math.round((loaded * 100) / total);
    console.log(percent);
  }
});

Temporary URLs

const result = await app.getTempFileURL({
  fileList: [
    {
      fileID: "cloud://env-id/uploads/avatar.jpg",
      maxAge: 3600
    }
  ]
});

Use temp URLs when the browser needs to preview or download private files without exposing a permanent public link.

Typical upload + preview flow:

const uploadResult = await app.uploadFile({
  cloudPath: "uploads/avatar.jpg",
  filePath: selectedFile
});

const tempUrlResult = await app.getTempFileURL({
  fileList: [{ fileID: uploadResult.fileID, maxAge: 3600 }]
});

const previewUrl = tempUrlResult.fileList?.[0]?.tempFileURL || tempUrlResult.fileList?.[0]?.download_url;
if (!previewUrl) {
  throw new Error("Failed to resolve temporary file URL after upload");
}

Delete files

await app.deleteFile({
  fileList: ["cloud://env-id/uploads/old-avatar.jpg"]
});

Always inspect per-file results before assuming deletion succeeded.

Download files

await app.downloadFile({
  fileID: "cloud://env-id/uploads/report.pdf"
});

Use this for browser-initiated downloads. For programmatic rendering or preview, prefer getTempFileURL().

Security-domain reminder

To avoid CORS problems, add your frontend domain in CloudBase security domains. In MCP-enabled workflows, prefer checking and updating this through tools before coding browser uploads.

{ "tool": "envQuery", "action": "domains" }

Use the actual browser origin when deciding what to add. If the page is running on a custom domain or a local dev port, add that exact host:port value instead of guessing from a hard-coded list.

{
  "tool": "envDomainManagement",
  "action": "create",
  "domains": ["<actual-browser-host>:<actual-browser-port>"]
}

Match the real browser origin to the whitelist entry format returned by envQuery(action="domains"). For local Vite and preview servers, the port can vary between runs, so avoid assuming any fixed default port is sufficient.

Typical examples:

  • <your-local-host>:<actual-port>
  • <your-custom-domain>

Best practices

  1. Use a clear folder structure such as uploads/, avatars/, documents/.
  2. Validate file size and type in the browser before upload.
  3. Use temporary URLs with reasonable expiration windows.
  4. Clean up obsolete files instead of leaving orphaned storage objects.
  5. Route privileged batch-management tasks to backend or MCP flows instead of browser direct access.

Error handling

try {
  const result = await app.uploadFile({
    cloudPath: "uploads/file.jpg",
    filePath: selectedFile
  });
  console.log(result.fileID);
} catch (error) {
  console.error("Storage operation failed:", error);
}

适合场景

01

研究助手

02

事实核查

03

知识库问答

04

带来源的搜索总结

能力概览

能力 1

组合搜索和大模型调用

能力 2

支持多来源检索和总结

能力 3

强调引用来源和事实核查

能力 4

适合研究型 Agent 流程

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

27.94%
按下载量换算1,625

Cursor

25.75%
按下载量换算1,498

Codex

19.05%
按下载量换算1,108

trae

13.87%
按下载量换算807

codebuddy

7.97%
按下载量换算464

trae-cn

3.71%
按下载量换算216

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills