简介
一键上传文件至 MinIO 对象存储,生成可分享的 Markdown 格式链接,支持视频预览与自定义文件名。
原始描述
Upload files to MinIO object storage and generate shareable links with Markdown formatting. Use when users ask to send files, share files, upload files, down...
通过你的 Agent 添加
安装目录:minio-share/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
技能正文
name: minio-share
description: Upload files to MinIO object storage and generate shareable links with Markdown formatting. Use when users ask to send files, share files, upload files, download videos, or get a download link for files. Supports custom filenames from titles and provides formatted output with clickable links and media previews. Requires MINIO_API_URL, MINIO_CONSOLE_URL, MINIO_ACCESS_KEY, MINIO_SECRET_KEY, and MINIO_BUCKET environment variables.
MinIO Share
Upload files to MinIO and generate shareable links for users with Markdown formatting.
Requirements
Ensure these environment variables are set:
MINIO_API_URL- MinIO S3 API endpoint (e.g.,https://minio-api.example.com)MINIO_CONSOLE_URL- MinIO Web Console URL (e.g.,https://minio.example.com)MINIO_ACCESS_KEY- MinIO access keyMINIO_SECRET_KEY- MinIO secret keyMINIO_BUCKET- Default bucket name for uploads
Installation
Install the minio Python package if not already available:
pip install minio
Usage
Basic Upload
Upload a file with Markdown output:
python3 scripts/minio_upload.py /path/to/file.txt
Use Title as Filename
Upload with a custom title (sanitized for safe filenames):
python3 scripts/minio_upload.py /path/to/video.mp4 --title "My Video Title"
This will save the file as My_Video_Title.mp4 (special characters replaced with underscores).
Custom Object Name
Specify a custom name for the uploaded object:
python3 scripts/minio_upload.py /path/to/file.txt --name custom-name.pdf
Adjust Link Expiry
Change the presigned URL expiry time (default: 7 days):
python3 scripts/minio_upload.py /path/to/file.txt --expiry 30
JSON Output
Get structured output:
python3 scripts/minio_upload.py /path/to/file.txt --json
Plain Text Output
Get just the URL:
python3 scripts/minio_upload.py /path/to/file.txt
Workflow
When a user asks to send/share/upload a file or download a video:
- Check environment variables - Verify MINIO_* variables are set
- Download the file (if it's a URL) to a temporary location
- Upload the file using
scripts/minio_upload.py:- For videos: Use
--title "Video Title"to set a meaningful filename - For images: They will be displayed inline with Markdown
- For videos: A video player will be included in the output
- For videos: Use
- Copy the Markdown output to your response
Filename Sanitization
When using --title, the script automatically:
- Replaces illegal characters (
< > : " / \ | ? *) with underscores - Collapses multiple spaces/underscores
- Trims to 100 characters max
- Preserves Chinese characters, letters, numbers
Output Formats
Markdown Output (Default)
Provides rich formatting with:
- File information (name, size, expiry)
- Inline image preview (for image files)
- Video player (for video files)
- Clickable download link
- Console preview link
- Plain text URL for copying
Example Markdown Output
📄 **文件名**: `sample.mp4`
📦 **大小**: 44.51 MB
⏱️ **链接有效期**: 7 天
🌐 **[sample.mp4](...)**
Error Handling
📄 **文件名**: `sample.mp4`
📦 **大小**: 44.51 MB
⏱️ **链接有效期**: 7 天
🌐 **[sample.mp4](...)**
Common issues:
- Missing environment variables - Check all MINIO_* vars are set
- Bucket doesn't exist - Ensure MINIO_BUCKET exists or create it first
- File not found - Verify the file path is correct
- Connection error - Check MINIO_API_URL is accessible
- SSL errors - Use
--insecureflag if needed (not recommended for production)
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。