返回顶部
t

tencent-cos-ops腾讯云COS运维

|

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
85
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

tencent-cos-ops

Tencent COS 操作

腾讯云COS对象存储操作工具,支持文件上传、下载、列表和管理。

环境配置

使用前需要设置以下环境变量:

bash
export COSSECRETID=你的SecretId
export COSSECRETKEY=你的SecretKey
export COS_REGION=ap-beijing # COS地域
export COS_BUCKET=examplebucket-1250000000 # Bucket名称

快速使用

上传文件(按月自动管理)

bash
python scripts/cos_ops.py upload /path/to/file.txt

默认按当前月份 YYYY/MM/filename 格式存储,例如 2024/03/report.pdf

指定目录上传

bash
python scripts/cos_ops.py upload /path/to/file.txt --key myfolder/report.pdf

高级上传(分块上传,适合大文件)

bash
python scripts/cos_ops.py upload /path/to/largefile.zip --advanced --part-size 10 --threads 20

下载文件

bash
python scripts/cos_ops.py download 2024/03/report.pdf /local/path/report.pdf

列出文件

bash

列出所有文件


python scripts/cos_ops.py list

按前缀筛选

python scripts/cos_ops.py list --prefix 2024/03/

指定bucket

python scripts/cos_ops.py list --prefix logs/ --bucket my-bucket-1250000000

删除文件

bash
python scripts/cos_ops.py delete 2024/03/report.pdf

Python脚本使用

在Python代码中直接调用:

python
from cosops import uploadfile, downloadfile, listobjects, delete_object

上传文件(自动按月管理)

upload_file(/path/to/file.txt)

指定对象键

uploadfile(/path/to/file.txt, coskey=custom/path/file.txt)

下载文件

download_file(2024/03/report.pdf, /local/save/report.pdf)

列出文件

list_objects(prefix=2024/03/)

删除文件

delete_object(2024/03/report.pdf)

按月文件管理

脚本默认使用当前年月作为存储前缀,实现按月管理:

  • - 上传文件自动存储到 YYYY/MM/ 目录下
  • 例如:2024年3月上传的 report.pdf 会存储为 2024/03/report.pdf

API参考

详细API文档请查看 references/cos_api.md

常用API

方法说明
uploadfile()简单上传,文件流方式
uploadfile_advanced()
高级上传,自动分块 | | download_file() | 下载文件到本地 | | list_objects() | 列出对象 | | delete_object() | 删除单个对象 |

版本

版本日期更新内容
1.0.02026-03-31初始版本,支持上传、下载、列举、删除功能,按月文件管理

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 tencent-cos-ops-1775913492 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 tencent-cos-ops-1775913492 技能

通过命令行安装

skillhub install tencent-cos-ops-1775913492

下载

⬇ 下载 tencent-cos-ops v1.0.0(免费)

文件大小: 5.5 KB | 发布时间: 2026-4-12 11:38

v1.0.0 最新 2026-4-12 11:38
## English
Uploading and downloading files using Tencent Cloud COS, and the remote file management skills of the intelligent agent.

## 中文
使用腾讯云cos上传与下载文件,智能体的远端文件管理技能

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部