
Cldsh Cloudinary Shell
io.github.Sheldon1999由 GitHub 账号 Sheldon1999 发布v2.0.1更新于 Oct 29, 2026
Unix-style shell, scriptable CLI and MCP server for Cloudinary asset management.
概览
集 MCP 服务器、Shell 与 CLI 于一体,让助手像操作文件系统一样浏览、上传、移动、下载和删除 Cloudinary 账户中的资源。
- 可以做什么
- 列出文件夹与资源、显示文件夹树、读取资源完整元数据
- 生成交付 URL,可选带转换参数或签名
- 上传本地文件或目录,并把资源下载到本地磁盘
- 移动、重命名、新建和删除资源或文件夹,带预览与确认令牌
- 查看账户的云名称、文件夹模式、凭据来源与剩余 API 配额
- 适用场景
- 适合让助手管理已有 Cloudinary 账户中的媒体资源,例如查看目录、生成 CDN 链接、上传构建产物或清理旧资源,且无需托管服务或 OAuth 流程。
- 运行要求
- 需要 Node.js 20 或更高版本,通过 npx 以 stdio 在本地运行。需要 Cloudinary 账户的云名称、API key 与 API secret,可通过 CLOUDINARY_URL 或各个 CLOUDINARY_* 环境变量、当前目录的 .env 文件,或用 login 保存的配置提供。需能访问 Cloudinary Admin API,该接口按小时限流。
安装
在 SourceWeft 中
- 打开 控制台中的 Cldsh Cloudinary Shell,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
Cloudinary Shell (cldsh)
MCP server, interactive shell and scriptable CLI for Cloudinary
[npm version] [License: MIT] [MCP Protocol]
cldsh lets you work with a Cloudinary account like a file system:
- AI agents (Claude Desktop, Claude Code, Cursor) get Cloudinary tools through the Model Context Protocol (MCP), with previews and confirmation before anything is deleted or replaced.
- Developers get an interactive shell with folders, tab completion, history and inline image previews.
- Scripts and CI get single commands with JSON output and meaningful exit codes.
It works with both Cloudinary folder modes: dynamic folders (every account created since June 2024) and the older fixed folders. The mode is detected automatically.
Working on a project that uses Cloudinary? Give
INTEGRATION.mdto your AI agent or team: integration patterns (Next.js, React, Node.js, Python), transformation recipes andcldshworkflows.
How cldsh compares
Cloudinary also publishes an official CLI (cloudinary-cli, Python) and official MCP packages (@cloudinary/*). cldsh is a separate, independent project built for a different workflow: one Node binary that is a shell, a scriptable CLI and an MCP server together, authenticated with your existing API key — no Python runtime, no OAuth browser flow, no hosted service required.
Pick cldsh for one local tool, API-key auth and a safety net on AI-driven changes. Pick the official packages for Cloudinary-maintained, domain-split MCP servers with OAuth and enterprise support.
Quick start
Requires Node.js 20 or newer and a Cloudinary account (cloud name, API key and API secret, or a CLOUDINARY_URL).
Install globally to get the shorter cldsh command: npm install -g cloudinary-shell.
MCP server (for AI agents)
cldsh --mcp runs an MCP server over stdio (JSON-RPC 2.0). It supports protocol versions 2025-06-18, 2025-03-26 and 2024-11-05.
Client setup
Claude Desktop (claude_desktop_config.json):
Claude Code: claude mcp add cloudinary npx -y cloudinary-shell --mcp
Cursor: Settings → MCP → Add new MCP server, type command, command npx -y cloudinary-shell --mcp.
Check the setup with cldsh mcp: it runs the handshake, lists the tools and makes a live call on your account.
Tools
Every tool carries MCP annotations (read-only, destructive, idempotent), so clients can decide when to ask you.
Safety
- Two-step changes.
cloudinary_delete,cloudinary_move,cloudinary_rename_folder, and uploads that would replace existing assets first return a preview with aconfirm_token. Nothing changes until the agent calls again with the same arguments and that token. Tokens are single-use, expire after 5 minutes and stop working if the account changes.dry_run: trueonly previews. - Local files. Uploads and downloads can only reach the folder the server was started in, the folders your MCP client shares as roots, and folders added with
--allow-path. The cldsh credentials folder,~/.sshand hidden files (unless named explicitly) are always refused. Downloads never overwrite a local file unlessoverwrite: true. - Server options:
--read-only: only the read-only tools (list, tree, info, get_url, account).--allow-path <dir>: allow another local folder (repeatable).--no-confirm: run changes in one call, as in cldsh 1.x. Use only for trusted automation.
Command line (for scripts and CI)
Run any command directly: cldsh <command> [arguments] [options].
- Results go to stdout; progress, warnings and errors go to stderr.
--jsonprints machine-readable JSON on stdout (errors are printed as JSON on stderr).- Exit codes:
0success,1error,2wrong usage,3partly failed (for example 2 of 50 uploads failed),4needs confirmation (add--yes) or was cancelled. --profile <name>uses a saved profile for one command.
Quote wildcards. Your shell expands an unquoted
cld*into local file names beforecldshsees it. Writecldsh rm 'cld*'. If every name given tormexists in the local directory,cldshrefuses and reminds you.
Interactive shell
Run cldsh with no arguments.
- The prompt shows the account (and profile) and the current folder.
- Tab completes commands, options, folder paths (
cd apps/<Tab>) and asset names. - History is kept across sessions in
~/.cldsh_history(private file; lines with credentials are never saved). - Paths are relative to the current folder;
/or~is the root,..goes up,cd -goes back. helplists all commands;help <command>lists all options of one command.
Commands
Options shared by many commands:
Assets can be named by their name in the current folder, by path (products/hero), by public ID, or as asset_id:<id>. If a name matches several assets (for example an image and a video called intro), cldsh lists them; add --rt or use the public ID.
Uploading
- The resource type comes from the file extension: images (including PDF and SVG) → image, video and audio → video, everything else → raw.
--rtoverrides it. - Images and videos get a public ID without extension; raw files keep it (
notes.txt). -rincludes subdirectories as subfolders. Dotfiles are skipped.- Existing assets are overwritten and reported as
overwritten;--no-overwritekeeps them (skipped). - When two files would get the same public ID (
photo.jpg,photo.png), both get their extension as suffix (photo_jpg,photo_png). - Files over 20 MB are uploaded in chunks with progress; temporary failures are retried.
--dry-runshows the planned public IDs and works without credentials.
Deleting
rm -rdeletes everything in the folder and its subfolders (all resource and delivery types), then the folder.- Recursive deletes, wildcard deletes and deletes of more than 20 assets show the plan and ask first. Emptying the whole account asks you to type the cloud name.
-yskips the question; scripts need--yes. - Every asset is reported as
deleted,not foundorfailed, and the exit code is3if anything was not found or failed. --skip-backupdeletes folders that still hold backups of deleted assets.
Moving and renaming
- Dynamic folder mode: moving and renaming keep the delivery URL (the folder and display name change).
--public-idalso renames the public ID, which changes the URL. Folders can be moved and renamed:mv products catalog/products. - Fixed folder mode: the folder is part of the public ID, so moving or renaming changes the URL. Cloudinary can't move folders in this mode.
- An existing target stops the move;
-ogoes ahead. In dynamic mode,-oonly replaces an asset with the same public ID; an asset that merely has the same name is kept. --dry-runshows whether the URL will change.
URLs, previews and downloads
- Unsigned URLs without
--tare exactly the asset'ssecure_url. viewprints the preview URL when the terminal can't show images.downloadskips local files that already exist unless-f; private and authenticated assets download through signed URLs.
Accounts and credentials
Profiles are stored in ~/.config/cldsh/credentials.json (%APPDATA%\cldsh on Windows) with owner-only permissions. Writes are atomic, and a damaged file is never overwritten (login --reset moves it aside).
When several sources are present, the strongest wins:
--profile <name>,config use/loginin the current shell, orCLOUDINARY_PROFILECLOUDINARY_URL(orCLOUDINARY_CLOUD_NAME,CLOUDINARY_API_KEY,CLOUDINARY_API_SECRET) in the environment- A
.envfile in the current directory - The saved default profile
cldsh warns at startup, and config shows, when a source is overridden. CLOUDINARY_URL options such as ?upload_prefix=https://api-eu.cloudinary.com (EU/AP data centers) and private CDN settings are supported.
Folder modes and API limits
cldshdetects the folder mode of your account. Override it with--folder-mode=fixed|dynamicorCLDSH_FOLDER_MODE.- Listing folders and assets uses Cloudinary's Admin API, which is rate-limited per hour (500 requests on the Free plan).
cldshcaches listings for a few seconds, warns when less than 10% of the hourly budget is left, andquotashows the remaining requests. Uploads and delivery URLs don't count. - In fixed folder mode, listing a folder also pages through its subfolders' assets, so very large folders cost more requests.
Troubleshooting
License
MIT. See CHANGELOG.md for changes between versions.
来源:README.md,提交 2fe2579
工具
0版本历史
1- v2.0.1最新Oct 29, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分