-
Notifications
You must be signed in to change notification settings - Fork 1
Add Claude Code skill and install command #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
d1e24b0
544ed4c
6501c75
d78d3f8
55d115a
fb35cbb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| package cmd | ||
|
|
||
| import ( | ||
| "embed" | ||
| "fmt" | ||
| "io/fs" | ||
| "os" | ||
| "path/filepath" | ||
|
|
||
| "github.com/spf13/cobra" | ||
| ) | ||
|
|
||
| //go:embed all:skills | ||
| var skillsFS embed.FS | ||
|
|
||
| var installCmd = &cobra.Command{ | ||
| Use: "install", | ||
| Short: "Install integrations", | ||
| } | ||
|
|
||
| var installSkillsCmd = &cobra.Command{ | ||
| Use: "skills", | ||
| Short: "Install Claude Code skills to ~/.claude/skills/", | ||
| Long: `Install the CloudAMQP CLI skills for Claude Code. | ||
|
|
||
| Skills teach Claude how to use the cloudamqp CLI. After installation, | ||
| Claude Code will automatically discover and use them. | ||
|
|
||
| Skills are installed to: ~/.claude/skills/cloudamqp-cli/`, | ||
| RunE: func(cmd *cobra.Command, args []string) error { | ||
| home, err := os.UserHomeDir() | ||
| if err != nil { | ||
| return fmt.Errorf("could not determine home directory: %w", err) | ||
| } | ||
| dest := filepath.Join(home, ".claude", "skills", "cloudamqp-cli") | ||
|
|
||
| err = fs.WalkDir(skillsFS, "skills/cloudamqp-cli", func(path string, d fs.DirEntry, err error) error { | ||
| if err != nil { | ||
| return err | ||
| } | ||
| // path relative to dest: strip "skills/cloudamqp-cli" prefix | ||
| rel, err := filepath.Rel("skills/cloudamqp-cli", path) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| target := filepath.Join(dest, rel) | ||
|
||
| if d.IsDir() { | ||
| return os.MkdirAll(target, 0755) | ||
| } | ||
| data, err := skillsFS.ReadFile(path) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| return os.WriteFile(target, data, 0644) | ||
| }) | ||
| if err != nil { | ||
| return fmt.Errorf("failed to install skills: %w", err) | ||
| } | ||
| fmt.Printf("Skills installed to %s\n", dest) | ||
| return nil | ||
| }, | ||
|
Comment on lines
+22
to
+62
|
||
| } | ||
|
|
||
| func init() { | ||
| installCmd.AddCommand(installSkillsCmd) | ||
| rootCmd.AddCommand(installCmd) | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,169 @@ | ||||||
| --- | ||||||
| name: cloudamqp-cli | ||||||
| description: Manage CloudAMQP instances, VPCs, teams, and RabbitMQ/LavinMQ configuration from the command line. Use when the user needs to create, configure, monitor, upgrade, or troubleshoot CloudAMQP message broker instances. | ||||||
| allowed-tools: Bash(cloudamqp:*) | ||||||
| --- | ||||||
|
|
||||||
| # CloudAMQP CLI | ||||||
|
|
||||||
| ## Quick start | ||||||
|
|
||||||
| ```bash | ||||||
| # list all instances | ||||||
| cloudamqp instance list | ||||||
|
|
||||||
| # get instance details (includes connection URL and API key) | ||||||
|
||||||
| # get instance details (includes connection URL and API key) | |
| # get instance details (prints connection URL with password masked; use --show-url for full URL, does not print API key) |
Copilot
AI
Mar 31, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section claims all commands support -o json/-o table and -fields, but many commands (e.g., instance create, vpc create, team invite) don’t use the shared output.Printer and therefore ignore -o/-fields (and often print non-JSON prefixes). Please narrow the claim to the commands that actually support these flags, or update examples accordingly.
| All commands support `-o json` for machine-readable output and `-o table` (default) for human-readable output. Use `-fields` to select specific columns. | |
| For commands that support it, use `-o json` for machine-readable output and `-o table` (default) for human-readable output. Use `-fields` where available to select specific columns. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| # Scripting and automation | ||
|
|
||
| ## JSON output for parsing | ||
|
|
||
| All commands support `-o json` for structured output. Combine with `jq` for extraction: | ||
|
|
||
| ```bash | ||
| # get connection URL for an instance | ||
| cloudamqp instance get --id 1234 -o json | jq -r '.url' | ||
|
|
||
| # list instance IDs matching a tag | ||
| cloudamqp instance list -o json | jq -r '.[] | select(.tags[]? == "production") | .id' | ||
|
|
||
|
||
| # get all instance names and plans | ||
| cloudamqp instance list -o json | jq -r '.[] | "\(.id) \(.name) \(.plan)"' | ||
| ``` | ||
|
|
||
| ## Create and capture instance ID | ||
|
|
||
| ```bash | ||
| RESULT=$(cloudamqp instance create --name=temp --plan=lemming --region=amazon-web-services::us-east-1 -o json) | ||
| INSTANCE_ID=$(echo "$RESULT" | jq -r '.id') | ||
| echo "Created instance: $INSTANCE_ID" | ||
|
||
| ``` | ||
|
|
||
| ## Wait for instance readiness | ||
|
|
||
| Use the built-in `--wait` flag (default timeout: 15 minutes): | ||
|
|
||
| ```bash | ||
| cloudamqp instance create --name=my-instance --plan=bunny-1 \ | ||
| --region=amazon-web-services::us-east-1 --wait --wait-timeout=20m | ||
| ``` | ||
|
|
||
| Or poll manually: | ||
|
|
||
| ```bash | ||
| while true; do | ||
| STATUS=$(cloudamqp instance get --id "$INSTANCE_ID" -o json | jq -r '.ready') | ||
| [ "$STATUS" = "true" ] && break | ||
| sleep 30 | ||
| done | ||
| ``` | ||
|
|
||
| ## Skip confirmations | ||
|
|
||
| Use `--force` on destructive commands: | ||
|
|
||
| ```bash | ||
| cloudamqp instance delete --id 1234 --force | ||
| ``` | ||
|
|
||
| ## Environment-based configuration | ||
|
|
||
| ```bash | ||
| export CLOUDAMQP_APIKEY="your-api-key" | ||
| cloudamqp instance list # no prompts | ||
| ``` | ||
|
|
||
| ## Batch operations | ||
|
|
||
| ```bash | ||
| # restart all instances tagged "staging" | ||
| for ID in $(cloudamqp instance list -o json | jq -r '.[] | select(.tags[]? == "staging") | .id'); do | ||
| echo "Restarting instance $ID" | ||
| cloudamqp instance restart-rabbitmq --id "$ID" | ||
| done | ||
| ``` | ||
|
|
||
| ## Clone an instance with full config | ||
|
|
||
| ```bash | ||
| cloudamqp instance create \ | ||
| --name=staging-copy \ | ||
| --plan=bunny-1 \ | ||
| --region=amazon-web-services::us-east-1 \ | ||
| --copy-from-id=1234 \ | ||
| --copy-settings=alarms,metrics,logs,firewall,config,definitions,plugins \ | ||
| --wait | ||
| ``` | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider setting
Args: cobra.NoArgsoninstallSkillsCmd(and possiblyinstallCmd) to match the rest of the CLI commands and to avoid silently accepting unexpected positional arguments (e.g.cloudamqp install skills extra).