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) ├────────────────────────────────────────┤ Disconnect [none] 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.

PowerShell 7+ — requires gh 2.49+
gh attestation verify Switch-AwsProfile-vX.Y.Z.zip --repo michaelsanford/Switch-AwsProfile
Example output
 gh attestation verify Switch-AwsProfile-vX.Y.Z.zip --repo michaelsanford/Switch-AwsProfile
Loaded digest sha256:2b67d674259090f7ee67ecb203a4284ab859bc7da30b3c678138a32755cf3548 for file://Switch-AwsProfile-vX.Y.Z.zip
Loaded 1 attestation from GitHub API

The following policy criteria will be enforced:
- Predicate type must match:................ https://slsa.dev/provenance/v1
- Source Repository Owner URI must match:... https://github.com/michaelsanford
- Source Repository URI must match:......... https://github.com/michaelsanford/Switch-AwsProfile
- Subject Alternative Name must match regex: (?i)^https://github\.com/michaelsanford/Switch-AwsProfile/
- OIDC Issuer must match:................... https://token.actions.githubusercontent.com

✓ Verification succeeded!

The following 1 attestation matched the policy criteria

- Attestation #1
  - Build repo:..... michaelsanford/Switch-AwsProfile
  - Build workflow:. .github/workflows/release.yml@refs/tags/vX.Y.Z
  - Signer repo:.... michaelsanford/Switch-AwsProfile
  - Signer workflow: .github/workflows/release.yml@refs/tags/vX.Y.Z

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