Loading...
Loading...
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.
npx skill4agent add medusajs/medusa-agent-skills mcloud-environmentsmcloud environmentstypeenvironments get --json--yesdeleteredeploytrigger-buildmcloud environments list --organization <org-id> --project <project-id-or-handle> --json-o/--organization <id>-p/--project <id-or-handle>--jsonmcloud environments get <environment-handle> --organization <org-id> --project <project-id-or-handle> --jsonenvironment-o/--organization <id>-p/--project <id-or-handle>--jsonmcloud environments create \
--organization <org-id> \
--project <project-id-or-handle> \
--name "Staging" \
--branch develop \
--json-o/--organization <id>-p/--project <id-or-handle>-n/--name <name>-b/--branch <branch>--custom-subdomain <subdomain>--jsonmcloud environments delete <environment-handle> \
--organization <org-id> \
--project <project-id-or-handle> \
--yesenvironment-o/--organization <id>-p/--project <id-or-handle>-y/--yes--jsonmcloud environments redeploy <environment-handle> \
--organization <org-id> \
--project <project-id-or-handle> \
--jsonenvironment-o/--organization <id>-p/--project <id-or-handle>--jsonRequires the environment to have an active deployment. If it doesn't, usefirst.trigger-build
mcloud environments trigger-build <environment-handle> \
--organization <org-id> \
--project <project-id-or-handle> \
--jsonenvironment-o/--organization <id>-p/--project <id-or-handle>--json| Command | When to use |
|---|---|
| Fix is environment-side (variable change, infra config) — reruns existing build |
| Fix is in source code on the tracked branch — starts a new build |
# 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}'