Using cloud cli
Skill bg-szy/TOP-SKILLS/skills/claude-code-skills/using-cloud-cli
Cloud CLI patterns for GCP and AWS. Use when running bq queries, gcloud commands, aws commands, or making decisions about cloud services. Covers BigQuery cost optimization and operational best practices.From its SKILL.md
npx -y skills add bg-szy/TOP-SKILLS --skill using-cloud-cliAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 4 stars4 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.5 KB, 557 tokens by cl100k_base, as published. Nobody here has run it
Cloud CLI Patterns
Credentials are pre-configured. Use --help or Context7 for syntax.
BigQuery
# Always estimate cost first
bq query --dry_run --use_legacy_sql=false 'SELECT ...'
# Run query
bq query --use_legacy_sql=false --format=json 'SELECT ...'
# List tables
bq ls project:dataset
# Get table schema
bq show --schema --format=json project:dataset.table
Cost awareness: Charged per bytes scanned. Use --dry_run, partition tables, specify columns.
GCP (gcloud)
# List resources
gcloud compute instances list --format=json
# Describe resource
gcloud compute instances describe INSTANCE --zone=ZONE --format=json
# Create with explicit project
gcloud compute instances create NAME --project=PROJECT --zone=ZONE
# Use --quiet for automation
gcloud compute instances delete NAME --quiet
AWS
# List resources
aws ec2 describe-instances --output json
# With JMESPath filtering
aws ec2 describe-instances --query 'Reservations[].Instances[].InstanceId' --output text
# Explicit region
aws s3 ls s3://bucket --region us-west-2
# Dry run where available
aws ec2 run-instances --dry-run ...
References
- GCP.md - GCP service patterns and common commands
- AWS.md - AWS service patterns and common commands
- scripts/ - Helper scripts for common operations
Gotchas
gcloud auth loginandgcloud auth application-default loginare DIFFERENT credentials — a script working for the user can 401 in CI because CI only has the latter.- AWS CLI v1 vs v2 have different config formats — both may be installed;
aws --versionreveals which is the defaultawsbinary. - BigQuery cost estimation requires
--dry_run— without it, you can run a $100 query thinking it's free. Always estimate first. - Precedence:
AWS_PROFILEvs--profileflag vsAWS_ACCESS_KEY_IDdirect env — three-way precedence is order-dependent and rarely documented. - gcloud impersonation chains via
--impersonate-service-accountneed IAM token-creator on EACH hop — missing one hop returns 403 with vague "permission denied". aws sts get-caller-identityis the cheapest way to verify which credential you're actually using — always check first.
What ships with it: 2 files
5.0 KB alongside SKILL.md