mcloud-environments

Execute mcloud environments commands to list, get, create, delete, redeploy, or trigger builds for Cloud environments. Use when managing environment lifecycle,…

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

Cloud CLI: Environments Commands

Execute mcloud environments commands to manage environment lifecycle and deployments.

Constraints

  • Production environments cannot be deleted. Always check type via environments get --json before attempting delete in automation.
  • Use --yes for destructive operations (delete) in non-interactive contexts.
  • redeploy vs trigger-build are not interchangeable — choose the right one based on where the fix is.

Commands

environments list

List all environments in a project.

mcloud environments list --organization <org-id> --project <project-id-or-handle> --json

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)
  • --json — Output as JSON

environments get

Retrieve a single environment by its ID or handle.

mcloud environments get <environment-id-or-handle> --organization <org-id> --project <project-id-or-handle> --json

Arguments:

  • environment — Environment ID or handle (required)

Options:

  • -o/--organization <id>, -p/--project <id-or-handle>, --json

environments create

Create a new long-lived environment.

mcloud environments create \
  --organization <org-id> \
  --project <project-id-or-handle> \
  --name "Staging" \
  --branch develop \
  --json

Options:

  • -o/--organization <id>, -p/--project <id-or-handle>
  • -n/--name <name> — Environment name (required)
  • -b/--branch <branch> — Git branch to track (required)
  • --custom-subdomain <subdomain> — Optional custom subdomain
  • --json — Output as JSON

environments delete

Delete an environment. Cannot delete production environments.

mcloud environments delete <environment-id-or-handle> \
  --organization <org-id> \
  --project <project-id-or-handle> \
  --yes

Arguments:

  • environment — Environment ID or handle (required)

Options:

  • -o/--organization <id>, -p/--project <id-or-handle>
  • -y/--yes — Skip confirmation prompt (required in non-interactive mode)
  • --json — Output as JSON

environments redeploy

Re-run an existing build for the active deployment. Use when the fix is environment-side (variable change, infra issue) — does NOT start a new build.

mcloud environments redeploy <environment-id-or-handle> \
  --organization <org-id> \
  --project <project-id-or-handle> \
  --json

Arguments:

  • environment — Environment ID or handle (required)

Options:

  • -o/--organization <id>, -p/--project <id-or-handle>, --json

Requires the environment to have an active deployment. If it doesn't, use trigger-build first.

environments trigger-build

Start a new build from the tracked branch. Use when the fix is committed code — creates a new deployment.

mcloud environments trigger-build <environment-id-or-handle> \
  --organization <org-id> \
  --project <project-id-or-handle> \
  --json

Arguments:

  • environment — Environment ID or handle (required)

Options:

  • -o/--organization <id>, -p/--project <id-or-handle>, --json

Redeploy vs Trigger-Build Decision

CommandWhen to use
redeployFix is environment-side (variable change, infra config) — reruns existing build
trigger-buildFix is in source code on the tracked branch — starts a new build

Examples

# List all environments
mcloud environments list --json

# Get environment details and check type before deleting
mcloud environments get staging --json | jq '{id, name, type, status}'

# Create a new environment tracking the develop branch
mcloud environments create --name "Staging" --branch develop --json

# Delete a non-production environment
mcloud environments delete staging --yes

# Redeploy after a variable change
mcloud environments redeploy production --json

# Trigger a fresh build from source
mcloud environments trigger-build production --json

# Find environment handles by name
mcloud environments list --json \
  | jq -r '.[] | select(.name == "Production") | .handle'

# Verify new build started
mcloud deployments list --environment production --limit 5 --json \
  | jq '.[] | {id, backend_status, updated_at}'

More skills from medusajs

mcloud-variables
medusajs
Execute mcloud variables commands to list and get environment variables for a Cloud environment. Use when inspecting, reading, or exporting environment…
official
building-storefronts
medusajs
SDK-first frontend integration for Medusa storefronts with React Query patterns and critical API calling rules. Always use the Medusa JS SDK for all API requests—never use regular fetch(), as it lacks required headers (publishable API key for store routes, auth for admin routes) Pass plain JavaScript objects to SDK methods; never use JSON.stringify() on body parameters, as the SDK handles serialization automatically Use useQuery for GET requests and useMutation for POST/DELETE requests,...
official
building-admin-dashboard-customizations
medusajs
Custom UI extensions for Medusa Admin dashboard using the Admin SDK and Medusa UI components. Load this skill FIRST for any admin UI work (planning, implementation, exploration); MCP servers provide API reference only, not design patterns or data loading strategies CRITICAL: Always use Medusa JS SDK for all API requests (never regular fetch); separate display queries from modal queries and invalidate display data after mutations Implement widgets on existing pages or create custom UI routes;...
official
learning-medusa
medusajs
Interactive step-by-step Medusa development bootcamp where you build a brands feature while learning architecture patterns. Three progressive lessons (2–3 hours total) covering modules, workflows, API routes, module links, workflow hooks, and admin UI customization Checkpoint verification after each major component tests conceptual understanding, code quality, and functionality before proceeding Treats errors as teaching opportunities; debugs together with diagnostic questions and root-cause...
official
db-migrate
medusajs
Execute pending Medusa database migrations and report results. Runs npx medusa db:migrate via Bash to apply all pending migrations to your Medusa database Reports migration outcomes including count of applied migrations, any errors encountered, and success confirmation Designed for Medusa projects with standard npm/npx setup
official
mcloud-environments
medusajs
Execute mcloud environments commands to list, get, create, delete, redeploy, or trigger builds for Cloud environments. Use when managing environment lifecycle,…
official
db-generate
medusajs
Generate database migrations for Medusa modules with a single command. Wraps the npx medusa db:generate CLI command to create migration files for specified Medusa modules Accepts module name as an argument and reports migration file location, errors, and next steps Automatically suggests running npx medusa db:migrate after generation to apply migrations
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