
whoiam is a lightweight CLI that keeps you oriented across multiple AWS accounts.

Modern AWS setups involve a lot of accounts. Development, staging, production, sandboxes, client environments — and engineers switching between them constantly. Most credential tools are great at getting you into an account. whoiam answers the question you need answered before you act: am I in the right one?
Before any command runs, whoiam calls sts:GetCallerIdentity and compares the result against the account you declared you expected to be in. If they match, the command runs. If they don't, it exits immediately — before a single byte of infrastructure changes.
Features
- Verify before you act — asserts the right account before any command runs, so context switches don't turn into incidents
- Multi-account aware — map all your environments (dev, staging, production, sandbox) in one config and switch between them with a single command
- Works with any credential source — aws-vault, SSO, instance profiles, environment variables; if the AWS SDK can see it, whoiam can verify it
- AWS_PROFILE support — if your profile name matches an account in your config, whoiam uses it automatically; no extra flags needed
- Shareable account map — commit
.whoiam/whoiam.yaml so the whole team uses the same account IDs; personal session state stays out of git
- CI and pipeline friendly —
whoiam validate exits non-zero on mismatch, making it a drop-in pre-flight check for any pipeline
Installation
Homebrew
brew tap cliwright/cliwright
brew install whoiam
Download Binary
Download pre-compiled binaries from the releases page.
Build from Source
git clone https://github.com/cliwright/whoiam.git
cd whoiam
go build -o whoiam
Quick Start
Initialize a project-local config:
whoiam init
Edit .whoiam/whoiam.yaml to add your account mappings:
accounts:
production: "123456789012"
staging: "210987654321"
development: "345678901234"
Pin the expected environment for this session:
whoiam set production
Run commands safely — whoiam verifies the account first:
whoiam exec -- terraform apply
Documentation
Full documentation at https://whoiam.cliwright.dev/.
License
Apache License 2.0. See LICENSE for details.