aws-profile-switcher
Interactive terminal AWS profile switcher.
Source on GitHubPythonStars: 1last push 4 months ago
- Python 3.10+
- curses
- AWS CLI
- pytest
What it is
A curses TUI over ~/.aws/config that previews region, output format, SSO URL, role ARN and the live account ID before switching AWS_PROFILE, then updates .zshrc with an automatic backup.
Why it's interesting
Small, sharp developer tooling: safe mutation of a file people care about, read-only AWS calls, and no dependencies to install.
What I built
- INI parsing of ~/.aws/config with default first, then alphabetical; SSO and role-assumption profiles tagged in the list.
- Live account lookup via aws sts get-caller-identity, read-only and optional. Credentials are never read or stored.
- Confirmation before any write; ~/.zshrc backed up before every change; export AWS_PROFILE updated in place or appended.
- pytest coverage of profile discovery, metadata extraction, active-profile detection, config updates and backup creation.
Engineering concepts
- Developer tooling
- Safe file mutation
- Least privilege