|
| 1 | +--- |
| 2 | +name: cloudamqp-cli |
| 3 | +description: Manage CloudAMQP instances, VPCs, teams, and RabbitMQ/LavinMQ configuration using the cloudamqp CLI. Use this skill whenever the user wants to create, list, inspect, update, delete, upgrade, restart, or troubleshoot CloudAMQP instances — even if they just say "spin up a RabbitMQ", "check my instances", or "upgrade my broker". Also use it for VPC setup, team management, and RabbitMQ config changes. |
| 4 | +allowed-tools: Bash(cloudamqp:*), Bash(jq:*), Bash(cat:*), Bash(echo:*), Bash(chmod:*), Bash(grep:*), Bash(sleep:*) |
| 5 | +--- |
| 6 | + |
| 7 | +# CloudAMQP CLI |
| 8 | + |
| 9 | +## Quick start |
| 10 | + |
| 11 | +```bash |
| 12 | +cloudamqp instance list |
| 13 | +cloudamqp instance get --id <id> |
| 14 | +cloudamqp instance create --name=<name> --plan=<plan> --region=<region> --wait |
| 15 | +cloudamqp instance restart-rabbitmq --id <id> |
| 16 | +cloudamqp instance delete --id <id> --force |
| 17 | +``` |
| 18 | + |
| 19 | +## Authentication |
| 20 | + |
| 21 | +Check auth before running anything — interactive prompts don't work in agent context: |
| 22 | + |
| 23 | +```bash |
| 24 | +cat ~/.cloudamqprc 2>/dev/null || echo "not configured" |
| 25 | +``` |
| 26 | + |
| 27 | +If not configured, ask the user for their API key (from https://customer.cloudamqp.com/apikeys), then: |
| 28 | + |
| 29 | +```bash |
| 30 | +echo "<api-key>" > ~/.cloudamqprc |
| 31 | +chmod 600 ~/.cloudamqprc |
| 32 | +``` |
| 33 | + |
| 34 | +Alternatively, set `CLOUDAMQP_APIKEY` in the environment. If neither is set, all commands will fail. |
| 35 | + |
| 36 | +## Output |
| 37 | + |
| 38 | +Read commands (`list`, `get`) support `-o json` for machine-readable output and `-o table` (default) for display. Use `--fields` to select columns. Write commands (`create`, `update`, `invite`, etc.) print plain text — they don't support `-o json`. |
| 39 | + |
| 40 | +## Commands |
| 41 | + |
| 42 | +### Instance lifecycle |
| 43 | + |
| 44 | +```bash |
| 45 | +cloudamqp instance create --name=<name> --plan=<plan> --region=<region> [--tags=<tag>...] [--vpc-id=<id>] [--wait] [--wait-timeout=20m] |
| 46 | +cloudamqp instance list [--details] |
| 47 | +cloudamqp instance get --id <id> |
| 48 | +cloudamqp instance update --id <id> [--name=<name>] [--plan=<plan>] |
| 49 | +cloudamqp instance delete --id <id> [--force] |
| 50 | +cloudamqp instance resize-disk --id <id> --disk-size=<gb> [--allow-downtime] |
| 51 | +``` |
| 52 | + |
| 53 | +### Copy settings between instances (dedicated only) |
| 54 | + |
| 55 | +```bash |
| 56 | +cloudamqp instance create --name=staging --plan=<plan> --region=<region> \ |
| 57 | + --copy-from-id=<id> --copy-settings=metrics,firewall,config,alarms,logs,definitions,plugins --wait |
| 58 | +``` |
| 59 | + |
| 60 | +### Node and plugin management |
| 61 | + |
| 62 | +```bash |
| 63 | +cloudamqp instance nodes list --id <id> |
| 64 | +cloudamqp instance nodes versions --id <id> |
| 65 | +cloudamqp instance plugins list --id <id> |
| 66 | +``` |
| 67 | + |
| 68 | +### RabbitMQ configuration |
| 69 | + |
| 70 | +```bash |
| 71 | +cloudamqp instance config list --id <id> |
| 72 | +cloudamqp instance config get --id <id> --key <key> |
| 73 | +cloudamqp instance config set --id <id> --key <key> --value <value> |
| 74 | +``` |
| 75 | + |
| 76 | +### Instance actions |
| 77 | + |
| 78 | +```bash |
| 79 | +# restarts (rolling for HA clusters) |
| 80 | +cloudamqp instance restart-rabbitmq --id <id> [--nodes=node1,node2] |
| 81 | +cloudamqp instance restart-cluster --id <id> # full restart, causes downtime |
| 82 | +cloudamqp instance restart-management --id <id> |
| 83 | + |
| 84 | +# start/stop |
| 85 | +cloudamqp instance start --id <id> |
| 86 | +cloudamqp instance stop --id <id> |
| 87 | +cloudamqp instance reboot --id <id> |
| 88 | +cloudamqp instance start-cluster --id <id> |
| 89 | +cloudamqp instance stop-cluster --id <id> |
| 90 | + |
| 91 | +# upgrades — async, return immediately, poll until ready |
| 92 | +cloudamqp instance upgrade-erlang --id <id> |
| 93 | +cloudamqp instance upgrade-rabbitmq --id <id> --version=<version> |
| 94 | +cloudamqp instance upgrade-all --id <id> |
| 95 | +cloudamqp instance upgrade-versions --id <id> |
| 96 | +``` |
| 97 | + |
| 98 | +### VPC management |
| 99 | + |
| 100 | +```bash |
| 101 | +cloudamqp vpc create --name=<name> --region=<region> --subnet=<cidr> |
| 102 | +cloudamqp vpc list |
| 103 | +cloudamqp vpc get --id <id> |
| 104 | +cloudamqp vpc update --id <id> --name=<name> |
| 105 | +cloudamqp vpc delete --id <id> |
| 106 | +``` |
| 107 | + |
| 108 | +### Team management |
| 109 | + |
| 110 | +```bash |
| 111 | +cloudamqp team list |
| 112 | +cloudamqp team invite --email=<email> [--role=<role>] [--tags=<tag>] |
| 113 | +cloudamqp team update --user-id=<id> --role=<role> |
| 114 | +cloudamqp team remove --email=<email> |
| 115 | +``` |
| 116 | + |
| 117 | +### Plans, regions, audit |
| 118 | + |
| 119 | +```bash |
| 120 | +cloudamqp plans [--backend=rabbitmq|lavinmq] # always fetch, never guess |
| 121 | +cloudamqp regions [--provider=<provider>] # always fetch, never guess |
| 122 | +cloudamqp audit [--timestamp=2024-01] |
| 123 | +cloudamqp rotate-key |
| 124 | +``` |
| 125 | + |
| 126 | +## Key behaviors |
| 127 | + |
| 128 | +- **Async**: creation, resizes, upgrades return immediately. Use `--wait` on create, or poll `instance get --id <id> -o json | jq -r '.ready'` until `"Yes"`. |
| 129 | +- **Destructive commands** prompt for confirmation — use `--force` to skip. |
| 130 | +- **Multiple tags**: repeat the flag: `--tags=prod --tags=web`. |
| 131 | +- **Plan/region names**: always run `cloudamqp plans` / `cloudamqp regions` first — never hardcode them. |
| 132 | + |
| 133 | +## Reference guides |
| 134 | + |
| 135 | +Read these before tackling the relevant task: |
| 136 | + |
| 137 | +- **Scripting, JSON parsing, batch ops** → [references/scripting.md](references/scripting.md) |
| 138 | +- **Upgrades, restarts, maintenance workflows** → [references/upgrades.md](references/upgrades.md) |
| 139 | +- **VPC creation and network setup** → [references/vpc-setup.md](references/vpc-setup.md) |
0 commit comments