awsesh
A modern AWS SSO session manager based on an SDK, with an interactive TUI, powerful CLI and a desktop app.

Features
- Interactive terminal UI for managing AWS SSO sessions
- Interactive CLI if that’s more your jam
- Native desktop app (macOS and Windows) if you prefer to not use the terminal
- Fast fuzzy search across accounts and roles
- Multiple SSO profile support
- Automatic credential management
- Remappable keybindings
- Browser integration for quick AWS Console access
- Shell integration with environment variable exports
- Reusable SDK for building your own tools
- XDG Base Directory compliant
Installation
Homebrew TUI/CLI (macOS/Linux)
brew tap elva-labs/elva
brew install awsesh
Pre-built Binaries
Download the latest release from the Releases page.
MacOS Desktop Application
brew install --cask elva-labs/elva/awsesh-desktop
Windows Desktop Application
Now also supports WSL!
scoop bucket add elva https://github.com/elva-labs/scoop-elva
scoop install elva/awsesh-desktop
Build from Source
Requires Bun 1.4.4+
git clone https://github.com/elva-labs/awsesh.git
cd awsesh
bun install
bun run build
Desktop Application
The native macOS and Windows app is built with Rune.
macOS installs through Homebrew; Windows
installs through Scoop or an unsigned portable ZIP on the Releases page. See
packages/desktop/README.md for the package layout
and build prerequisites.
To build the desktop app for the current platform:
bun run build:desktop

Interactive TUI
Launch the interactive terminal interface:
awsesh

Navigation
| Key |
Action |
j / k or arrows |
Navigate up/down |
Enter |
Select item |
Esc / Backspace |
Go back |
/ |
Start fuzzy search |
Ctrl+P |
Open command palette |
? |
Show help |
Managing SSO Profiles

| Key |
Action |
n |
Add new SSO profile |
e |
Edit selected profile |
d |
Delete selected profile |
o |
Open SSO dashboard in browser |
Account & Role Selection

| Key |
Action |
r |
Set custom region for account |
R |
Refresh account list |
b |
Open account in AWS Console |
p |
Set custom profile name |
Active Sessions
View and manage your active credential sessions:

CLI
Use awsesh directly from the command line for scripting and automation.

Quick Usage
# Set credentials
awsesh set
# Set credentials for a specific role
awsesh set <sso-profile> <account-name> <role-name>
# Select a session, account, and role explicitly
awsesh session <sso-session> <account-name> <role-name>
# Check current identity
awsesh whoami
# List active sessions
awsesh sessions
# List cached accounts
awsesh accounts
Commands
| Command |
Description |
awsesh |
Launch interactive TUI |
awsesh set [sso] [account] [role] |
Set credentials interactively or directly |
awsesh whoami |
Show the current role or access set recorded by awsesh |
awsesh sessions |
List active credential sessions |
awsesh accounts |
List cached AWS accounts |
awsesh credentials |
List credentials in ~/.aws/credentials |
awsesh session <sso> <account> [role] |
Select credentials directly |
awsesh auth <sso> |
Authenticate with SSO |
awsesh access-set list/define/replace/remove/exec |
Manage and assume saved AWS access sets |
awsesh migrate |
Migrate from old awsesh config |
awsesh config |
Open config directory |
awsesh data |
Open data directory |
Options
awsesh [options]
Options:
-e, --eval Output environment variables for shell eval
-b, --browser Open AWS Console in browser
-r, --region <region> Override region for this session
-p, --profile <name> Use custom profile name
-v, --version Show version
-h, --help Show help
Access Sets
- Desktop: Choose Access sets in the sidebar, then Create set or select
an existing set. Use Add profile, Edit, or Remove to manage its
aliases. Double-click a saved set to assume it, or right-click it for
Assume, Rename, and Delete. Assuming obtains credentials for each
member under its alias.
- TUI: Press
s on the sessions screen. Press a to create a set, or
Enter to inspect one. Inside a set, a adds a profile and Enter on a
profile opens its actions. Press d to remove the highlighted profile, or
press d in the sets list to delete the highlighted set. Both ask for
confirmation. Press o to assume the set without leaving the TUI.
An access set contains one named profile per AWS account. Assuming the set
updates its named profiles in your normal AWS files, just as Assume set
does in the desktop and TUI. The CLI command returns without opening a shell.
The default profile stays unchanged: use aws --profile <alias> … to select a
member. After assuming a set, awsesh whoami shows the set name and its active
profiles. awsesh whoami --json reports the name in accessSet and the active
members in profiles. Use aws --profile <alias> sts get-caller-identity to
check which identity AWS uses for a member of the set.
In the TUI and desktop editors, leave the profile alias blank to use the
suggested account-and-role name (for example, payments-dev-readonly).
Each --profile takes an alias, an existing local SSO session name, a 12-digit
account ID, and an IAM role name.
awsesh access-set define delivery \
--profile dev company 012345678901 Developer \
--profile prod-read company 098765432109 ReadOnly
awsesh access-set list
awsesh auth company
awsesh access-set exec delivery
aws --profile dev sts get-caller-identity
aws --profile prod-read sts get-caller-identity
Pass -- followed by a command to assume the set, run the command once, and
return its exit status:
awsesh access-set exec delivery -- aws --profile dev sts get-caller-identity
To expose a set only to the current terminal and its child processes, use
--eval (-e) without a command. In Bash or Zsh:
eval "$(awsesh access-set exec delivery --eval)"
aws --profile dev sts get-caller-identity
aws --profile prod-read sts get-caller-identity
In Fish:
eval (env SHELL=(status fish-path) awsesh access-set exec delivery --eval | string collect)
The scoped environment clears inherited AWS credential selectors and has no
default profile. It uses a private cached config containing the aliases and
credential_process commands; it leaves your normal AWS files and awsesh whoami unchanged. A scoped profile obtains role credentials on demand while
the cached SSO login is valid. If it expires, run awsesh auth <session> again.
Exit the shell to discard the scoped environment. Cached configs contain no
AWS keys and are cleaned up after 30 days on a subsequent scoped activation.
Use replace <name> (or run define <name> again) with the complete list of
bindings to update an access set, including after renaming a referenced SSO
session. list --json prints the saved definitions, and remove <name> removes
a saved definition. awsesh access-sets and awsesh profiles are aliases.
Shell Integration
Add this to your shell config for seamless environment variable integration:
Bash/Zsh:
sesh() { # i personally prefer "sesh" over "awsesh"
eval "$(command awsesh --eval "$@")"
}
Fish:
function sesh
eval (env SHELL=(status fish-path) awsesh --eval $argv | string collect)
end
When you use --eval to select an individual role, awsesh exports AWS
credentials plus session metadata:
AWS_PROFILE
AWSESH_ACCOUNT_ID
AWSESH_ACCOUNT_NAME
AWSESH_ROLE_NAME
AWSESH_SESSION_NAME
AWS_REGION
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_SESSION_TOKEN
AWS_SESSION_EXPIRATION
SDK
The core functionality is available as a standalone SDK for building your own AWS SSO tools.
Installation
npm install @awsesh/core
# or
bun add @awsesh/core
Quick Start
import { createAwsesh } from "@awsesh/core"
const awsesh = createAwsesh({
configDir: "~/.config/awsesh",
dataDir: "~/.local/share/awsesh",
awsDir: "~/.aws",
})
// List SSO sessions
const sessions = await awsesh.sessions.list()
// Start SSO login
const session = await awsesh.sessions.get("my-org")
const loginInfo = await awsesh.sso.startLogin(session)
console.log(`Open: ${loginInfo.verificationUriComplete}`)
// Poll for token
const token = await awsesh.sso.pollForToken(session, loginInfo)
// List accounts
const accounts = await awsesh.sso.listAccounts(session, token.token)
// Get credentials
const creds = await awsesh.sso.getCredentials(session, token.token, accountId, roleName)
See the full SDK Documentation for detailed API reference.
For a complete working example, see the awsesh-sdk-example repository.
Themes
Awsesh includes 35 themes shared by the TUI and native desktop app. The TUI’s system
theme uses your terminal colors; desktop uses its native palette. Both discover
custom JSON definitions in ~/.config/awsesh/themes/, with independent selections.
See the shared theme format.

