www/apps/cloud/app/cli/commands/projects/page.mdx
import { Table, Note, CodeTabs, CodeTab } from "docs-ui"
export const metadata = {
title: projects Command - Medusa Cloud CLI Reference,
}
In this guide, you'll learn how to manage your Cloud projects using the CLI.
List all projects in an organization.
<CodeTabs group="cli-auth"> <CodeTab label="With Flags" value="flags">mcloud projects list --organization org_123
# Run once: mcloud use --organization org_123
mcloud projects list
`-o <id>`, `--organization <id>`
</Table.Cell>
<Table.Cell>
The [ID of the organization](../organizations/page.mdx#find-organization-id) to list projects from.
</Table.Cell>
<Table.Cell>
Yes
</Table.Cell>
<Table.Cell>
Falls back to the organization in the [active context](../use/page.mdx#set-the-active-context), if set.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`--json`
</Table.Cell>
<Table.Cell>
Print the result as JSON instead of formatted text.
</Table.Cell>
<Table.Cell>
No
</Table.Cell>
<Table.Cell>
`false`
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>Retrieve a single project by its ID or handle. This is useful if you want to get more details about the project, such as its status or region.
<CodeTabs group="cli-auth"> <CodeTab label="With Flags" value="flags">mcloud projects get <project> --organization org_123
# Run once: mcloud use --organization org_123
mcloud projects get <project>
Returns the following information:
<CodeTabs group="cli-output"> <CodeTab label="Plaintext" value="plaintext">ID: <project-id>
Name: My Store
Handle: <project-handle>
Status: ready
Region: us-east-1
Repository: myuser/my-repo
Root path: /apps/backend
Organization: <organization-id>
Created at: 2026-04-01T09:44:35.065Z
{
"id": "<project-id>",
"name": "My Store",
"handle": "<project-handle>",
"region": "us-east-1",
"repository": "myuser/my-repo",
"root_path": "/apps/backend",
"status": "ready",
"created_at": "2024-10-10T08:24:32.382Z",
"updated_at": "2024-10-11T08:24:32.382Z",
"metadata": null,
"builds": [],
"environments": [
{
"id": "<environment-id>",
"project_id": "<project-id>",
"handle": "<environment-handle>",
"name": "Production",
"type": "production",
"default_subdomain": "trusting-soft-form",
"custom_subdomain": "acme",
"default_domain": "trusting-soft-form.medusajs.app",
"custom_domain": "acme.com",
"created_at": "2024-10-10T08:24:32.382Z",
"updated_at": "2024-10-10T08:24:32.382Z",
"deleted_at": null,
"external_id": "main",
"status": "ready",
"metadata": null,
"builds": [],
"deployments": [],
"variables": [],
"configuration": {
"read_replica_database_url": "postgresql://<user>:<password>@<host>/<database>?channel_binding=require&sslmode=require",
"tent_handle": "<tent-handle>",
"s3_file_url": "https://s3.us-east-1.amazonaws.com/<bucket>",
"s3_endpoint": "https://s3.us-east-1.amazonaws.com",
"upstash_external_id": "<upstash-id>"
},
"rules": null,
"active_deployment": null
}
]
}
`project`
</Table.Cell>
<Table.Cell>
The ID or handle of the project to retrieve.
</Table.Cell>
<Table.Cell>
Yes
</Table.Cell>
</Table.Row>
</Table.Body>
</Table> `-o <id>`, `--organization <id>`
</Table.Cell>
<Table.Cell>
The [ID of the organization](../organizations/page.mdx#find-organization-id) to get the project from.
</Table.Cell>
<Table.Cell>
Yes
</Table.Cell>
<Table.Cell>
Falls back to the organization in the [active context](../use/page.mdx#set-the-active-context), if set.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`--json`
</Table.Cell>
<Table.Cell>
Print the result as JSON instead of formatted text.
</Table.Cell>
<Table.Cell>
No
</Table.Cell>
<Table.Cell>
`false`
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>Delete a project by its ID or handle.
<Note type="warning">Deleting a project is irreversible and removes all associated environments, deployments, and resources.
</Note> <CodeTabs group="cli-auth"> <CodeTab label="With Flags" value="flags">mcloud projects delete <project> --organization org_123
# Run once: mcloud use --organization org_123
mcloud projects delete <project>
`project`
</Table.Cell>
<Table.Cell>
The ID or handle of the project to delete.
</Table.Cell>
<Table.Cell>
Yes
</Table.Cell>
</Table.Row>
</Table.Body>
</Table> `-o <id>`, `--organization <id>`
</Table.Cell>
<Table.Cell>
The [ID of the organization](../organizations/page.mdx#find-organization-id) to get the project from.
</Table.Cell>
<Table.Cell>
Yes
</Table.Cell>
<Table.Cell>
Falls back to the organization in the [active context](../use/page.mdx#set-the-active-context), if set.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`-y`, `--yes`
</Table.Cell>
<Table.Cell>
Skip the confirmation prompt. Use this in scripts and pipelines where
interactive input is not possible.
</Table.Cell>
<Table.Cell>
No
</Table.Cell>
<Table.Cell>
`false`
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`--json`
</Table.Cell>
<Table.Cell>
Print the result as JSON instead of formatted text.
</Table.Cell>
<Table.Cell>
No
</Table.Cell>
<Table.Cell>
`false`
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>Commands that operate on projects require a project ID or handle. You can either:
--project flag from all subsequent commands;projects list --json to get machine-readable project data. Pipe the output to jq to extract IDs or handles for use in subsequent commands. This is useful if you want to set the active project through an AI agent, script, or CI/CD pipeline.For example, to set the first project in the list as the active project:
<CodeTabs group="os"> <CodeTab label="macOS / Linux" value="unix">PROJECT_HANDLE=$(
mcloud projects list --json \
| jq -r '.[0].handle'
)
mcloud use --project "$PROJECT_HANDLE"
$PROJECT_HANDLE = (
mcloud projects list --json |
jq -r '.[0].handle'
)
mcloud use --project $PROJECT_HANDLE
To set a project by name as the active project:
<CodeTabs group="os"> <CodeTab label="macOS / Linux" value="unix">PROJECT_HANDLE=$(
mcloud projects list --json \
| jq -r '.[] | select(.name == "My Store") | .handle'
)
mcloud use --project "$PROJECT_HANDLE"
$PROJECT_HANDLE = (
mcloud projects list --json |
jq -r '.[] | select(.name == "My Store") | .handle'
)
mcloud use --project $PROJECT_HANDLE
Once set, you can omit the --project flag from all subsequent commands.
In automated cleanup scripts, use --yes to skip the interactive
confirmation prompt:
Deleting a project is irreversible and removes all associated environments, deployments, and resources.
</Note>mcloud projects delete old-project --yes