All skills
medusajs avatar

/using-medusa-cloud

@67d8604 official
by Medusamedusajs/medusa-agent-skills225 stars
29

Manages Medusa Cloud resources through the Cloud CLI (mcloud). Use when deploying, debugging deployments, managing environments, environment variables, or any Medusa Cloud operation. CRITICAL for mcloud commands, deployment failures, build logs, Cloud setup, and CI/CD workflows.

Use this Skill: https://skilld.dev/gh/medusajs/medusa-agent-skills/using-medusa-cloud

This session only. Nothing lands on disk.

referencesetup.md

≈577 tokens on demand. Your agent reads this file only when SKILL.md points to it.

CLI Setup and Authentication

One-time setup for the Medusa Cloud CLI. Skip steps whose checks already pass.

1. Check if CLI is Installed

mcloud --version

If this exits 0 and prints a version, skip to Confirm Authentication.

2. Verify Node.js Version

The CLI requires Node.js v22+:

node --version

If below v22, ask the user to upgrade (via nvm or the official installer). Do not upgrade without authorization.

3. Install the CLI

npm install -g @medusajs/mcloud

Verify:

mcloud --version

If not found, ask the user to check their global npm bin directory is on PATH.

4. Confirm Authentication

Ask the user if they have a Medusa Cloud account.

Has account:

mcloud login

Opens a browser to complete auth.

No account:

mcloud signup
mcloud login

Non-interactive environments (CI, Docker, headless):

export MCLOUD_TOKEN=<access-key>

When MCLOUD_TOKEN is set, the CLI uses it on every command and mcloud login is rejected.

5. Verify Setup

mcloud whoami --json

Check auth and scope:

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

Setting the Active Context

Persist org, project, and environment so subsequent commands skip --organization, --project, --environment flags:

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

Resolving Names to IDs

If you only have names:

# Resolve organization ID by name
ORGANIZATION_ID=$(
  mcloud organizations list --json \
    | jq -r '.[] | select(.name == "My Organization") | .id'
)

# Resolve project handle by name
PROJECT_HANDLE=$(
  mcloud projects list --organization "$ORGANIZATION_ID" --json \
    | jq -r '.[] | select(.name == "My Store") | .handle'
)

# Resolve environment handle by name
ENVIRONMENT_HANDLE=$(
  mcloud environments list --organization "$ORGANIZATION_ID" --project "$PROJECT_HANDLE" --json \
    | jq -r '.[] | select(.name == "Production") | .handle'
)

mcloud use \
  --organization "$ORGANIZATION_ID" \
  --project "$PROJECT_HANDLE" \
  --environment "$ENVIRONMENT_HANDLE"

Clearing Context

mcloud use --clear

Source: SKILL.md on GitHub

No alerts16d3 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    This skill is a utility for managing Medusa Cloud resources using the official mcloud CLI. It incorporates security best practices, such as requiring explicit user confirmation for revealing secrets and protecting production environments from accidental deletion.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

Signed by skilld at 67d8604. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 days ago.

Activeupdated 3 months ago

README badge

README badge for medusajs/medusa-agent-skills/using-medusa-cloud