[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-medusa-mcloud-local":3,"mdc--dfvpzz-key":40,"related-org-medusa-mcloud-local":1094,"related-repo-medusa-mcloud-local":1248},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":12,"stars":24,"repoUrl":25,"updatedAt":26,"license":27,"forks":28,"topics":29,"repo":35,"sourceUrl":38,"mdContent":39},"mcloud-local","reproduce Cloud builds locally","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.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},"medusa","Medusa","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fmedusa.jpg","medusajs",[13,15,18,21],{"name":9,"slug":8,"type":14},"tag",{"name":16,"slug":17,"type":14},"Deployment","deployment",{"name":19,"slug":20,"type":14},"Engineering","engineering",{"name":22,"slug":23,"type":14},"Debugging","debugging",197,"https:\u002F\u002Fgithub.com\u002Fmedusajs\u002Fmedusa-agent-skills","2026-07-17T06:05:07.199529",null,24,[30,31,32,33,34,8],"agentic-commerce","claude","claude-code","commerce","ecommerce",{"repoUrl":25,"stars":24,"forks":28,"topics":36,"description":37},[30,31,32,33,34,8],"Agent skills and commands for Medusa best practices and conventions.","https:\u002F\u002Fgithub.com\u002Fmedusajs\u002Fmedusa-agent-skills\u002Ftree\u002FHEAD\u002Fplugins\u002Fmedusa-cloud\u002Fskills\u002Fmcloud-local","---\nname: mcloud-local\ndescription: 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.\nallowed-tools: Bash(mcloud local*), Bash(mcloud deployments*), Bash(mcloud use*), Bash(git*), Bash(jq*)\n---\n\n# Cloud CLI: Local Command\n\nExecute `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.\n\n## Constraints\n\n- **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.\n- **Requires Docker installed and running**, and must run from **inside the project's Git repository**.\n- Reproduces `build-failed` (build) failures only — not `deployment-failed` (runtime) failures. For runtime failures, use `mcloud logs --deployment \u003Cid>`.\n- Available since mcloud CLI v0.1.10.\n- The Docker build cache is **disabled by default** so variable changes always invalidate the cache; pass `--docker-cache` to enable it.\n\n## Command\n\n### local build\n\nRun 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.\n\n```bash\nmcloud local build \\\n  --organization \u003Corg-id> \\\n  --project \u003Cproject-id-or-handle> \\\n  --environment \u003Cenvironment-handle>\n```\n\n**Options:**\n- `-o\u002F--organization \u003Cid>` — Organization ID (falls back to active context)\n- `-p\u002F--project \u003Cid-or-handle>` — Project ID or handle (falls back to active context)\n- `-e\u002F--environment \u003Chandle>` — Environment whose variables are used (falls back to active context)\n- `-t\u002F--type \u003Cbackend|storefront>` — Build type (default: `backend`)\n- `--root-path \u003Cpath>` — Backend root path relative to the repo root (inferred if omitted; `.` if no Cloud project found)\n- `--storefront-path \u003Cpath>` — Storefront path relative to the repo root, for `--type storefront` (inferred if omitted)\n- `--env-file \u003Cpath>` — Use a local `.env` file instead of the Cloud environment's variables\n- `-v\u002F--var \u003CKEY=VALUE>` — Override a single build variable; repeatable\n- `--docker-cache` — Enable the Docker build cache (default: `false`)\n\n**Output:**\n- On success (exit `0`), the backend image is tagged `\u003Crepository-name>:cloud-local-build-\u003Ccommit-hash>`; a storefront build writes its output directory and prints the path.\n- On failure (non-zero exit), the command exits with the failing step's error — debug it as you would a Cloud build.\n\n## Reproduce a Build Failure\n\nCheck out the same commit the failed deployment built so the local build matches, then route on the exit code:\n\n```bash\n# Identify the failing deployment and the commit it built\nDEPLOYMENT_ID=$(\n  mcloud deployments list --json \\\n    | jq -r '[.[] | select(.backend_status == \"build-failed\")][0].id'\n)\nCOMMIT=$(mcloud deployments get \"$DEPLOYMENT_ID\" --json | jq -r '.commit_hash')\n\ngit checkout \"$COMMIT\"\n\nif mcloud local build; then\n  echo \"Build succeeded locally; failure not reproducible from this commit.\"\nelse\n  echo \"Build failed locally; inspect the streamed output for the failing step.\"\nfi\n```\n\nOnce the local build exits `0`, push the fix to the tracked branch and start a fresh Cloud build with `mcloud environments trigger-build \u003Cenv>`.\n\n## Examples\n\n```bash\n# Reproduce the backend build for the active context\nmcloud local build\n\n# Reproduce the storefront build\nmcloud local build --type storefront --storefront-path apps\u002Fstorefront\n\n# Test a build-variable fix without editing code\nmcloud local build --var NODE_ENV=production\n\n# Build against a local .env file\nmcloud local build --env-file .env\n\n# Reuse the Docker cache for a faster rebuild\nmcloud local build --docker-cache\n```\n",{"data":41,"body":43},{"name":4,"description":6,"allowed-tools":42},"Bash(mcloud local*), Bash(mcloud deployments*), Bash(mcloud use*), Bash(git*), Bash(jq*)",{"type":44,"children":45},"root",[46,55,78,85,201,207,213,226,358,366,504,512,540,546,551,867,886,892,1088],{"type":47,"tag":48,"props":49,"children":51},"element","h1",{"id":50},"cloud-cli-local-command",[52],{"type":53,"value":54},"text","Cloud CLI: Local Command",{"type":47,"tag":56,"props":57,"children":58},"p",{},[59,61,68,70,76],{"type":53,"value":60},"Execute ",{"type":47,"tag":62,"props":63,"children":65},"code",{"className":64},[],[66],{"type":53,"value":67},"mcloud local build",{"type":53,"value":69}," to run a Cloud build on the local machine, mirroring how Cloud builds the project. Use it to debug ",{"type":47,"tag":62,"props":71,"children":73},{"className":72},[],[74],{"type":53,"value":75},"build-failed",{"type":53,"value":77}," deployments without pushing changes and waiting for a full Cloud build.",{"type":47,"tag":79,"props":80,"children":82},"h2",{"id":81},"constraints",[83],{"type":53,"value":84},"Constraints",{"type":47,"tag":86,"props":87,"children":88},"ul",{},[89,132,149,176,181],{"type":47,"tag":90,"props":91,"children":92},"li",{},[93,107,109,115,117,122,124,130],{"type":47,"tag":94,"props":95,"children":96},"strong",{},[97,99,105],{"type":53,"value":98},"No ",{"type":47,"tag":62,"props":100,"children":102},{"className":101},[],[103],{"type":53,"value":104},"--json",{"type":53,"value":106}," flag.",{"type":53,"value":108}," ",{"type":47,"tag":62,"props":110,"children":112},{"className":111},[],[113],{"type":53,"value":114},"local build",{"type":53,"value":116}," streams plaintext build output and signals the result through its ",{"type":47,"tag":94,"props":118,"children":119},{},[120],{"type":53,"value":121},"exit code",{"type":53,"value":123}," (",{"type":47,"tag":62,"props":125,"children":127},{"className":126},[],[128],{"type":53,"value":129},"0",{"type":53,"value":131}," = success). Do not parse its output as JSON.",{"type":47,"tag":90,"props":133,"children":134},{},[135,140,142,147],{"type":47,"tag":94,"props":136,"children":137},{},[138],{"type":53,"value":139},"Requires Docker installed and running",{"type":53,"value":141},", and must run from ",{"type":47,"tag":94,"props":143,"children":144},{},[145],{"type":53,"value":146},"inside the project's Git repository",{"type":53,"value":148},".",{"type":47,"tag":90,"props":150,"children":151},{},[152,154,159,161,167,169,175],{"type":53,"value":153},"Reproduces ",{"type":47,"tag":62,"props":155,"children":157},{"className":156},[],[158],{"type":53,"value":75},{"type":53,"value":160}," (build) failures only — not ",{"type":47,"tag":62,"props":162,"children":164},{"className":163},[],[165],{"type":53,"value":166},"deployment-failed",{"type":53,"value":168}," (runtime) failures. For runtime failures, use ",{"type":47,"tag":62,"props":170,"children":172},{"className":171},[],[173],{"type":53,"value":174},"mcloud logs --deployment \u003Cid>",{"type":53,"value":148},{"type":47,"tag":90,"props":177,"children":178},{},[179],{"type":53,"value":180},"Available since mcloud CLI v0.1.10.",{"type":47,"tag":90,"props":182,"children":183},{},[184,186,191,193,199],{"type":53,"value":185},"The Docker build cache is ",{"type":47,"tag":94,"props":187,"children":188},{},[189],{"type":53,"value":190},"disabled by default",{"type":53,"value":192}," so variable changes always invalidate the cache; pass ",{"type":47,"tag":62,"props":194,"children":196},{"className":195},[],[197],{"type":53,"value":198},"--docker-cache",{"type":53,"value":200}," to enable it.",{"type":47,"tag":79,"props":202,"children":204},{"id":203},"command",[205],{"type":53,"value":206},"Command",{"type":47,"tag":208,"props":209,"children":211},"h3",{"id":210},"local-build",[212],{"type":53,"value":114},{"type":47,"tag":56,"props":214,"children":215},{},[216,218,224],{"type":53,"value":217},"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":47,"tag":62,"props":219,"children":221},{"className":220},[],[222],{"type":53,"value":223},"--type storefront",{"type":53,"value":225}," for the storefront.",{"type":47,"tag":227,"props":228,"children":233},"pre",{"className":229,"code":230,"language":231,"meta":232,"style":232},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","mcloud local build \\\n  --organization \u003Corg-id> \\\n  --project \u003Cproject-id-or-handle> \\\n  --environment \u003Cenvironment-handle>\n","bash","",[234],{"type":47,"tag":62,"props":235,"children":236},{"__ignoreMap":232},[237,266,300,331],{"type":47,"tag":238,"props":239,"children":242},"span",{"class":240,"line":241},"line",1,[243,249,255,260],{"type":47,"tag":238,"props":244,"children":246},{"style":245},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[247],{"type":53,"value":248},"mcloud",{"type":47,"tag":238,"props":250,"children":252},{"style":251},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[253],{"type":53,"value":254}," local",{"type":47,"tag":238,"props":256,"children":257},{"style":251},[258],{"type":53,"value":259}," build",{"type":47,"tag":238,"props":261,"children":263},{"style":262},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[264],{"type":53,"value":265}," \\\n",{"type":47,"tag":238,"props":267,"children":269},{"class":240,"line":268},2,[270,275,281,286,291,296],{"type":47,"tag":238,"props":271,"children":272},{"style":251},[273],{"type":53,"value":274},"  --organization",{"type":47,"tag":238,"props":276,"children":278},{"style":277},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[279],{"type":53,"value":280}," \u003C",{"type":47,"tag":238,"props":282,"children":283},{"style":251},[284],{"type":53,"value":285},"org-i",{"type":47,"tag":238,"props":287,"children":288},{"style":262},[289],{"type":53,"value":290},"d",{"type":47,"tag":238,"props":292,"children":293},{"style":277},[294],{"type":53,"value":295},">",{"type":47,"tag":238,"props":297,"children":298},{"style":262},[299],{"type":53,"value":265},{"type":47,"tag":238,"props":301,"children":303},{"class":240,"line":302},3,[304,309,313,318,323,327],{"type":47,"tag":238,"props":305,"children":306},{"style":251},[307],{"type":53,"value":308},"  --project",{"type":47,"tag":238,"props":310,"children":311},{"style":277},[312],{"type":53,"value":280},{"type":47,"tag":238,"props":314,"children":315},{"style":251},[316],{"type":53,"value":317},"project-id-or-handl",{"type":47,"tag":238,"props":319,"children":320},{"style":262},[321],{"type":53,"value":322},"e",{"type":47,"tag":238,"props":324,"children":325},{"style":277},[326],{"type":53,"value":295},{"type":47,"tag":238,"props":328,"children":329},{"style":262},[330],{"type":53,"value":265},{"type":47,"tag":238,"props":332,"children":334},{"class":240,"line":333},4,[335,340,344,349,353],{"type":47,"tag":238,"props":336,"children":337},{"style":251},[338],{"type":53,"value":339},"  --environment",{"type":47,"tag":238,"props":341,"children":342},{"style":277},[343],{"type":53,"value":280},{"type":47,"tag":238,"props":345,"children":346},{"style":251},[347],{"type":53,"value":348},"environment-handl",{"type":47,"tag":238,"props":350,"children":351},{"style":262},[352],{"type":53,"value":322},{"type":47,"tag":238,"props":354,"children":355},{"style":277},[356],{"type":53,"value":357},">\n",{"type":47,"tag":56,"props":359,"children":360},{},[361],{"type":47,"tag":94,"props":362,"children":363},{},[364],{"type":53,"value":365},"Options:",{"type":47,"tag":86,"props":367,"children":368},{},[369,380,391,402,421,439,457,476,487],{"type":47,"tag":90,"props":370,"children":371},{},[372,378],{"type":47,"tag":62,"props":373,"children":375},{"className":374},[],[376],{"type":53,"value":377},"-o\u002F--organization \u003Cid>",{"type":53,"value":379}," — Organization ID (falls back to active context)",{"type":47,"tag":90,"props":381,"children":382},{},[383,389],{"type":47,"tag":62,"props":384,"children":386},{"className":385},[],[387],{"type":53,"value":388},"-p\u002F--project \u003Cid-or-handle>",{"type":53,"value":390}," — Project ID or handle (falls back to active context)",{"type":47,"tag":90,"props":392,"children":393},{},[394,400],{"type":47,"tag":62,"props":395,"children":397},{"className":396},[],[398],{"type":53,"value":399},"-e\u002F--environment \u003Chandle>",{"type":53,"value":401}," — Environment whose variables are used (falls back to active context)",{"type":47,"tag":90,"props":403,"children":404},{},[405,411,413,419],{"type":47,"tag":62,"props":406,"children":408},{"className":407},[],[409],{"type":53,"value":410},"-t\u002F--type \u003Cbackend|storefront>",{"type":53,"value":412}," — Build type (default: ",{"type":47,"tag":62,"props":414,"children":416},{"className":415},[],[417],{"type":53,"value":418},"backend",{"type":53,"value":420},")",{"type":47,"tag":90,"props":422,"children":423},{},[424,430,432,437],{"type":47,"tag":62,"props":425,"children":427},{"className":426},[],[428],{"type":53,"value":429},"--root-path \u003Cpath>",{"type":53,"value":431}," — Backend root path relative to the repo root (inferred if omitted; ",{"type":47,"tag":62,"props":433,"children":435},{"className":434},[],[436],{"type":53,"value":148},{"type":53,"value":438}," if no Cloud project found)",{"type":47,"tag":90,"props":440,"children":441},{},[442,448,450,455],{"type":47,"tag":62,"props":443,"children":445},{"className":444},[],[446],{"type":53,"value":447},"--storefront-path \u003Cpath>",{"type":53,"value":449}," — Storefront path relative to the repo root, for ",{"type":47,"tag":62,"props":451,"children":453},{"className":452},[],[454],{"type":53,"value":223},{"type":53,"value":456}," (inferred if omitted)",{"type":47,"tag":90,"props":458,"children":459},{},[460,466,468,474],{"type":47,"tag":62,"props":461,"children":463},{"className":462},[],[464],{"type":53,"value":465},"--env-file \u003Cpath>",{"type":53,"value":467}," — Use a local ",{"type":47,"tag":62,"props":469,"children":471},{"className":470},[],[472],{"type":53,"value":473},".env",{"type":53,"value":475}," file instead of the Cloud environment's variables",{"type":47,"tag":90,"props":477,"children":478},{},[479,485],{"type":47,"tag":62,"props":480,"children":482},{"className":481},[],[483],{"type":53,"value":484},"-v\u002F--var \u003CKEY=VALUE>",{"type":53,"value":486}," — Override a single build variable; repeatable",{"type":47,"tag":90,"props":488,"children":489},{},[490,495,497,503],{"type":47,"tag":62,"props":491,"children":493},{"className":492},[],[494],{"type":53,"value":198},{"type":53,"value":496}," — Enable the Docker build cache (default: ",{"type":47,"tag":62,"props":498,"children":500},{"className":499},[],[501],{"type":53,"value":502},"false",{"type":53,"value":420},{"type":47,"tag":56,"props":505,"children":506},{},[507],{"type":47,"tag":94,"props":508,"children":509},{},[510],{"type":53,"value":511},"Output:",{"type":47,"tag":86,"props":513,"children":514},{},[515,535],{"type":47,"tag":90,"props":516,"children":517},{},[518,520,525,527,533],{"type":53,"value":519},"On success (exit ",{"type":47,"tag":62,"props":521,"children":523},{"className":522},[],[524],{"type":53,"value":129},{"type":53,"value":526},"), the backend image is tagged ",{"type":47,"tag":62,"props":528,"children":530},{"className":529},[],[531],{"type":53,"value":532},"\u003Crepository-name>:cloud-local-build-\u003Ccommit-hash>",{"type":53,"value":534},"; a storefront build writes its output directory and prints the path.",{"type":47,"tag":90,"props":536,"children":537},{},[538],{"type":53,"value":539},"On failure (non-zero exit), the command exits with the failing step's error — debug it as you would a Cloud build.",{"type":47,"tag":79,"props":541,"children":543},{"id":542},"reproduce-a-build-failure",[544],{"type":53,"value":545},"Reproduce a Build Failure",{"type":47,"tag":56,"props":547,"children":548},{},[549],{"type":53,"value":550},"Check out the same commit the failed deployment built so the local build matches, then route on the exit code:",{"type":47,"tag":227,"props":552,"children":554},{"className":229,"code":553,"language":231,"meta":232,"style":232},"# Identify the failing deployment and the commit it built\nDEPLOYMENT_ID=$(\n  mcloud deployments list --json \\\n    | jq -r '[.[] | select(.backend_status == \"build-failed\")][0].id'\n)\nCOMMIT=$(mcloud deployments get \"$DEPLOYMENT_ID\" --json | jq -r '.commit_hash')\n\ngit checkout \"$COMMIT\"\n\nif mcloud local build; then\n  echo \"Build succeeded locally; failure not reproducible from this commit.\"\nelse\n  echo \"Build failed locally; inspect the streamed output for the failing step.\"\nfi\n",[555],{"type":47,"tag":62,"props":556,"children":557},{"__ignoreMap":232},[558,567,580,607,640,649,726,736,764,772,805,828,837,858],{"type":47,"tag":238,"props":559,"children":560},{"class":240,"line":241},[561],{"type":47,"tag":238,"props":562,"children":564},{"style":563},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[565],{"type":53,"value":566},"# Identify the failing deployment and the commit it built\n",{"type":47,"tag":238,"props":568,"children":569},{"class":240,"line":268},[570,575],{"type":47,"tag":238,"props":571,"children":572},{"style":262},[573],{"type":53,"value":574},"DEPLOYMENT_ID",{"type":47,"tag":238,"props":576,"children":577},{"style":277},[578],{"type":53,"value":579},"=$(\n",{"type":47,"tag":238,"props":581,"children":582},{"class":240,"line":302},[583,588,593,598,603],{"type":47,"tag":238,"props":584,"children":585},{"style":245},[586],{"type":53,"value":587},"  mcloud",{"type":47,"tag":238,"props":589,"children":590},{"style":251},[591],{"type":53,"value":592}," deployments",{"type":47,"tag":238,"props":594,"children":595},{"style":251},[596],{"type":53,"value":597}," list",{"type":47,"tag":238,"props":599,"children":600},{"style":251},[601],{"type":53,"value":602}," --json",{"type":47,"tag":238,"props":604,"children":605},{"style":262},[606],{"type":53,"value":265},{"type":47,"tag":238,"props":608,"children":609},{"class":240,"line":333},[610,615,620,625,630,635],{"type":47,"tag":238,"props":611,"children":612},{"style":277},[613],{"type":53,"value":614},"    |",{"type":47,"tag":238,"props":616,"children":617},{"style":245},[618],{"type":53,"value":619}," jq",{"type":47,"tag":238,"props":621,"children":622},{"style":251},[623],{"type":53,"value":624}," -r",{"type":47,"tag":238,"props":626,"children":627},{"style":277},[628],{"type":53,"value":629}," '",{"type":47,"tag":238,"props":631,"children":632},{"style":251},[633],{"type":53,"value":634},"[.[] | select(.backend_status == \"build-failed\")][0].id",{"type":47,"tag":238,"props":636,"children":637},{"style":277},[638],{"type":53,"value":639},"'\n",{"type":47,"tag":238,"props":641,"children":643},{"class":240,"line":642},5,[644],{"type":47,"tag":238,"props":645,"children":646},{"style":277},[647],{"type":53,"value":648},")\n",{"type":47,"tag":238,"props":650,"children":652},{"class":240,"line":651},6,[653,658,663,667,671,676,681,686,691,695,700,704,708,712,717,722],{"type":47,"tag":238,"props":654,"children":655},{"style":262},[656],{"type":53,"value":657},"COMMIT",{"type":47,"tag":238,"props":659,"children":660},{"style":277},[661],{"type":53,"value":662},"=$(",{"type":47,"tag":238,"props":664,"children":665},{"style":245},[666],{"type":53,"value":248},{"type":47,"tag":238,"props":668,"children":669},{"style":251},[670],{"type":53,"value":592},{"type":47,"tag":238,"props":672,"children":673},{"style":251},[674],{"type":53,"value":675}," get",{"type":47,"tag":238,"props":677,"children":678},{"style":277},[679],{"type":53,"value":680}," \"",{"type":47,"tag":238,"props":682,"children":683},{"style":262},[684],{"type":53,"value":685},"$DEPLOYMENT_ID",{"type":47,"tag":238,"props":687,"children":688},{"style":277},[689],{"type":53,"value":690},"\"",{"type":47,"tag":238,"props":692,"children":693},{"style":251},[694],{"type":53,"value":602},{"type":47,"tag":238,"props":696,"children":697},{"style":277},[698],{"type":53,"value":699}," |",{"type":47,"tag":238,"props":701,"children":702},{"style":245},[703],{"type":53,"value":619},{"type":47,"tag":238,"props":705,"children":706},{"style":251},[707],{"type":53,"value":624},{"type":47,"tag":238,"props":709,"children":710},{"style":277},[711],{"type":53,"value":629},{"type":47,"tag":238,"props":713,"children":714},{"style":251},[715],{"type":53,"value":716},".commit_hash",{"type":47,"tag":238,"props":718,"children":719},{"style":277},[720],{"type":53,"value":721},"'",{"type":47,"tag":238,"props":723,"children":724},{"style":277},[725],{"type":53,"value":648},{"type":47,"tag":238,"props":727,"children":729},{"class":240,"line":728},7,[730],{"type":47,"tag":238,"props":731,"children":733},{"emptyLinePlaceholder":732},true,[734],{"type":53,"value":735},"\n",{"type":47,"tag":238,"props":737,"children":739},{"class":240,"line":738},8,[740,745,750,754,759],{"type":47,"tag":238,"props":741,"children":742},{"style":245},[743],{"type":53,"value":744},"git",{"type":47,"tag":238,"props":746,"children":747},{"style":251},[748],{"type":53,"value":749}," checkout",{"type":47,"tag":238,"props":751,"children":752},{"style":277},[753],{"type":53,"value":680},{"type":47,"tag":238,"props":755,"children":756},{"style":262},[757],{"type":53,"value":758},"$COMMIT",{"type":47,"tag":238,"props":760,"children":761},{"style":277},[762],{"type":53,"value":763},"\"\n",{"type":47,"tag":238,"props":765,"children":767},{"class":240,"line":766},9,[768],{"type":47,"tag":238,"props":769,"children":770},{"emptyLinePlaceholder":732},[771],{"type":53,"value":735},{"type":47,"tag":238,"props":773,"children":775},{"class":240,"line":774},10,[776,782,787,791,795,800],{"type":47,"tag":238,"props":777,"children":779},{"style":778},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[780],{"type":53,"value":781},"if",{"type":47,"tag":238,"props":783,"children":784},{"style":245},[785],{"type":53,"value":786}," mcloud",{"type":47,"tag":238,"props":788,"children":789},{"style":251},[790],{"type":53,"value":254},{"type":47,"tag":238,"props":792,"children":793},{"style":251},[794],{"type":53,"value":259},{"type":47,"tag":238,"props":796,"children":797},{"style":277},[798],{"type":53,"value":799},";",{"type":47,"tag":238,"props":801,"children":802},{"style":778},[803],{"type":53,"value":804}," then\n",{"type":47,"tag":238,"props":806,"children":808},{"class":240,"line":807},11,[809,815,819,824],{"type":47,"tag":238,"props":810,"children":812},{"style":811},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[813],{"type":53,"value":814},"  echo",{"type":47,"tag":238,"props":816,"children":817},{"style":277},[818],{"type":53,"value":680},{"type":47,"tag":238,"props":820,"children":821},{"style":251},[822],{"type":53,"value":823},"Build succeeded locally; failure not reproducible from this commit.",{"type":47,"tag":238,"props":825,"children":826},{"style":277},[827],{"type":53,"value":763},{"type":47,"tag":238,"props":829,"children":831},{"class":240,"line":830},12,[832],{"type":47,"tag":238,"props":833,"children":834},{"style":778},[835],{"type":53,"value":836},"else\n",{"type":47,"tag":238,"props":838,"children":840},{"class":240,"line":839},13,[841,845,849,854],{"type":47,"tag":238,"props":842,"children":843},{"style":811},[844],{"type":53,"value":814},{"type":47,"tag":238,"props":846,"children":847},{"style":277},[848],{"type":53,"value":680},{"type":47,"tag":238,"props":850,"children":851},{"style":251},[852],{"type":53,"value":853},"Build failed locally; inspect the streamed output for the failing step.",{"type":47,"tag":238,"props":855,"children":856},{"style":277},[857],{"type":53,"value":763},{"type":47,"tag":238,"props":859,"children":861},{"class":240,"line":860},14,[862],{"type":47,"tag":238,"props":863,"children":864},{"style":778},[865],{"type":53,"value":866},"fi\n",{"type":47,"tag":56,"props":868,"children":869},{},[870,872,877,879,885],{"type":53,"value":871},"Once the local build exits ",{"type":47,"tag":62,"props":873,"children":875},{"className":874},[],[876],{"type":53,"value":129},{"type":53,"value":878},", push the fix to the tracked branch and start a fresh Cloud build with ",{"type":47,"tag":62,"props":880,"children":882},{"className":881},[],[883],{"type":53,"value":884},"mcloud environments trigger-build \u003Cenv>",{"type":53,"value":148},{"type":47,"tag":79,"props":887,"children":889},{"id":888},"examples",[890],{"type":53,"value":891},"Examples",{"type":47,"tag":227,"props":893,"children":895},{"className":229,"code":894,"language":231,"meta":232,"style":232},"# Reproduce the backend build for the active context\nmcloud local build\n\n# Reproduce the storefront build\nmcloud local build --type storefront --storefront-path apps\u002Fstorefront\n\n# Test a build-variable fix without editing code\nmcloud local build --var NODE_ENV=production\n\n# Build against a local .env file\nmcloud local build --env-file .env\n\n# Reuse the Docker cache for a faster rebuild\nmcloud local build --docker-cache\n",[896],{"type":47,"tag":62,"props":897,"children":898},{"__ignoreMap":232},[899,907,923,930,938,973,980,988,1013,1020,1028,1053,1060,1068],{"type":47,"tag":238,"props":900,"children":901},{"class":240,"line":241},[902],{"type":47,"tag":238,"props":903,"children":904},{"style":563},[905],{"type":53,"value":906},"# Reproduce the backend build for the active context\n",{"type":47,"tag":238,"props":908,"children":909},{"class":240,"line":268},[910,914,918],{"type":47,"tag":238,"props":911,"children":912},{"style":245},[913],{"type":53,"value":248},{"type":47,"tag":238,"props":915,"children":916},{"style":251},[917],{"type":53,"value":254},{"type":47,"tag":238,"props":919,"children":920},{"style":251},[921],{"type":53,"value":922}," build\n",{"type":47,"tag":238,"props":924,"children":925},{"class":240,"line":302},[926],{"type":47,"tag":238,"props":927,"children":928},{"emptyLinePlaceholder":732},[929],{"type":53,"value":735},{"type":47,"tag":238,"props":931,"children":932},{"class":240,"line":333},[933],{"type":47,"tag":238,"props":934,"children":935},{"style":563},[936],{"type":53,"value":937},"# Reproduce the storefront build\n",{"type":47,"tag":238,"props":939,"children":940},{"class":240,"line":642},[941,945,949,953,958,963,968],{"type":47,"tag":238,"props":942,"children":943},{"style":245},[944],{"type":53,"value":248},{"type":47,"tag":238,"props":946,"children":947},{"style":251},[948],{"type":53,"value":254},{"type":47,"tag":238,"props":950,"children":951},{"style":251},[952],{"type":53,"value":259},{"type":47,"tag":238,"props":954,"children":955},{"style":251},[956],{"type":53,"value":957}," --type",{"type":47,"tag":238,"props":959,"children":960},{"style":251},[961],{"type":53,"value":962}," storefront",{"type":47,"tag":238,"props":964,"children":965},{"style":251},[966],{"type":53,"value":967}," --storefront-path",{"type":47,"tag":238,"props":969,"children":970},{"style":251},[971],{"type":53,"value":972}," apps\u002Fstorefront\n",{"type":47,"tag":238,"props":974,"children":975},{"class":240,"line":651},[976],{"type":47,"tag":238,"props":977,"children":978},{"emptyLinePlaceholder":732},[979],{"type":53,"value":735},{"type":47,"tag":238,"props":981,"children":982},{"class":240,"line":728},[983],{"type":47,"tag":238,"props":984,"children":985},{"style":563},[986],{"type":53,"value":987},"# Test a build-variable fix without editing code\n",{"type":47,"tag":238,"props":989,"children":990},{"class":240,"line":738},[991,995,999,1003,1008],{"type":47,"tag":238,"props":992,"children":993},{"style":245},[994],{"type":53,"value":248},{"type":47,"tag":238,"props":996,"children":997},{"style":251},[998],{"type":53,"value":254},{"type":47,"tag":238,"props":1000,"children":1001},{"style":251},[1002],{"type":53,"value":259},{"type":47,"tag":238,"props":1004,"children":1005},{"style":251},[1006],{"type":53,"value":1007}," --var",{"type":47,"tag":238,"props":1009,"children":1010},{"style":251},[1011],{"type":53,"value":1012}," NODE_ENV=production\n",{"type":47,"tag":238,"props":1014,"children":1015},{"class":240,"line":766},[1016],{"type":47,"tag":238,"props":1017,"children":1018},{"emptyLinePlaceholder":732},[1019],{"type":53,"value":735},{"type":47,"tag":238,"props":1021,"children":1022},{"class":240,"line":774},[1023],{"type":47,"tag":238,"props":1024,"children":1025},{"style":563},[1026],{"type":53,"value":1027},"# Build against a local .env file\n",{"type":47,"tag":238,"props":1029,"children":1030},{"class":240,"line":807},[1031,1035,1039,1043,1048],{"type":47,"tag":238,"props":1032,"children":1033},{"style":245},[1034],{"type":53,"value":248},{"type":47,"tag":238,"props":1036,"children":1037},{"style":251},[1038],{"type":53,"value":254},{"type":47,"tag":238,"props":1040,"children":1041},{"style":251},[1042],{"type":53,"value":259},{"type":47,"tag":238,"props":1044,"children":1045},{"style":251},[1046],{"type":53,"value":1047}," --env-file",{"type":47,"tag":238,"props":1049,"children":1050},{"style":251},[1051],{"type":53,"value":1052}," .env\n",{"type":47,"tag":238,"props":1054,"children":1055},{"class":240,"line":830},[1056],{"type":47,"tag":238,"props":1057,"children":1058},{"emptyLinePlaceholder":732},[1059],{"type":53,"value":735},{"type":47,"tag":238,"props":1061,"children":1062},{"class":240,"line":839},[1063],{"type":47,"tag":238,"props":1064,"children":1065},{"style":563},[1066],{"type":53,"value":1067},"# Reuse the Docker cache for a faster rebuild\n",{"type":47,"tag":238,"props":1069,"children":1070},{"class":240,"line":860},[1071,1075,1079,1083],{"type":47,"tag":238,"props":1072,"children":1073},{"style":245},[1074],{"type":53,"value":248},{"type":47,"tag":238,"props":1076,"children":1077},{"style":251},[1078],{"type":53,"value":254},{"type":47,"tag":238,"props":1080,"children":1081},{"style":251},[1082],{"type":53,"value":259},{"type":47,"tag":238,"props":1084,"children":1085},{"style":251},[1086],{"type":53,"value":1087}," --docker-cache\n",{"type":47,"tag":1089,"props":1090,"children":1091},"style",{},[1092],{"type":53,"value":1093},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":1095,"total":1247},[1096,1113,1127,1141,1153,1168,1178,1191,1206,1218,1225,1238],{"slug":1097,"name":1097,"fn":1098,"description":1099,"org":1100,"tags":1101,"stars":24,"repoUrl":25,"updatedAt":1112},"building-admin-dashboard-customizations","customize Medusa Admin dashboard UI","Load automatically when planning, researching, or implementing Medusa Admin dashboard UI (widgets, custom pages, forms, tables, data loading, navigation). REQUIRED for all admin UI work in ALL modes (planning, implementation, exploration). Contains design patterns, component usage, and data loading patterns that MCP servers don't provide.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1102,1105,1108,1109],{"name":1103,"slug":1104,"type":14},"E-commerce","e-commerce",{"name":1106,"slug":1107,"type":14},"Frontend","frontend",{"name":9,"slug":8,"type":14},{"name":1110,"slug":1111,"type":14},"UI Components","ui-components","2026-04-06T18:29:57.203659",{"slug":1114,"name":1114,"fn":1115,"description":1116,"org":1117,"tags":1118,"stars":24,"repoUrl":25,"updatedAt":1126},"building-storefronts","implement Medusa storefront features","Load automatically when planning, researching, or implementing Medusa storefront features (calling custom API routes, SDK integration, React Query patterns, data fetching). REQUIRED for all storefront development in ALL modes (planning, implementation, exploration). Contains SDK usage patterns, frontend integration, and critical rules for calling Medusa APIs.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1119,1120,1121,1122,1123],{"name":1103,"slug":1104,"type":14},{"name":19,"slug":20,"type":14},{"name":1106,"slug":1107,"type":14},{"name":9,"slug":8,"type":14},{"name":1124,"slug":1125,"type":14},"React","react","2026-04-06T18:29:55.957429",{"slug":1128,"name":1128,"fn":1129,"description":1130,"org":1131,"tags":1132,"stars":24,"repoUrl":25,"updatedAt":1140},"building-with-medusa","implement Medusa backend features","Load automatically when planning, researching, or implementing ANY Medusa backend features (custom modules, API routes, workflows, data models, module links, business logic). REQUIRED for all Medusa backend work in ALL modes (planning, implementation, exploration). Contains architectural patterns, best practices, and critical rules that MCP servers don't provide.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1133,1135,1138,1139],{"name":1134,"slug":418,"type":14},"Backend",{"name":1136,"slug":1137,"type":14},"Data Modeling","data-modeling",{"name":1103,"slug":1104,"type":14},{"name":9,"slug":8,"type":14},"2026-04-06T18:29:54.652389",{"slug":1142,"name":1142,"fn":1143,"description":1144,"org":1145,"tags":1146,"stars":24,"repoUrl":25,"updatedAt":1152},"creating-agents-in-medusa","build admin-facing AI agents in Medusa","Use when building an internal admin-facing AI agent in a Medusa project. These agents are operated by merchants and store operators — not customers. Covers data models, module service, agent runtime (tools, system prompt, streamText), streaming API routes (NDJSON), and admin UI chat extensions. Load for any internal agent type: store operations assistant, product audit, cohort analysis, customer service tooling for support staff, etc. Do NOT use for customer-facing agents (storefront chatbots, buyer-side assistants).",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1147,1150,1151],{"name":1148,"slug":1149,"type":14},"Agents","agents",{"name":1134,"slug":418,"type":14},{"name":9,"slug":8,"type":14},"2026-07-14T05:42:09.367168",{"slug":1154,"name":1154,"fn":1155,"description":1156,"org":1157,"tags":1158,"stars":24,"repoUrl":25,"updatedAt":1167},"db-generate","generate database migrations for Medusa modules","Generate database migrations for a Medusa module",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1159,1160,1163,1164],{"name":1134,"slug":418,"type":14},{"name":1161,"slug":1162,"type":14},"Database","database",{"name":9,"slug":8,"type":14},{"name":1165,"slug":1166,"type":14},"Migration","migration","2026-04-06T18:29:53.415671",{"slug":1169,"name":1169,"fn":1170,"description":1171,"org":1172,"tags":1173,"stars":24,"repoUrl":25,"updatedAt":1177},"db-migrate","run database migrations in Medusa","Run database migrations in Medusa",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1174,1175,1176],{"name":1161,"slug":1162,"type":14},{"name":9,"slug":8,"type":14},{"name":1165,"slug":1166,"type":14},"2026-04-06T18:29:52.187377",{"slug":1179,"name":1179,"fn":1180,"description":1181,"org":1182,"tags":1183,"stars":24,"repoUrl":25,"updatedAt":1190},"learning-medusa","guide Medusa development learning","Load automatically when user asks to learn Medusa development (e.g., \"teach me how to build with medusa\", \"guide me through medusa\", \"I want to learn medusa\"). Interactive guided tutorial where Claude acts as a coding bootcamp instructor, teaching step-by-step with checkpoints and verification.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1184,1185,1186,1187],{"name":1134,"slug":418,"type":14},{"name":1103,"slug":1104,"type":14},{"name":9,"slug":8,"type":14},{"name":1188,"slug":1189,"type":14},"Templates","templates","2026-04-06T18:29:58.461689",{"slug":1192,"name":1192,"fn":1193,"description":1194,"org":1195,"tags":1196,"stars":24,"repoUrl":25,"updatedAt":1205},"mcloud-deployments","manage Medusa Cloud deployments","Execute mcloud deployments commands to list deployments, retrieve deployment details, and fetch build logs. Use when listing deployments, checking deployment status, or reading build output for debugging build failures.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1197,1198,1201,1202],{"name":16,"slug":17,"type":14},{"name":1199,"slug":1200,"type":14},"Logs","logs",{"name":9,"slug":8,"type":14},{"name":1203,"slug":1204,"type":14},"Observability","observability","2026-05-09T05:40:51.727369",{"slug":1207,"name":1207,"fn":1208,"description":1209,"org":1210,"tags":1211,"stars":24,"repoUrl":25,"updatedAt":1217},"mcloud-environments","manage Medusa Cloud environments","Execute mcloud environments commands to list, get, create, delete, redeploy, or trigger builds for Cloud environments. Use when managing environment lifecycle, redeploying after variable changes, or starting new builds from source.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1212,1213,1214],{"name":16,"slug":17,"type":14},{"name":9,"slug":8,"type":14},{"name":1215,"slug":1216,"type":14},"Operations","operations","2026-07-17T05:31:36.384292",{"slug":4,"name":4,"fn":5,"description":6,"org":1219,"tags":1220,"stars":24,"repoUrl":25,"updatedAt":26},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1221,1222,1223,1224],{"name":22,"slug":23,"type":14},{"name":16,"slug":17,"type":14},{"name":19,"slug":20,"type":14},{"name":9,"slug":8,"type":14},{"slug":1226,"name":1226,"fn":1227,"description":1228,"org":1229,"tags":1230,"stars":24,"repoUrl":25,"updatedAt":1237},"mcloud-logs","fetch and stream runtime cloud logs","Execute mcloud logs to fetch and stream runtime logs for Cloud environments. Use when reading backend or storefront logs, filtering by time range, searching for errors, or scoping logs to a specific deployment.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1231,1234,1235,1236],{"name":1232,"slug":1233,"type":14},"Cloud","cloud",{"name":1199,"slug":1200,"type":14},{"name":9,"slug":8,"type":14},{"name":1203,"slug":1204,"type":14},"2026-05-09T05:40:46.707854",{"slug":1239,"name":1239,"fn":1240,"description":1241,"org":1242,"tags":1243,"stars":24,"repoUrl":25,"updatedAt":1246},"mcloud-organizations","manage Medusa Cloud organizations","Execute mcloud organizations commands to list or get Cloud organizations. Use when discovering organizations, resolving organization IDs by name, or retrieving organization details including members and subscription.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1244,1245],{"name":9,"slug":8,"type":14},{"name":1215,"slug":1216,"type":14},"2026-05-09T05:40:54.327722",17,{"items":1249,"total":1247},[1250,1257,1265,1272,1278,1285,1291],{"slug":1097,"name":1097,"fn":1098,"description":1099,"org":1251,"tags":1252,"stars":24,"repoUrl":25,"updatedAt":1112},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1253,1254,1255,1256],{"name":1103,"slug":1104,"type":14},{"name":1106,"slug":1107,"type":14},{"name":9,"slug":8,"type":14},{"name":1110,"slug":1111,"type":14},{"slug":1114,"name":1114,"fn":1115,"description":1116,"org":1258,"tags":1259,"stars":24,"repoUrl":25,"updatedAt":1126},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1260,1261,1262,1263,1264],{"name":1103,"slug":1104,"type":14},{"name":19,"slug":20,"type":14},{"name":1106,"slug":1107,"type":14},{"name":9,"slug":8,"type":14},{"name":1124,"slug":1125,"type":14},{"slug":1128,"name":1128,"fn":1129,"description":1130,"org":1266,"tags":1267,"stars":24,"repoUrl":25,"updatedAt":1140},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1268,1269,1270,1271],{"name":1134,"slug":418,"type":14},{"name":1136,"slug":1137,"type":14},{"name":1103,"slug":1104,"type":14},{"name":9,"slug":8,"type":14},{"slug":1142,"name":1142,"fn":1143,"description":1144,"org":1273,"tags":1274,"stars":24,"repoUrl":25,"updatedAt":1152},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1275,1276,1277],{"name":1148,"slug":1149,"type":14},{"name":1134,"slug":418,"type":14},{"name":9,"slug":8,"type":14},{"slug":1154,"name":1154,"fn":1155,"description":1156,"org":1279,"tags":1280,"stars":24,"repoUrl":25,"updatedAt":1167},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1281,1282,1283,1284],{"name":1134,"slug":418,"type":14},{"name":1161,"slug":1162,"type":14},{"name":9,"slug":8,"type":14},{"name":1165,"slug":1166,"type":14},{"slug":1169,"name":1169,"fn":1170,"description":1171,"org":1286,"tags":1287,"stars":24,"repoUrl":25,"updatedAt":1177},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1288,1289,1290],{"name":1161,"slug":1162,"type":14},{"name":9,"slug":8,"type":14},{"name":1165,"slug":1166,"type":14},{"slug":1179,"name":1179,"fn":1180,"description":1181,"org":1292,"tags":1293,"stars":24,"repoUrl":25,"updatedAt":1190},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[1294,1295,1296,1297],{"name":1134,"slug":418,"type":14},{"name":1103,"slug":1104,"type":14},{"name":9,"slug":8,"type":14},{"name":1188,"slug":1189,"type":14}]