aws-cli

aws-cli is a cursor rule for Cursor from sanjeed5/awesome-cursor-rules-mdc. It costs 2,197 tokens per session, scanned C, original, CC0-1.0.

Rules for using the AWS command-line tool, which lets scripts and terminals manage Amazon Web Services resources. They focus on secure, repeatable commands and keeping environments separate.

In plain words
What is it for?
Use it when writing AWS commands or scripts for development, testing, production, or continuous integration, including commands that inspect or modify cloud resources.
Why use it?
Cloud commands can change the wrong account or environment, especially when using default credentials. These rules reduce accidental changes and inconsistent automation.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is ./scripts/validate_s3_bucket.sh --profile test.

Good fit Use it when writing AWS commands or scripts for development, testing, production, or continuous integration, including commands that inspect or modify cloud resources.

Compare 6 cursor rules from other repositories ↓
About the project

awesome-cursor-rules-mdc is a generator that creates Cursor MDC rule files from structured library information, using semantic search and language models to gather and organize guidance. Developers use it to produce reusable rules for libraries in Cursor, and the catalogue includes 200 of those rules.

sanjeed5/awesome-cursor-rules-mdc · 3,574 stars · on GitHub

Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/sanjeed5/awesome-cursor-rules-mdc
agentmods
npx agentmods add rules/sanjeed5/awesome-cursor-rules-mdc/aws-cli

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for aws-cli

README.md
[![agentmods](https://agentmods.dev/badge/rules/sanjeed5/awesome-cursor-rules-mdc/aws-cli/github.svg)](https://agentmods.dev/rules/sanjeed5/awesome-cursor-rules-mdc/aws-cli)
Your own site
<a href="https://agentmods.dev/rules/sanjeed5/awesome-cursor-rules-mdc/aws-cli"><img src="https://agentmods.dev/badge/rules/sanjeed5/awesome-cursor-rules-mdc/aws-cli/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for aws-cli

Your own site · 80×15
<a href="https://agentmods.dev/rules/sanjeed5/awesome-cursor-rules-mdc/aws-cli"><img src="https://agentmods.dev/badge/rules/sanjeed5/awesome-cursor-rules-mdc/aws-cli.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,197 This file is loaded in full into every session.
When invoked 2,197 The same file — it is already loaded in full.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.02197 $0.02197
Opus 5.5 $0.00879 $0.00879
Sonnet 5.5 $0.00439 $0.00439
Haiku 4.5 $0.00220 $0.00220

Measured 1mo ago against content hash de04367bc5d9, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade C, and why

aws-cli scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reaches for credential fileshighPrivilege escalation

SSH keys, cloud credentials, git-credentials, .npmrc, /etc/shadow: reading these is how a config file becomes a credential leak.

# Credentials managed in ~/.aws/credentials or assumed via IAM role
rules-mdc/aws-cli.mdc · 242 lines

How it starts

The opening of the file, as written. The whole thing — 242 lines — stays where its author put it; the contents beside it link to each section on GitHub.

aws-cli Best Practices

The AWS CLI is your primary interface for programmatic interaction with AWS. Adhering to these best practices ensures your CLI usage is secure, reproducible, and efficient, aligning with modern DevOps principles.

1. Code Organization and Structure

Organize your AWS CLI interactions into well-defined scripts or functions. Avoid one-off commands for anything beyond simple queries.

1.1. Use Named Profiles for Environment Segregation

Always define multiple named profiles for different environments (e.g., dev, test, prod) and projects. This prevents accidental operations in the wrong account.

❌ BAD: Relying on default profile or constantly switching credentials.

# Easy to accidentally target production
aws s3 rm s3://my-prod-bucket --recursive

✅ GOOD: Explicitly using named profiles.

# ~/.aws/config
# [profile dev]
# region = us-east-1
# output = json

# [profile prod]
# region = us-east-1
# output = json

# In your script or terminal
aws s3 ls --profile dev
aws s3 rm s3://my-dev-bucket --recursive --profile dev

1.2. Pin AWS CLI Version in CI/CD

Ensure consistent behavior by pinning the AWS CLI version in automated environments. Use awscli-v2 for modern features and stability.

❌ BAD: Relying on the latest available version in CI/CD.

# .github/workflows/deploy.yml
# ...
# - name: Install AWS CLI
#   run: pip install awscli # Installs latest, potentially breaking changes

✅ GOOD: Using a specific, tested version (e.g., via Docker).

# .github/workflows/deploy.yml
# ...
- name: Deploy with AWS CLI v2
  uses: docker://amazon/aws-cli:2.15.30 # Pin to a specific, validated version
  with:
    args: s3 sync ./app s3://my-bucket-name --delete --profile prod

2. Common Patterns and Anti-patterns

Adopt patterns that promote automation, idempotency, and machine-readability.

2.1. Prefer JSON Output and jq for Parsing

Always output in json format and use jq for robust, idempotent parsing. Avoid parsing human-readable formats like text or table.

Read the full file on GitHub · 242 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 242 lines · 0 tokens per session scan C de04367bc5d9

Subscribe to this mod's changes

aws-cli is a cursor rule published in the GitHub repository sanjeed5/awesome-cursor-rules-mdc (3,574 stars, last pushed 5mo ago), licensed CC0-1.0. It adds 2,197 tokens to every session, about $0.0088 per session on Opus 5.5. A static security scan graded it C with 1 finding (reaches for credential files). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.