$npx -y skills add medusajs/medusa-agent-skills --skill mcloud-organizationsExecute mcloud organizations commands to list or get Cloud organizations. Use when discovering organizations, resolving organization IDs by name, or retrieving organization details including members and subscription.
| 1 | # Cloud CLI: Organizations Commands |
| 2 | |
| 3 | Execute `mcloud organizations` commands to list and retrieve Cloud organizations. |
| 4 | |
| 5 | ## Constraints |
| 6 | |
| 7 | - `organizations list` requires **personal auth** (browser login or personal access key). Organization access keys return 401 on this command. |
| 8 | - When authenticated with `MCLOUD_TOKEN` using an org access key, use `mcloud whoami --json` to get the organization ID instead. |
| 9 | |
| 10 | ## Commands |
| 11 | |
| 12 | ### organizations list |
| 13 | |
| 14 | List all organizations your account has access to. |
| 15 | |
| 16 | ```bash |
| 17 | mcloud organizations list --json |
| 18 | ``` |
| 19 | |
| 20 | **Options:** |
| 21 | - `--json` — Output as JSON |
| 22 | |
| 23 | ### organizations get |
| 24 | |
| 25 | Retrieve a single organization by ID. Returns metadata, subscription details, and members. |
| 26 | |
| 27 | ```bash |
| 28 | mcloud organizations get <organization-id> --json |
| 29 | ``` |
| 30 | |
| 31 | **Arguments:** |
| 32 | - `organization` — Organization ID (required) |
| 33 | |
| 34 | **Options:** |
| 35 | - `-o/--organization <id>` — Override the organization in active context (must match the argument) |
| 36 | - `--json` — Output as JSON |
| 37 | |
| 38 | ## Organization Fields (JSON) |
| 39 | |
| 40 | | Field | Description | |
| 41 | |-------|-------------| |
| 42 | | `id` | Organization ID | |
| 43 | | `name` | Organization display name | |
| 44 | | `billing_email` | Billing contact email | |
| 45 | | `status` | `active` or otherwise | |
| 46 | | `members` | Array of member objects with `id`, `role`, `user.email` | |
| 47 | | `subscription` | Current plan, period, and `is_active` flag | |
| 48 | | `account_holder` | Billing account holder details | |
| 49 | |
| 50 | ## Examples |
| 51 | |
| 52 | ```bash |
| 53 | # List all organizations |
| 54 | mcloud organizations list --json |
| 55 | |
| 56 | # Set context to first organization |
| 57 | ORGANIZATION_ID=$( |
| 58 | mcloud organizations list --json \ |
| 59 | | jq -r '.[0].id' |
| 60 | ) |
| 61 | mcloud use --organization "$ORGANIZATION_ID" |
| 62 | |
| 63 | # Find organization ID by name |
| 64 | ORGANIZATION_ID=$( |
| 65 | mcloud organizations list --json \ |
| 66 | | jq -r '.[] | select(.name == "My Organization") | .id' |
| 67 | ) |
| 68 | |
| 69 | # Get organization details (subscription, members) |
| 70 | mcloud organizations get org_123 --json |
| 71 | |
| 72 | # List member emails |
| 73 | mcloud organizations get org_123 --json \ |
| 74 | | jq -r '.members[].user.email' |
| 75 | |
| 76 | # Check subscription plan |
| 77 | mcloud organizations get org_123 --json \ |
| 78 | | jq '{plan: .subscription.plan.name, status: .subscription.is_active}' |
| 79 | ``` |