Aliyun oss upload

From lxyeternal/MalSkillBench · View interactive version

Aliyun oss upload is an AI agent skill from the GitHub repository lxyeternal/MalSkillBench. 阿里云 OSS 文件上传工具,支持上传文件到阿里云对象存储并生成临时访问链接。使用场景:将本地文件上传到 OSS 并获得可分享的临时 URL。需要配置 ALIYUN_OSS_ACCESS_KEY_ID、ALIYUN_OSS_ACCESS_KEY_SECRET、ALIYUN_OSS_ENDPOINT、ALIYUN_OSS_BUCKET 环境变量。

How to use this skill

Skill file

阿里云 OSS 文件上传

这个技能提供阿里云 OSS(对象存储服务)的文件上传功能,支持生成带签名的临时访问链接。

快速开始

1. 配置环境变量

使用前必须配置以下环境变量(详见 references/config.md):

export ALIYUN_OSS_ACCESS_KEY_ID="your-access-key-id"
export ALIYUN_OSS_ACCESS_KEY_SECRET="your-access-key-secret"
export ALIYUN_OSS_ENDPOINT="https://oss-cn-hangzhou.aliyuncs.com"
export ALIYUN_OSS_BUCKET="your-bucket-name"

2. 安装依赖

pip install oss2

使用方法

上传文件

python scripts/oss-upload.py upload --file /path/to/local/file.txt

可选参数:

示例:

# 上传到指定路径
python scripts/oss-upload.py upload --file photo.jpg --key images/photo.jpg --expire 7200

生成临时访问链接

python scripts/oss-upload.py url --key images/photo.jpg --expire 3600

工作流程

  1. 用户请求上传文件时:
  1. 用户已有 OSS 文件需要访问链接时:

注意事项

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.