use Command - Medusa Cloud CLI Reference

Select the active organization, project, and environment, and persist the selection in a context configuration file. Subsequent CLI commands read this configuration so you don't need to repeat --organization, --project, and --environment on every command.

Terminal
mcloud use

When run without flags, the command launches an interactive picker for each value. Pass any of --organization, --project, or --environment to set them non-interactively.

Options#

Option

Description

Required

-o <id>, --organization <id>

The ID of the organization to set as active. Skips the interactive organization picker.

No

-p <id-or-handle>, --project <id-or-handle>

The ID or handle of the project to set as active. Skips the interactive project picker.

No

-e <handle>, --environment <handle>

The handle of the environment to set as active. Skips the interactive environment picker.

No

--clear

Remove the persisted organization, project, and environment selection. Run before switching accounts or to reset the context.

No

--json

Print the result as JSON instead of formatted text.

No


Set the Active Context#

Interactively#

Run mcloud use without flags to pick each value from a list. The CLI prompts you to select an organization (if you're in more than one), a project, and an environment from the active project:

Terminal
mcloud use

After saving, every subsequent command operates on the selected organization, project, and environment by default.

Note: In non-interactive environments like CI runners, pass --organization, --project, and --environment directly. See Set the Active Context Non-Interactively below.

Non-Interactively#

When working with AI agents, scripts, or CI/CD pipelines, you can set the active context non-interactively by passing any of --organization, --project, or --environment directly. For example:

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

You can also switch the active environment without changing the organization or project:

Terminal
mcloud use --environment staging

Inspect the Active Context#

Use mcloud whoami to see the active organization, project, and environment along with the authenticated user and CLI metadata:

Terminal
mcloud whoami

Clear the Active Context#

To clear the persisted organization, project, and environment, pass --clear:

Terminal
mcloud use --clear

After clearing, commands that require these values will prompt for them or fail unless you pass them as flags or run mcloud use again.

Was this guide helpful?
Ask Bloom
For assistance in your development, use Claude Code Plugins or Medusa MCP server in Cursor, VSCode, etc...FAQ
What is Medusa?
How can I create a module?
How can I create a data model?
How do I create a workflow?
How can I extend a data model in the Product Module?
Recipes
How do I build a marketplace with Medusa?
How do I build digital products with Medusa?
How do I build subscription-based purchases with Medusa?
What other recipes are available in the Medusa documentation?
Chat is cleared on refresh
Line break