home / skills / julianobarbosa / claude-code-skills / using-cloud-cli-skill
This skill helps you run cloud CLI commands for GCP and AWS efficiently, with cost awareness and best-practice patterns.
npx playbooks add skill julianobarbosa/claude-code-skills --skill using-cloud-cli-skillReview the files below or copy the command above to add this skill to your agents.
---
name: using-cloud-cli
description: 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.
allowed-tools: Read, Bash, Grep, Glob
---
# Cloud CLI Patterns
Credentials are pre-configured. Use `--help` or Context7 for syntax.
## BigQuery
```bash
# 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)
```bash
# 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
```bash
# 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.md) - GCP service patterns and common commands
- [AWS.md](AWS.md) - AWS service patterns and common commands
- [scripts/](scripts/) - Helper scripts for common operations
This skill documents practical Cloud CLI patterns for Google Cloud (gcloud, bq) and AWS (aws). It focuses on safe, cost-aware commands for running queries, listing and describing resources, and automating common operations. Use it to reduce BigQuery costs, avoid accidental deletions, and standardize CLI usage across projects.
The skill provides canonical command examples and recommended flags for common tasks: dry-run and formatting for BigQuery queries, explicit project and quiet options for gcloud automation, and region, dry-run, and JMESPath filtering for AWS CLI calls. It highlights what to inspect (cost estimates, resource lists, schemas) and which flags to include to make results predictable and script-friendly. Commands are presented with the minimal, explicit options that reduce risk and improve observability.
How do I avoid unexpected BigQuery costs?
Run bq query with --dry_run to get bytes scanned, restrict columns and use partitioned tables, and prefer LIMIT only after cost checks.
When should I use --quiet?
Use --quiet in automated scripts after manual verification. Avoid it during exploratory work so you don’t miss prompts or warnings.