aws-cli
Skill3 starsChanged 3 months agoMITView on GitHub
AWS CLI safety guardrails and account/role management for AI agents. Read before running any AWS CLI command. Covers environment setup, credential checking, account switching, pagination, and account-guard patterns. Triggers on any aws CLI invocation, account switching, SSO login, or when setting up a shell pane for AWS work.
- Reads credentials
4 other projects use a version of this.
Adopted by
Most recently taken up by
- epiccounty/aws-toolkittheir own version, first seen Sep 4, 2026
- timcase/agent-skillstheir own version, first seen Jul 19, 2026
- georgekhananaev/claude-skills-vaulttheir own version, first seen May 25, 2026
- abdullahkhawer/devops-skillstheir own version, first seen May 7, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- georgekhananaev/claude-skills-vault★ 28same name
- abdullahkhawer/devops-skills★ 8same name
- timcase/agent-skills★ 1same name
- epiccounty/aws-toolkit★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository86 other files it gives its agents.
- AGENTS.mdAGENTS.md
- adrSkill
- adzic-bddSkill
- agent-md-refactorSkill
- agent-muxSkill
- agent-role-impersonatorSkill
- agilquest-reservationsSkill
- ai-text-humanizerSkill
- architecture-decision-recordsSkill
- ast-grepSkill
- atacSkill
- bart-adversarial-reviewerSkill
- bddSkill
- branch-doctorSkill
- c4-architectureSkill
- c4Skill
- claude-sub-agentSkill
- codemap-config-setupSkill
- codemap-exploreSkill
- codemap-handoffSkill
- codemap-hub-safetySkill
- codemapSkill
- commitSkill
- copilot-sub-agentSkill
- daily-standupSkill
- daily-statusSkill
- debugSkill
- design-thinkingSkill
- doctorSkill
- docx-word-processorSkill
- farley-tddSkill
- forensicsSkill
- gemini-sub-agentSkill
- git-commit-formatterSkill
- git-forensicsSkill
- github-actions-permissionsSkill
- github-cliSkill
- git-repo-discoverySkill
- git-safety-guardrailsSkill
- harness-idpSkill
- humanizeSkill
- iteration-plannerSkill
- jira-issue-managerSkill
- justfile-assistantSkill
- kiro-sub-agentSkill
- lessons-learnedSkill
- lessonsSkill
- lisa-planning-agentSkill
- lovejoy-release-agentSkill
- lsp-code-analysisSkill
- macro-to-microSkill
- marge-product-agentSkill
- meeting-notesSkill
- mermaid-diagram-generatorSkill
- modern-cli-overridesSkill
- native-web-searchSkill
- obsidian-notetakerSkill
- outlook-headlessSkill
- pdf-document-processorSkill
- pi-sub-agentSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 2 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 20
Use aws-whoami (not bare aws sts get-caller-identity) — it prints all AWS_* env vars, shows active account roles with expiry, and calls sts …
- Distinctive: line 32
If credentials are expired: do not retry in a loop. Re-authenticate:
- Distinctive: line 72
Always assert the active account matches expectation before mutations:
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AWS CLI — Agent Safety Guardrails
Pre-flight: set before any AWS command
unset AWS_CLI_AUTO_PROMPT && export AWS_PAGER='' AWS_DEFAULT_OUTPUT=jsonAWS_CLI_AUTO_PROMPT— interactive autocomplete; blocks non-TTY execution, always unsetAWS_PAGER=''— preventslesscapturing output; empty string disables entirelyAWS_DEFAULT_OUTPUT=json— machine-readable; override per-command with--output textfor scalar extraction only
Identity and credential check
Use aws-whoami (not bare aws sts get-caller-identity) — it prints all AWS_* env vars,
shows active account roles with expiry, and calls sts get-caller-identity:
aws-whoamiKey env vars to note after aws-whoami:
AWS_SSO_PROFILE— the active profile (account-alias:RoleName)AWS_SSO_SESSION_EXPIRATION— credential expiry (ISO8601); check this before long operationsAWS_SSO_ACCOUNT_ID— current account ID; use to guard against wrong-account operations
If credentials are expired: do not retry in a loop. Re-authenticate:
aws-login [account-alias] # SSO login for a specific account
aws-login # SSO login, infers account from git repo nameList accounts and roles
aws-sso list # all accounts/roles with expiry
aws-sso list -P AccountAlias=tec-dce-inn-dev # filter by account alias prefix
aws-sso list -P AccountId=990136964265 # filter by account ID
aws-sso list -s AccountAlias # sort by aliasAvailable fields for -P filtering / -s sorting:
AccountAlias, AccountId, AccountIdPad, AccountName, Arn, DefaultRegion,
EmailAddress, Expires, ExpiresEpoch, Profile, RoleName, SSO, Via
The Profile column value is what goes into aws-login and AWS_SSO_PROFILE.
Switch account or role
aws-login tec-dce-inn-dev # login to account, auto-selects best role
aws-login tec-dce-inn-dev:_TECAdmin-Dev # login with explicit role suffix
aws-login tec-dce-inn-dev -c # login and open AWS consoleaws-login calls aws-sso eval -p <profile>, writes credentials to $AWS_SSO_CACHE,
then sources them into the shell. After login, aws-whoami confirms the active identity.
aws-sso-profile resolves the correct profile for an account alias (used internally by
aws-login; also useful to check what profile would be selected):
aws-sso-profile tec-dce-inn-devAccount guard: verify before destructive operations
Always assert the active account matches expectation before mutations:
EXPECTED_ACCOUNT=990136964265
ACTUAL_ACCOUNT=$(aws sts get-caller-identity --query Account --output text)
[[ "$ACTUAL_ACCOUNT" == "$EXPECTED_ACCOUNT" ]] || { echo "Wrong account: $ACTUAL_ACCOUNT"; exit 1; }AWS_SSO_ACCOUNT_ID is also available in the environment after aws-login / aws-whoami
for a no-API-call check.
Pagination
Many list-* / describe-* calls return only the first page by default. Always handle this:
# Small result sets — disable pagination entirely
aws ec2 describe-instances --no-paginate
# Large result sets — use auto-pagination (awscli v2)
aws ec2 describe-instances --output json # awscli v2 auto-paginates by default on most commandsSilent truncation is a common agent bug — if a result set seems incomplete, add --no-paginate
or check for NextToken in the response.
Retry and throttle behaviour
export AWS_RETRY_MODE=standard # exponential backoff on throttles (default: legacy)
export AWS_MAX_ATTEMPTS=5 # max retries before giving up (default: varies)Set these alongside the pre-flight block for long-running or high-volume sessions.
Per-command output patterns
# Scalar extraction
aws sts get-caller-identity --query Account --output text
# Structured extraction — prefer --query + json
aws ec2 describe-instances \
--query 'Reservations[*].Instances[*].{ID:InstanceId,State:State.Name}' \
--output json
# Table format — human readable, useful in watch loops
aws autoscaling describe-auto-scaling-instances \
--query 'AutoScalingInstances[?AutoScalingGroupName==`MY-ASG`].{Id:InstanceId,State:LifecycleState,Health:HealthStatus}' \
--output tableMFA / STS session (legacy accounts)
For accounts using MFA rather than SSO:
aws-sts-mfa-session login # prompt for MFA token, cache STS creds
aws-sts-mfa-session test # verify cached creds still valid
aws-sts-mfa-session refresh # force token refreshCreds are cached at $STS_SESSION_CACHE (default ~/.aws/sts-mfa-session.json).
To load from file into current shell:
aws-load-sts-session-from-file ~/.aws/sts-mfa-session.jsonDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

