mcpField
C
cloudinary-upload

cloudinary-upload

github.com/mnhkahnCloud & DevOps096 installsUpdated 3d ago
Repository

About cloudinary-upload

cloudinary-upload provides scripts for uploading files to Cloudinary with the official `cld` CLI. It supports individual files and flat directory uploads, converting images to WebP by default while leaving other files unchanged.

Key features

  1. 01Uploads files through `cld`
  2. 02Uploads directories into one folder
  3. 03Converts images to WebP by default
  4. 04Can retain original image formats
  5. 05Overwrites matching public IDs

Use cases

  1. 01Uploading images to a Cloudinary folder
  2. 02Uploading a directory of blog images
  3. 03Keeping original formats during upload

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/mnhkahn/cyeam-cli --skill cloudinary-upload

After installing, type/cloudinary-uploadin Claude Code to confirm it loaded.

Bundled filesscripts/upload-dir.shscripts/upload.sh

Details

From the project README

Cloudinary Upload (official CLI)

Replicates the /admin/upload flow (see controllers/admin_controller.go + util/file_util.go) using the official Cloudinary CLI (cld). Images are converted to webp on storage and uploaded into a target folder (flat, structure not preserved).

Prerequisites

  1. Official CLI (cld) is installed automatically on first use if missing (via pip3 install --user cloudinary-cli).
  2. Credentials via CLOUDINARY_URL (do NOT hardcode secrets):
    export CLOUDINARY_URL=cloudinary://<api_key>:<api_secret>@<cloud_name>
    
    For this project the cloud name is cyeam. Get the key/secret from the constants in controllers/admin_controller.go or ask the user, then export the URL above before running. Verify with: cld config (should show the cyeam cloud).

Upload single / multiple files

bash .agents/skills/cloudinary-upload/scripts/upload.sh -f uploads file1.png file2.jpg
  • -f FOLDER — target Cloudinary asset folder (default: uploads)
  • -r — keep original format (skip webp conversion)

Each file is uploaded with public_id = filename without extension, overwrite=True (same as the existing backend). Images get format=webp; non-images are left as-is.

Upload a directory (flat)

bash .agents/skills/cloudinary-upload/scripts/upload-dir.sh -f blog-images ./my-images

Uploads every top-level file in the directory into the one target folder. Folder structure is NOT preserved (per project preference for a flat target). Add -r to skip webp conversion.

What the scripts do

BehaviorHow
webp conversionformat=webp upload param on images
target folderfolder=<FOLDER>
overwriteoverwrite=True (matches existing /admin/upload)
public_idfilename without extension
non-image filesuploaded unchanged

The underlying command is:

cld uploader upload <path> public_id=<name> asset_folder=<folder> overwrite=True format=webp

Common mistakes

  • Missing CLOUDINARY_URL → scripts exit with an error. Export it first.
  • Preserving directory structure → use cld upload_dir <dir> -f <folder> directly instead; these scripts intentionally flatten.
  • Converting non-images → webp conversion only applies to image extensions; other files upload untouched.

Comments

Markdown supported