npx skills add https://github.com/vm0-ai/vm0-skills --skill minio通过 mc(MinIO 客户端)或 curl 使用 MinIO API 来管理 S3 兼容的对象存储,以实现文件上传、下载和存储桶操作。
官方文档:
https://min.io/docs/minio/linux/reference/minio-mc.html
在以下场景中使用此技能:
mc)广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
# macOS
brew install minio/stable/mc
# Linux (amd64)
curl -O https://dl.min.io/client/mc/release/linux-amd64/mc
chmod +x mc && sudo mv mc /usr/local/bin/
# 验证安装
mc --version
export MINIO_ENDPOINT="play.min.io"
export MINIO_ACCESS_KEY="your-access-key"
export MINIO_SECRET_KEY="your-secret-key"
用于测试时,可使用 MinIO Play(公共沙盒):
export MINIO_ENDPOINT="play.min.io"
export MINIO_ACCESS_KEY="Q3AM3UQ867SPQQA43P2F"
export MINIO_SECRET_KEY="zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG"
mc alias set myminio https://${MINIO_ENDPOINT} ${MINIO_ACCESS_KEY} ${MINIO_SECRET_KEY}
mc ls myminio
mc mb myminio/my-bucket
# 上传单个文件
mc cp /path/to/file.txt myminio/my-bucket/
# 使用自定义名称上传
mc cp /path/to/file.txt myminio/my-bucket/custom-name.txt
# 递归上传目录
mc cp --recursive /path/to/folder/ myminio/my-bucket/folder/
# 下载单个文件
mc cp myminio/my-bucket/file.txt /local/path/
# 下载整个存储桶
mc cp --recursive myminio/my-bucket/ /local/path/
# 列出所有对象
mc ls myminio/my-bucket
# 递归列出并显示详细信息
mc ls --recursive --summarize myminio/my-bucket
# 删除单个文件
mc rm myminio/my-bucket/file.txt
# 删除存储桶中的所有对象
mc rm --recursive --force myminio/my-bucket/
# 删除存储桶(必须为空)
mc rb myminio/my-bucket
创建临时的可共享链接:
# 下载 URL(默认 7 天后过期)
mc share download myminio/my-bucket/file.txt
# 自定义过期时间的下载 URL(最长 7 天)
mc share download --expire 2h myminio/my-bucket/file.txt
# 上传 URL(用于外部上传)
mc share upload myminio/my-bucket/uploads/
# 从本地到远程单向同步
mc mirror /local/folder/ myminio/my-bucket/folder/
# 从远程到本地单向同步
mc mirror myminio/my-bucket/folder/ /local/folder/
# 持续监视并同步更改
mc mirror --watch /local/folder/ myminio/my-bucket/folder/
# 获取文件元数据
mc stat myminio/my-bucket/file.txt
# 获取存储桶信息
mc stat myminio/my-bucket
# 按名称模式查找
mc find myminio/my-bucket --name "*.txt"
# 查找大于 10MB 的文件
mc find myminio/my-bucket --larger 10MB
# 查找最近 7 天内修改的文件
mc find myminio/my-bucket --newer-than 7d
对于没有 mc 的环境,可以使用预签名 URL 配合 curl:
# 首先,使用 mc 生成上传 URL
UPLOAD_URL=$(mc share upload --json myminio/my-bucket/file.txt | jq -r '.share')
# 然后使用 curl 上传
curl -X PUT --upload-file /path/to/file.txt "$UPLOAD_URL"
# 生成下载 URL
DOWNLOAD_URL=$(mc share download --json myminio/my-bucket/file.txt | jq -r '.share')
# 使用 curl 下载
curl -o /local/path/file.txt "$DOWNLOAD_URL"
用于无需 mc 的直接 API 访问(简单身份验证):
#!/bin/bash
# minio-upload.sh - 上传文件到 MinIO
bucket="$1"
file="$2"
host="${MINIO_ENDPOINT}"
s3_key="${MINIO_ACCESS_KEY}"
s3_secret="${MINIO_SECRET_KEY}"
resource="/${bucket}/${file}"
content_type="application/octet-stream"
date=$(date -R)
signature_string="PUT\n\n${content_type}\n${date}\n${resource}"
signature=$(echo -en "${signature_string}" | openssl sha1 -hmac "${s3_secret}" -binary | base64)
curl -X PUT -T "${file}" --header "Host: ${host}" --header "Date: ${date}" --header "Content-Type: ${content_type}" --header "Authorization: AWS ${s3_key}:${signature}" "https://${host}${resource}"
用法:
chmod +x minio-upload.sh
./minio-upload.sh my-bucket myfile.txt
MinIO 完全兼容 AWS CLI:
# 为 MinIO 配置 AWS CLI
aws configure set aws_access_key_id "${MINIO_ACCESS_KEY}"
aws configure set aws_secret_access_key "${MINIO_SECRET_KEY}"
aws configure set default.s3.signature_version s3v4
# 列出存储桶
aws --endpoint-url "https://${MINIO_ENDPOINT}" s3 ls
# 上传文件
aws --endpoint-url "https://${MINIO_ENDPOINT}" s3 cp file.txt s3://my-bucket/
# 下载文件
aws --endpoint-url "https://${MINIO_ENDPOINT}" s3 cp s3://my-bucket/file.txt ./
# 列出对象
aws --endpoint-url "https://${MINIO_ENDPOINT}" s3 ls s3://my-bucket/
mc anonymous set download myminio/my-bucket
mc anonymous set none myminio/my-bucket
# 创建 policy.json
cat > /tmp/policy.json << 'EOF'
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {"AWS": ["*"]},
"Action": ["s3:GetObject"],
"Resource": ["arn:aws:s3:::my-bucket/public/*"]
}
]
}
EOF
mc anonymous set-json /tmp/policy.json myminio/my-bucket
mc mirror --watch 用于持续同步每周安装数
88
代码仓库
GitHub 星标数
48
首次出现
2026 年 1 月 24 日
安全审计
安装于
codex74
gemini-cli74
opencode74
github-copilot71
cursor65
kimi-cli63
Use the MinIO API via mc (MinIO Client) or curl to manage S3-compatible object storage for file uploads, downloads, and bucket operations.
Official docs:
https://min.io/docs/minio/linux/reference/minio-mc.html
Use this skill when you need to:
mc)# macOS
brew install minio/stable/mc
# Linux (amd64)
curl -O https://dl.min.io/client/mc/release/linux-amd64/mc
chmod +x mc && sudo mv mc /usr/local/bin/
# Verify installation
mc --version
export MINIO_ENDPOINT="play.min.io"
export MINIO_ACCESS_KEY="your-access-key"
export MINIO_SECRET_KEY="your-secret-key"
For testing, use MinIO Play (public sandbox):
export MINIO_ENDPOINT="play.min.io"
export MINIO_ACCESS_KEY="Q3AM3UQ867SPQQA43P2F"
export MINIO_SECRET_KEY="zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG"
mc alias set myminio https://${MINIO_ENDPOINT} ${MINIO_ACCESS_KEY} ${MINIO_SECRET_KEY}
mc ls myminio
mc mb myminio/my-bucket
# Upload single file
mc cp /path/to/file.txt myminio/my-bucket/
# Upload with custom name
mc cp /path/to/file.txt myminio/my-bucket/custom-name.txt
# Upload directory recursively
mc cp --recursive /path/to/folder/ myminio/my-bucket/folder/
# Download single file
mc cp myminio/my-bucket/file.txt /local/path/
# Download entire bucket
mc cp --recursive myminio/my-bucket/ /local/path/
# List all objects
mc ls myminio/my-bucket
# List recursively with details
mc ls --recursive --summarize myminio/my-bucket
# Delete single file
mc rm myminio/my-bucket/file.txt
# Delete all objects in bucket
mc rm --recursive --force myminio/my-bucket/
# Delete bucket (must be empty)
mc rb myminio/my-bucket
Create temporary shareable links:
# Download URL (expires in 7 days by default)
mc share download myminio/my-bucket/file.txt
# Download URL with custom expiry (max 7 days)
mc share download --expire 2h myminio/my-bucket/file.txt
# Upload URL (for external uploads)
mc share upload myminio/my-bucket/uploads/
# One-way sync local to remote
mc mirror /local/folder/ myminio/my-bucket/folder/
# One-way sync remote to local
mc mirror myminio/my-bucket/folder/ /local/folder/
# Watch and sync changes continuously
mc mirror --watch /local/folder/ myminio/my-bucket/folder/
# Get file metadata
mc stat myminio/my-bucket/file.txt
# Get bucket info
mc stat myminio/my-bucket
# Find by name pattern
mc find myminio/my-bucket --name "*.txt"
# Find files larger than 10MB
mc find myminio/my-bucket --larger 10MB
# Find files modified in last 7 days
mc find myminio/my-bucket --newer-than 7d
For environments without mc, use pre-signed URLs with curl:
# First, generate upload URL with mc
UPLOAD_URL=$(mc share upload --json myminio/my-bucket/file.txt | jq -r '.share')
# Then upload with curl
curl -X PUT --upload-file /path/to/file.txt "$UPLOAD_URL"
# Generate download URL
DOWNLOAD_URL=$(mc share download --json myminio/my-bucket/file.txt | jq -r '.share')
# Download with curl
curl -o /local/path/file.txt "$DOWNLOAD_URL"
For direct API access without mc (simple authentication):
#!/bin/bash
# minio-upload.sh - Upload file to MinIO
bucket="$1"
file="$2"
host="${MINIO_ENDPOINT}"
s3_key="${MINIO_ACCESS_KEY}"
s3_secret="${MINIO_SECRET_KEY}"
resource="/${bucket}/${file}"
content_type="application/octet-stream"
date=$(date -R)
signature_string="PUT\n\n${content_type}\n${date}\n${resource}"
signature=$(echo -en "${signature_string}" | openssl sha1 -hmac "${s3_secret}" -binary | base64)
curl -X PUT -T "${file}" --header "Host: ${host}" --header "Date: ${date}" --header "Content-Type: ${content_type}" --header "Authorization: AWS ${s3_key}:${signature}" "https://${host}${resource}"
Usage:
chmod +x minio-upload.sh
./minio-upload.sh my-bucket myfile.txt
MinIO is fully compatible with AWS CLI:
# Configure AWS CLI for MinIO
aws configure set aws_access_key_id "${MINIO_ACCESS_KEY}"
aws configure set aws_secret_access_key "${MINIO_SECRET_KEY}"
aws configure set default.s3.signature_version s3v4
# List buckets
aws --endpoint-url "https://${MINIO_ENDPOINT}" s3 ls
# Upload file
aws --endpoint-url "https://${MINIO_ENDPOINT}" s3 cp file.txt s3://my-bucket/
# Download file
aws --endpoint-url "https://${MINIO_ENDPOINT}" s3 cp s3://my-bucket/file.txt ./
# List objects
aws --endpoint-url "https://${MINIO_ENDPOINT}" s3 ls s3://my-bucket/
mc anonymous set download myminio/my-bucket
mc anonymous set none myminio/my-bucket
# Create policy.json
cat > /tmp/policy.json << 'EOF'
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {"AWS": ["*"]},
"Action": ["s3:GetObject"],
"Resource": ["arn:aws:s3:::my-bucket/public/*"]
}
]
}
EOF
mc anonymous set-json /tmp/policy.json myminio/my-bucket
mc mirror --watch for continuous syncWeekly Installs
88
Repository
GitHub Stars
48
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubWarnSocketPassSnykFail
Installed on
codex74
gemini-cli74
opencode74
github-copilot71
cursor65
kimi-cli63
autonomous-skill:Claude Code 多会话任务自动执行工具 - 支持结构化与轻量级模式
145 周安装
主题工厂技能:一键应用专业字体颜色主题,提升演示文稿设计效率
146 周安装
Clawdbot 文档专家技能:一站式导航、搜索与配置指南
145 周安装
GSAP动画开发指南:JavaScript网页动画性能优化与ScrollTrigger实战
147 周安装
专利权利要求分析器 - 自动检查USPTO 35 USC 112(b)合规性,提升专利撰写质量
146 周安装
Web3前端开发指南:钱包集成、交易管理与React Hooks实战
147 周安装