跳到主内容
智客 ZICQ

技能库 智客分类:运维与云 mcloud-local

Mcloud Local

执行"雾"本地建筑,以复制"云"在当地机器上所建. 当调试一个未推进到履带分支的构建失败部署时使用,在构建固定上行走,或者在本地测试构建可变变化. 需要多克,必须运行在项目中的Git Repo.

1046 安装量

官方网址:skills.sh

技能介绍

先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。

做什么

执行微云本地建筑,以复制本地机器上的云

何时用

调试一个构建失败的部署而不向跟踪分支推进,在构建固定上行走,或测试构建可变的本地变化. 需要 Docker 且必须运行在工程的 Git Repo

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:Cloud CLI: Local Command、Constraints、Command、local build、Reproduce a Build Failure、Identify the failing deployment and the commit it built。 其中含规范建议的小节:输入输出示例。

文件分析

文件分析:这是一份仅含 SKILL.md 的指令型技能,代理激活后整份正文进入上下文。

官方 description(原文)

Execute mcloud local build to reproduce a Cloud build on the local machine. Use when debugging a build-failed deployment without pushing to the tracked branch, iterating on a build fix, or testing build-variable changes locally. Requires Docker and must run inside the project's Git repo.

Cloud CLI: Local CommandConstraintsCommandlocal buildReproduce a Build FailureIdentify the failing deployment and the commit it builtExamplesReproduce the backend build for the active contextReproduce the storefront buildTest a build-variable fix without editing codeBuild against a local .env fileReuse the Docker cache for a faster rebuild

· allowed-tools:Bash(mcloud local*), Bash(mcloud deployments*), Bash(mcloud use*), Bash(git*), Bash(jq*)

来源分类:skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
name
mcloud-local
description
Execute mcloud local build to reproduce a Cloud build on the local machine. Use when debugging a build-failed deployment without pushing to the tracked branch, iterating on a build fix, or testing build-variable changes locally. Requires Docker and must run inside the project's Git repo.
allowed-tools
Bash(mcloud local*), Bash(mcloud deployments*), Bash(mcloud use*), Bash(git*), Bash(jq*)实验字段,支持情况取决于客户端;字段声明本身不会授予工具权限。
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。

具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗

安装这个技能

Skills CLI ↗

先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。

交给 Agent 安装

复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。

把 Agent Skill「mcloud-local」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-a48fb34e24ed559f-Mcloud-Local.html
请存为 .cursor/skills/mcloud-local/SKILL.md 或 .claude/skills/mcloud-local/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。

GitHub 完整包 ↗

终端安装 · Skills CLI

需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。

npx skills add 'https://github.com/medusajs/medusa-agent-skills' --list

npx skills add 'https://github.com/medusajs/medusa-agent-skills' --skill 'mcloud-local'

CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。

阅读排版
--- name: mcloud-local description: Execute mcloud local build to reproduce a Cloud build on the local machine. Use when debugging a build-failed deployment without pushing to the tracked branch, iterating on a build fix, or testing build-variable changes locally. Requires Docker and must run inside the project's Git repo. allowed-tools: Bash(mcloud local*), Bash(mcloud deployments*), Bash(mcloud use*), Bash(git*), Bash(jq*) --- # Cloud CLI: Local Command Execute `mcloud local build` to run a Cloud build on the local machine, mirroring how Cloud builds the project. Use it to debug `build-failed` deployments without pushing changes and waiting for a full Cloud build. ## Constraints - **No `--json` flag.** `local build` streams plaintext build output and signals the result through its **exit code** (`0` = success). Do not parse its output as JSON. - **Requires Docker installed and running**, and must run from **inside the project's Git repository**. - Reproduces `build-failed` (build) failures only — not `deployment-failed` (runtime) failures. For runtime failures, use `mcloud logs --deployment `. - Available since mcloud CLI v0.1.10. - The Docker build cache is **disabled by default** so variable changes always invalidate the cache; pass `--docker-cache` to enable it. ## Command ### local build Run a Cloud build locally. Infers the root path and build variables from the linked Cloud project and environment. Builds the backend by default; pass `--type storefront` for the storefront. ```bash mcloud local build \ --organization \ --project \ --environment ``` **Options:** - `-o/--organization ` — Organization ID (falls back to active context) - `-p/--project ` — Project ID or handle (falls back to active context) - `-e/--environment ` — Environment whose variables are used (falls back to active context) - `-t/--type ` — Build type (default: `backend`) - `--root-path ` — Backend root path relative to the repo root (inferred if omitted; `.` if no Cloud project found) - `--storefront-path ` — Storefront path relative to the repo root, for `--type storefront` (inferred if omitted) - `--env-file ` — Use a local `.env` file instead of the Cloud environment's variables - `-v/--var ` — Override a single build variable; repeatable - `--docker-cache` — Enable the Docker build cache (default: `false`) **Output:** - On success (exit `0`), the backend image is tagged `:cloud-local-build-`; a storefront build writes its output directory and prints the path. - On failure (non-zero exit), the command exits with the failing step's error — debug it as you would a Cloud build. ## Reproduce a Build Failure Check out the same commit the failed deployment built so the local build matches, then route on the exit code: ```bash # Identify the failing deployment and the commit it built DEPLOYMENT_ID=$( mcloud deployments list --json \ | jq -r '[.[] | select(.backend_status == "build-failed")][0].id' ) COMMIT=$(mcloud deployments get "$DEPLOYMENT_ID" --json | jq -r '.commit_hash') git checkout "$COMMIT" if mcloud local build; then echo "Build succeeded locally; failure not reproducible from this commit." else echo "Build failed locally; inspect the streamed output for the failing step." fi ``` Once the local build exits `0`, push the fix to the tracked branch and start a fresh Cloud build with `mcloud environments trigger-build `. ## Examples ```bash # Reproduce the backend build for the active context mcloud local build # Reproduce the storefront build mcloud local build --type storefront --storefront-path apps/storefront # Test a build-variable fix without editing code mcloud local build --var NODE_ENV=production # Build against a local .env file mcloud local build --env-file .env # Reuse the Docker cache for a faster rebuild mcloud local build --docker-cache ```

相关技能

运维与云

Docker Essentials

用于容器管理,图像操作,调试的基本道克命令和工作流程.

运维与云

Find Skills

从开放的代理技能生态系统中发现并安装技能. 使用时:(1)用户问"我如何做X",X可能拥有现有技能,(2)用户说"为X找到技能"或"是否为X有技能",(3)用户问"你能否做X",X是专门能力,(4)用户想扩展代理能力,(5)用户想搜索工具,模板,或工作流程,(6)用户提到他们希望…

运维与云

Microsoft Foundry

构建,部署,评价,优化,微调,管理微软创始代理,模型,资源最终结束. 用法:铸造、azd ai代理、azd 提供/部署、托管代理脚手架/开发/运行/部署/拖放、即时代理创建、创建代理、更新代理、添加代理工具、援引代理、代理.yaml、评估代理、批量活化、连续活化、持续监测、代理C…

运维与云

Azure Deploy

执行已有.azure/部署计划.md和基础设施文件的ALREADY-PREPARED应用程序的Azure部署。 当用户向 CREATE 请求新应用程序时, 请不要使用此技能 。 这种技能运行了 azd上行, azd 部署, trarraform 应用, 和 az 部署命令带有内置…