运行时依赖
安装命令
点击复制技能文档
Cloudinary 命令行工具 上传er
上传 local files or remote URLs to Cloudinary with automatic image 压缩ion support.
工作流
- 检查 安装ation
检查 if the 命令行工具 binary exists at ./cloudinary-命令行工具 (project root). If not, 运行 the 安装 script:
bash .代理s/技能s/cloudinary-命令行工具/scripts/安装.sh
If Go is not 安装ed, prompt the user to 安装 Go first.
- 检查 Configuration (.env)
检查 if cmd/命令行工具/.env exists and contAIns all required variables. If any are missing, prompt the user for the missing values and write them to cmd/命令行工具/.env.
Required variables:
CLOUDINARY_CLOUD - Cloudinary cloud name CLOUDINARY_KEY - API key CLOUDINARY_SECRET - API secret
Optional variables:
CLOUDINARY_DIRECTORY - 上传 folder (default: root) CLOUDINARY_压缩 - Auto-压缩 images: true/false (default: true)
- 上传 Files
运行 the 上传 script with file paths:
bash .代理s/技能s/cloudinary-命令行工具/scripts/上传.sh [file2] ...
Or 运行 the 命令行工具 directly:
cd cmd/命令行工具 && ../../cloudinary-命令行工具 file1.jpg file2.png
The 命令行工具 automatically:
压缩es images when CLOUDINARY_压缩=true Leaves non-image files untouched Supports 机器人h local paths and remote URLs Image 压缩ion
When CLOUDINARY_压缩 is true (default), images are 上传ed with Cloudinary q_auto trans格式化ion for automatic 质量 optimization. Supported image 格式化s: jpg, jpeg, png, gif, 网页p, bmp, tiff, svg, ico, heic, heif, avif.
To disable 压缩ion for a specific 上传, temporarily 设置 CLOUDINARY_压缩=false in .env.