mcloud-local

द्वारा medusajs

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,…

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

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 <id>.
  • 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.

mcloud local build \
  --organization <org-id> \
  --project <project-id-or-handle> \
  --environment <environment-handle>

Options:

  • -o/--organization <id> — Organization ID (falls back to active context)
  • -p/--project <id-or-handle> — Project ID or handle (falls back to active context)
  • -e/--environment <handle> — Environment whose variables are used (falls back to active context)
  • -t/--type <backend|storefront> — Build type (default: backend)
  • --root-path <path> — Backend root path relative to the repo root (inferred if omitted; . if no Cloud project found)
  • --storefront-path <path> — Storefront path relative to the repo root, for --type storefront (inferred if omitted)
  • --env-file <path> — Use a local .env file instead of the Cloud environment's variables
  • -v/--var <KEY=VALUE> — 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 <repository-name>:cloud-local-build-<commit-hash>; 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:

# 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 <env>.

Examples

# 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

medusajs की और Skills

mcloud-variables
medusajs
क्लाउड वातावरण के लिए पर्यावरण चरों को सूचीबद्ध करने और प्राप्त करने हेतु mcloud variables कमांड निष्पादित करें। पर्यावरण चरों का निरीक्षण, पठन या निर्यात करते समय उपयोग करें।
official
building-storefronts
medusajs
SDK-प्रथम फ्रंटएंड एकीकरण, Medusa स्टोरफ्रंट के लिए React Query पैटर्न और महत्वपूर्ण API कॉलिंग नियमों के साथ। सभी API अनुरोधों के लिए हमेशा Medusa JS SDK का उपयोग करें—कभी भी सामान्य fetch() का उपयोग न करें, क्योंकि इसमें आवश्यक हेडर (स्टोर रूट के लिए प्रकाशनीय API कुंजी, एडमिन रूट के लिए प्रमाणीकरण) का अभाव होता है। SDK विधियों में सादे जावास्क्रिप्ट ऑब्जेक्ट पास करें; बॉडी पैरामीटर पर कभी भी JSON.stringify() का
official
building-admin-dashboard-customizations
medusajs
मेडुसा एडमिन डैशबोर्ड के लिए एडमिन SDK और मेडुसा UI घटकों का उपयोग करके कस्टम UI एक्सटेंशन। किसी भी एडमिन UI कार्य (योजना, कार्यान्वयन, अन्वेषण) के लिए पहले इस स्किल को लोड करें; MCP सर्वर केवल API संदर्भ प्रदान करते हैं, डिज़ाइन पैटर्न या डेटा लोडिंग रणनीतियाँ नहीं। महत्वपूर्ण: सभी API अनुरोधों के लिए हमेशा मेडुसा JS SDK का उपयोग करें (कभी भी सामान्य fetch का नहीं); डिस्प्ले क्वेरी को
official
learning-medusa
medusajs
इंटरैक्टिव चरण-दर-चरण मेडुसा डेवलपमेंट बूटकैंप जहां आप आर्किटेक्चर पैटर्न सीखते हुए एक ब्रांड्स फीचर बनाते हैं। तीन प्रगतिशील पाठ (कुल 2-3 घंटे) जिनमें मॉड्यूल, वर्कफ़्लो, एपीआई रूट्स, मॉड्यूल लिंक्स, वर्कफ़्लो हुक्स और एडमिन यूआई कस्टमाइज़ेशन शामिल हैं। प्रत्येक प्रमुख घटक के बाद चेकपॉइंट सत्यापन आगे बढ़ने से पहले अवधारणात्मक सम
official
db-migrate
medusajs
लंबित Medusa डेटाबेस माइग्रेशन निष्पादित करें और परिणाम रिपोर्ट करें। आपके Medusa डेटाबेस पर सभी लंबित माइग्रेशन लागू करने के लिए Bash के माध्यम से npx medusa db:migrate चलाता है। लागू किए गए माइग्रेशन की संख्या, सामने आई किसी भी त्रुटि और सफलता की पुष्टि सहित माइग्रेशन परिणाम रिपोर्ट करता है। मानक npm/npx सेटअप वाले Medusa प्रोजेक्ट्स के लिए डिज़ाइन किया गया है।
official
mcloud-environments
medusajs
mcloud environments कमांड को निष्पादित करके क्लाउड वातावरणों को सूचीबद्ध करना, प्राप्त करना, बनाना, हटाना, पुनः तैनात करना या बिल्ड ट्रिगर करना। वातावरण जीवनचक्र प्रबंधित करते समय उपयोग करें,…
official
db-generate
medusajs
एक ही कमांड से Medusa मॉड्यूल के लिए डेटाबेस माइग्रेशन जनरेट करें। निर्दिष्ट Medusa मॉड्यूल के लिए माइग्रेशन फ़ाइलें बनाने हेतु npx medusa db:generate CLI कमांड को रैप करता है। मॉड्यूल का नाम एक आर्गुमेंट के रूप में स्वीकार करता है और माइग्रेशन फ़ाइल का स्थान, त्रुटियाँ, तथा अगले कदमों की रिपोर्ट करता है। जनरेशन के बाद माइग्रेशन लागू करने के लिए स्वचालित रूप से npx medusa db:migrate चलाने का सुझाव देता है।
official
mcloud-deployments
medusajs
Execute mcloud deployments commands to list deployments, retrieve deployment details, and fetch build logs. Use when listing deployments, checking deployment…
official