awscli
/awscli
Expert AWS CLI assistance covering command-line options, profiles, JMESPath output queries (--query), and scripting automation. Use when querying AWS resources, automating deployments, and managing cloud services.
- Author
- G1Joshi ↗
- Repository
- Agent-Skills ↗
- Licence
- MIT
- Last repository change
- 01.10.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 3
No signals detected. Repository changed on 01.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Expert AWS CLI assistance covering command-line options, profiles, JMESPath output queries (--query), and scripting automation. Use when querying AWS resources, automating deployments, and managing cloud services.
Original author description
Expert AWS CLI assistance covering command-line options, profiles, JMESPath output queries (--query), and scripting automation. Use when querying AWS resources, automating deployments, and managing cloud services.
How it works
- When to Use
- Quick Start
- Core Concepts
- Common Patterns
- Best Practices
- Troubleshooting
- References
SKILL.md preview
---
name: awscli
description: Expert AWS CLI assistance covering command-line options, profiles, JMESPath output queries (--query), and scripting automation. Use when querying AWS resources, automating deployments, and managing cloud services.
---
# AWS CLI
The AWS Command Line Interface (CLI) enables programmatic management of AWS resources, with first-class support for AWS IAM Identity Center and credential automation.
## When to Use
- **Scripting & Automating AWS Operations**: Managing cloud resources from shell scripts and CI/CD runners via `aws`.
- **Querying AWS Resources with JMESPath**: Filtering and extracting precise JSON properties using `--query`.
- **High-Speed S3 File Synchronization**: Syncing gigabytes of assets with parallel multi-part transfers (`aws s3 sync`).
- **AssumeRole & Temporary Credential Management**: Generating STS temporary tokens for secure script execution.
## Quick Start
```bash
# Install v2
curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"
sudo installer -pkg AWSCLIV2.pkg -target /
# Configure with AWS IAM Identity Center (SSO)
aws configure sso
# SSO session name: my-session
# SSO start URL: https://my-org.awsapps.com/start
# SSO region: us-east-1
# Registration scopes: sso:account:access
```
```bash
# Login daily
aws sso login --profile my-profile
```
## Core Concepts
### JMESPath Filtering & Formatting
Querying specific fields without installing jq:
```bash
# List EC2 instance IDs, private IPs, and states in a formatted table
aws ec2 describe-instances \
--filters "Name=instance-state-name,Values=running" \
--query "Reservations[*].Instances[*].{ID:InstanceId,IP:PrivateIpAddress,Type:InstanceType,Name:Tags[?Key=='Name']|[0].Value}" \
--output table
# Extract single value as raw text
INSTANCE_ID=$(aws ec2 describe-instances \
--filters "Name=tag:Environment,Values=production" \
--query "Reservations[0].Instances[0].InstanceId" \
--output text)
```
### High-Throughput S3 Synchronization
Syncing build artifacts with cache headers:
```bash
# Sync static website assets with immutable caching
aws s3 sync dist/ s3://production-static-assets-2026/ \
--delete \
--cache-control "public, max-age=31536000, immutable" \
--exclude "*.html"
# Upload HTML entrypoints with no-cache header
aws s3 sync dist/ s3://production-static-assets-2026/ \
--exclude "*" \
--include "*.html" \
--cache-control "no-cache, no-store, must-revalidate"
```
### AssumeRole with AWS STS
Assuming cross-account deployment roles securely:
```bash
# Assume production deployment role
CREDENTIALS=$(aws sts assume-role \
--role-arn "arn:aws:iam::123456789012:role/ProductionDeployerRole" \
--role-session-name "CICDDeploySession" \
--output json)
export AWS_ACCESS_KEY_ID=$(echo $CREDENTIALS | jq -r .Credentials.AccessKeyId)
export AWS_SECRET_ACCESS_KEY=$(echo $CREDENTIALS | jq -r .Credentials.SecretAccessKey)
export AWS_SESSION_TOKEN=$(echo $CREDENTIALS | jq -r .Credentials.SessionToken)
```
## Common Patterns
### Advanced JMESPath Filtering and Table Formatting
**Problem**: Inspecting hundreds of EC2 instances or S3 buckets returns overwhelming JSON output.
**Solution**:
Use `--query` with JMESPath projections:
```bash
# Extract running instance IDs, types, and private IPs into a clean table
aws ec2 describe-instances \
--filters "Name=instance-state-name,Values=running" \
--query "Reservations[].Instances[].[InstanceId, InstanceType, PrivateIpAddress, Tags[?Key=='Name'].Value | [0]]" \
--output table
```
## Best Practices
**Do**:
- Target AWS CLI v2 (`aws --version`) which includes native SSO and Pager integration.
- Use `--query` (JMESPath) for client-side filtering and `--filters` for server-side filtering.
- Configure AWS IAM Identity Center (`aws configure sso`) instead of long-lived access keys.
- Disable paging in automated shell scripts by setting `export AWS_PAGER=""`.
**Don't**:
- Commit `~/.aws/credentials` or access keys to Git repositories.
- Use `aws s3 cp` in loops for multi-file transfers; use `aws s3 sync` for automated diffing.
- Parse AWS CLI JSON output with brittle `grep` or `awk`; use `--output text` with `--query` or `jq`.
## Troubleshooting
| Error | Cause | Solution |
| :-------------------------------------------- | :-------------------------------------------------------------------- | :-------------------------------------------------------------------- |
| `The config profile (...) could not be found` | Profile name not declared in `~/.aws/config` or `~/.aws/credentials`. | Run `aws configure --profile <name>` or verify `AWS_PROFILE` env var. |
| `An error occurred (RequestLimitExceeded)` | Script calling AWS CLI in a tight loop without rate limiting. | Add sleep delays or use AWS SDK with exponential backoff. |
| `Invalid value for --query: Syntax error` | JMESPath query has unescaped quotes or invalid projection syntax. | Test query string incrementally: start with `Reservations[0]`. |
## References
- [AWS CLI Documentation](https://aws.amazon.com/cli/)
Versions
The database has no other skills named awscli.
Database snapshot: 13.11.2026 · package version 2d8f9bd0d468 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100azurecli
Expert Azure CLI (az) assistance covering command automation, JMESPath queries, resource templates, and DevOps scripts. Use when scripting Azure management tasks and deploying cloud resources. - 100aws-cli-beast
Provides advanced AWS CLI patterns for managing EC2, Lambda, S3, DynamoDB, RDS, VPC, IAM, and CloudWatch. Generates bulk operation scripts, automates cross-service workflows, validates security configurations, and executes JMESPath queries for complex filtering. Triggers on "aws… - 100aws
Expert AWS CLI guidance. Use when the task involves aws commands or the AWS CLI — installing, updating, or pinning AWS CLI v2 (and migrating scripts off the end-of-support v1), authentication issues ("Unable to locate credentials", "ExpiredToken", "The SSO session has expired",… - 100aws-cli
AWS CLI v2 command syntax and scripting: secure authentication (aws login, Identity Center SSO, assume-role profiles, instance/task roles), output formats, JMESPath queries, pagination, waiters, IAM operations, S3, Lambda, RDS, CloudFormation, ECS, EKS, CloudWatch, SSM, Route… - 100aws-cli
The AWS Command Line Interface (v2) manages Amazon Web Services from the terminal. Use when the user needs to run S3, EC2, Lambda, CloudWatch, IAM or other AWS commands, sign in with SSO or short-term credentials, write AWS automation scripts, or debug an `aws` command and its output. - 100gcloud
Expert Google Cloud CLI (gcloud) assistance covering configurations, service accounts, IAM impersonation, and Cloud SDK scripting. Use when automating GCP resources and deploying Google Cloud services.