mcloud-environments

작성자: medusajs

mcloud environments 명령을 실행하여 Cloud 환경을 나열, 조회, 생성, 삭제, 재배포 또는 빌드를 트리거합니다. 환경 수명 주기를 관리할 때 사용합니다.

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}'

medusajs의 다른 스킬

creating-agents-in-medusa
medusajs
Medusa 프로젝트에서 내부 관리자용 AI 에이전트를 구축할 때 사용합니다. 이러한 에이전트는 고객이 아닌 판매자와 스토어 운영자가 사용합니다. 다음을 다룹니다…
mcloud-local
medusajs
로컬 머신에서 Cloud build를 재현하기 위해 mcloud local build를 실행합니다. 추적된 브랜치로 푸시하지 않고 빌드에 실패한 배포를 디버깅할 때 사용합니다,…
reviewing-prs
medusajs
Medusa 저장소의 GitHub 풀 리퀘스트를 검토합니다. PR 템플릿 준수 여부, 기여 가이드라인, 코드 규칙, 보안, 성능 등을 확인합니다…
writing-releases
medusajs
Medusa 릴리스에 대한 GitHub 릴리스 노트를 기존 스타일로 작성합니다. 커밋 및 PR 목록에서 초안 릴리스 설명을 생성할 때 사용합니다…
writing-tsdocs
medusajs
Medusa 코드베이스의 TypeScript 소스 파일에 TypeDoc(TSDoc) 주석을 추가하고 업데이트합니다. HTTP 유형, API 라우트, UI 컴포넌트, 데이터 모델, 서비스…를 다룹니다.
mcloud-variables
medusajs
mcloud variables 명령어를 실행하여 Cloud 환경의 환경 변수를 나열하고 가져옵니다. 환경을 검사하거나 읽거나 내보낼 때 사용합니다.
mcloud-deployments
medusajs
mcloud deployments 명령을 실행하여 배포 목록을 조회하고, 배포 세부 정보를 검색하며, 빌드 로그를 가져옵니다. 배포 목록을 확인하거나, 배포 상태를 점검할 때 사용합니다.
writing-docs
medusajs
Medusa 문서의 book, resources, ui, user-guide, cloud 프로젝트에 대한 MDX 파일을 작성하고 업데이트합니다. 문서 변경 사항을 적용할 때 사용합니다…