AWS CLI v2
$ aws Official High RiskAWS CLI v2 exposes virtually every AWS service via unified, predictable conventions: --output json, client-side JMESPath filtering (--query), --no-cli-pager for headless shells, --profile account isolation, and --dry-run on supported EC2/IAM calls.
brew install awscli LLMs are heavily pre-trained on aws CLI syntax; --output json + --query gives complete AWS API coverage with zero MCP schema overhead.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Uniform --output json, built-in JMESPath --query filtering, AWS_PAGER="" / --no-cli-pager, and --generate-cli-skeleton introspection make AWS CLI remarkably predictable for agents.
- Supports
--output json,--query,--no-cli-pager, and--generate-cli-skeleton - v2 enables pager by default unless
AWS_PAGER=""or--no-cli-pageris passed
IAM least-privilege roles, --profile isolation, STS short-lived tokens, and --dry-run on EC2 services are strong, though cloud blast radius and billing risk remain high if misconfigured.
- Supports
--profile, STS temporary creds, and--dry-run(EC2/selected APIs) - High potential billing/destructive impact under overly broad IAM permissions
Bundled standalone installer across macOS, Linux, and Windows, though install footprint is heavier than lightweight Go/Rust CLIs.
- Official installers and Homebrew
awsclipackage
Covers 300+ AWS services in a single binary; models already know its conventions deeply from pretraining.
- Complete AWS service API coverage with
--queryprojection
First-party AWS tool (aws/aws-cli) updated almost daily in lockstep with AWS service launches.
- Official
aws/aws-clirepository under Apache-2.0
Exhaustive offline <service> <op> help pages and online reference.
- Built-in
aws <service> helpdocumentation
Security, Auth & Guardrails
Reads profiles from ~/.aws/credentials & ~/.aws/config, AWS SSO cache, or AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY / AWS_SESSION_TOKEN.
CLI is free (Apache-2.0); AWS API actions can provision costly cloud resources.
# AWS CLI Agent Rules - ALWAYS pass `--no-cli-pager` (or set `AWS_PAGER=""`) and `--output json`. - Run `aws sts get-caller-identity` first and pin `--profile` explicitly. - Use `--query` on `describe-*` / `list-*` calls to avoid context overflow. - Use ReadOnlyAccess IAM roles for investigation; never run `delete-*`, `terminate-*`, or `s3 rm --recursive` without approval.
Agent-Ready Command Recipes
Safe Read-Only Queries
aws sts get-caller-identity --output json --no-cli-pager
Always confirms which AWS account and IAM role the agent is operating under.
aws ec2 describe-instances --no-cli-pager --output json --query 'Reservations[].Instances[].[InstanceId,State.Name,InstanceType]'
Dramatically shrinks massive AWS JSON responses using --query.
Controlled Writes & Previews
--dry-run aws ec2 run-instances --dry-run --image-id ami-12345678 --instance-type t3.micro
Validates permissions and parameters without provisioning billable EC2 instances.
Strengths for Agents
- + Consistent
--output json+ JMESPath--queryacross hundreds of AWS services. - +
--generate-cli-skeletonlets agents inspect exact JSON input templates offline. - + Strong IAM /
--profile/ STS temporary credential boundaries.
Caveats & Pitfalls
- ! AWS CLI v2 opens
lesspager by default—always setAWS_PAGER=""or pass--no-cli-pager. - !
--dry-runis supported on EC2 and select APIs, not universally across all AWS services.