Migrating from Go Version
If upgrading from the original Go version of awsesh the mgiration should run automatically.
Otherwise you can run the migration command manually:
awsesh migrate
Options:
--dry-run - Preview changes without applying
--force - Force migration even if config exists
--no-backup - Skip backup (not recommended)
The migration converts your existing profiles, tokens, and preferences to the new JSON format.
Should the migration fail I suggest you to clean up your ~/.aws folder and remove most any awsesh files and the aws files .config and .credentials since they can interfere as well.
Configuration
awsesh follows XDG Base Directory specification:
| Location |
Purpose |
~/.config/awsesh/ |
Configuration files |
~/.local/share/awsesh/ |
Data storage (tokens, cache, preferences) |
~/.local/share/awsesh/logs/ |
Log files |
Settings
Access settings via Ctrl+P > Settings in the TUI, or edit ~/.config/awsesh/config.json:
{
"theme": "dark",
"logLevel": "info"
}
Releases
Choose an unused version and run these steps in the same shell. Never move an
existing tag or replace staged artifacts.
1. Prepare a version PR
version=1.1.3
git fetch origin main
git switch -c "release/v$version" origin/main
bun run release:prepare "$version"
git add package.json bun.lock packages/*/package.json packages/desktop/Cargo.toml packages/desktop/Cargo.lock
git commit -m "chore(release): prepare v$version"
git push -u origin "release/v$version"
gh pr create --base main --fill
Version-only PRs use a fast check when the exact main base passed full CI.
Other changes still run the full suite.
2. Merge after review and CI, then tag the resulting commit
The merged commit is read from the version PR, including rebase merges.
If the release needs a later reviewed main commit, use that exact commit only
after its CI passes and confirm it still carries the prepared version.
git fetch origin main
commit=$(gh pr view "release/v$version" --json mergeCommit --jq '.mergeCommit.oid')
git tag "v$version" "$commit"
git push origin "v$version"
3. Wait for staging to pass, review the candidate, then publish
Pushing the tag builds the Windows and macOS/CLI/SDK artifacts in parallel,
then verifies and stages them as a draft release. Publishing uses those
verified artifacts; it does not rebuild them.
gh workflow run release.yml --ref "v$version" -f operation=publish -f tag="v$version"
Acknowledgments
Thanks to Anomaly for Rune,
which powers the desktop interface, and OpenTUI,
which powers the terminal interface. The structure of OpenCode
also inspired the awsesh refactor.
Thanks also to Zeron, whose open-source implementation inspired the desktop app’s look.
License
MIT - see LICENSE for details.
评论