Switch-AwsProfile

Interactive terminal menu for switching AWS SSO profiles — arrow keys, smart sort, instant login.

✓ Free & Open Source PowerShell 7+ Bash & Zsh Windows  ·  macOS  ·  Linux
Download Latest Release →
bash — 80×24
$ sap ┌────────────────────────────────────────┐ AWS SSO Profiles · A→Z (3/7) ├────────────────────────────────────────┤ dev-us-east-1 production-eu-west-1 sandbox staging-eu-central-1 └────────────────────────────────────────┘ ↑↓ Navigate [Enter] Select [S] Sort [Esc] Cancel

Everything you need, nothing you don't

Arrow key navigation

Move with or jump half a page with PgUp PgDn. The viewport scrolls automatically as your profile list grows.

Three sort modes

Press S to cycle: file order → A→Z → Z→A. Natural number sort keeps Admin-2 before Admin-10. Your position is preserved across sorts.

Instant login

Press Enter to set AWS_PROFILE in the current shell and immediately trigger aws sso login for the chosen profile.

Preflight checks

Fails fast with a clear error message if aws is not on PATH or ~/.aws/config does not exist — before anything else runs.

Zero dependencies

A single script file. No packages, no installer. Dot-source the .ps1 or source the .sh and you're done.

Verified builds

Every release is signed via Sigstore keyless attestation. Verify that what you downloaded is exactly what was built from source — with one command.

Installation

PowerShell 7+
# Extract to a permanent location
$dir = "$env:LOCALAPPDATA\Scripts"
New-Item -ItemType Directory -Path $dir -Force
Expand-Archive Switch-AwsProfile-vX.Y.Z.zip -DestinationPath $dir

# Add to your PowerShell profile and reload
Add-Content -Path $PROFILE -Value ". `"$dir\Switch-AwsProfile.ps1`""
. $PROFILE

Loads Switch-AwsProfile and the sap alias in every new shell session. Requires PowerShell 7+ and AWS CLI.

KeyAction
Move selection
PgUp PgDnJump half a page
SCycle sort mode
EnterSelect profile and login
EscCancel without changes

Build provenance

Every release artifact is signed with Sigstore keyless attestation via GitHub Actions — no keys to manage or rotate. The attestation cryptographically binds each file to the exact commit, workflow run, and repository that produced it.

Bash — requires gh 2.49+
# Verify before installing
gh attestation verify Switch-AwsProfile-vX.Y.Z.zip \
  --repo michaelsanford/Switch-AwsProfile

gh attestation verify switch-aws-profile-vX.Y.Z.tar.gz \
  --repo michaelsanford/Switch-AwsProfile

A passing result confirms the file was built from this repository's source and has not been modified since.