using-medusa-cloud

द्वारा medusajs

Manages Medusa Cloud resources through the Cloud CLI (mcloud). Use when deploying, debugging deployments, managing environments, environment variables, or any…

npx skills add https://github.com/medusajs/medusa-agent-skills --skill using-medusa-cloud

Managing Medusa Cloud Resources

Operational guide for AI agents managing Medusa Cloud infrastructure through the mcloud CLI. Covers setup, deployments, debugging, environments, and variables.

Constraints

  • Always pass --json when parsing CLI output. Plaintext output is for humans and may change without warning.
  • Confirm context before mutating. Run mcloud whoami --json before any state change.
  • Read before you write. Run a get or list before any delete, redeploy, or trigger-build.
  • Use --yes for destructive operations. delete commands (including variables delete) require --yes in non-interactive mode.
  • Variable changes need a deploy to apply. variables set/delete don't rebuild or redeploy: redeploy for runtime changes, trigger-build for build changes.
  • Production environments cannot be deleted. mcloud environments delete errors on production by design.
  • Never pass --reveal unless the user explicitly asks. Secret values appear in terminal scrollback and logs.
  • --json and --follow are incompatible. Use bounded time windows (--from/--to) with --json for programmatic log ingestion.

CRITICAL: Load Reference Files When Needed

Load these references based on what you're doing:

  • Setting up the CLI? → MUST load setup.md first
  • Debugging a failed deployment? → MUST load debugging-deployments.md first
  • Managing environments or variables? → MUST load environments-and-variables.md first

Minimum requirement: Load at least one reference file before executing multi-step workflows.

Quick Reference

Authentication Check

Always verify auth and scope before mutating state:

mcloud whoami --json | jq -e '.auth.kind != "none" and .organization.id != null'

Exit code 0 = authenticated and scoped. Non-zero = stop and ask the user.

Set Context Once

mcloud use \
  --organization org_123 \
  --project proj_123 \
  --environment production

CRITICAL: mcloud use without flags is interactive and fails in CI/Docker/piped input. Always pass flags.

Deployment Status Routing

Route on backend_status (or storefront_status):

StatusMeaningLogs to check
build-failedBuild step failedmcloud deployments build-logs <id>
deployment-failedRuntime crashed after buildmcloud logs --deployment <id>
timed-outExceeded time budgetBoth: build-logs first, then runtime logs

Redeployment Decision

CommandWhen to use
mcloud environments redeploy <env>Fix is environment-side (variable change, infra) — reruns existing build
mcloud environments trigger-build <env>Fix is in source code on the tracked branch — starts new build

Common Pitfalls

  • TTY-only commands. mcloud login, mcloud use (without flags), and delete without --yes require a TTY. They fail in CI, Docker, or piped input.
  • MCLOUD_TOKEN precedence. When set, file-based credentials are ignored and mcloud login is rejected. Unset it to switch accounts.
  • Personal vs org access keys. Personal keys require --organization; org keys are pre-scoped.
  • organizations list requires personal auth. Org access keys return 401 on this command.
  • Build IDs vs deployment IDs. depl_* = deployment ID; anything else = build ID (resolved to latest deployment). mcloud logs --deployment accepts both; other commands take build IDs only.
  • mcloud local build has no --json. It streams plaintext and reports success via its exit code (0 = success). Requires Docker and must run inside the project's Git repo. Use it to reproduce build-failed failures locally — see debugging-deployments.md.

Reference Files

setup.md                       - CLI installation, authentication, context setup
debugging-deployments.md       - Build/deployment failure recipes and log analysis
environments-and-variables.md  - Environment lifecycle and variable management

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