whoami Command - Medusa Cloud CLI Reference
Show the authenticated user, the active organization, project, and environment, and CLI metadata. Use this command to verify which account and context the CLI is currently using.
Returns the following information:
The Auth line shows whether the CLI is using a JWT (browser login) or an access key, and when the JWT expires (when applicable).
Options#
| Option | Description | Default |
|---|---|---|
| Print the result as JSON instead of formatted text. Useful for piping the active context into scripts. |
|
Verify Authentication in a Script#
Pipe whoami --json into jq to assert that the CLI is authenticated and that the active context is set before running other commands:
The command exits with a non-zero status if either condition is unmet, which is useful as a guard step in CI/CD pipelines.
Switch the Active Context#
To change the active organization, project, or environment, use mcloud use.
To switch accounts, use mcloud logout followed by mcloud login.