Sesh is an AWS SSO session manager. I've been using it since the early releases. It handles the part of AWS SSO (IAM Identity Center) that gets annoying fast: Signing in, picking an account and role, and keeping the credentials fresh. Alvin Johansson built it, and the project is open source under Elva Labs.

The one gap for me was my editor. I switch between a few AWS accounts and roles, and I work in both VS Code and Kiro. I wanted a repo to open on the right profile without me thinking about it. I also wanted the integrated terminal to use that profile.

So I built Sesh AWS SSO, a community extension for VS Code and compatible editors, including Kiro, Cursor, Windsurf, and VSCodium. Sesh is the session manager. Sesh AWS SSO is the editor extension.

What It Does

The extension uses your Sesh sessions and credentials.

  • Status bar with the current account, role, and expiry. Click it to switch.
  • Activity bar view with sessions, accounts, roles, and active credentials.
  • Command palette actions for switching, signing in and out, clearing credentials, opening the AWS Console, copying the account ID or profile, and refreshing.
  • Terminal environment integration. The selected profile is applied to integrated terminals.
  • Workspace binding, which is the feature I use most.
  • Optional auto-refresh before the credentials expire.

Sesh AWS SSO in VS Code

The screenshots use the demo data from the extension repo.

Workspace Binding

A workspace binding tells the extension which Sesh session, account, and role this repo should use. Add these three keys to your repo's .vscode/settings.json, replacing the demo values with your own:

{ "awsesh.workspace.session": "Demo Org", "awsesh.workspace.accountId": "111122223333", "awsesh.workspace.role": "AdministratorAccess", "awsesh.workspace.applyOnOpen": true } 

Workspace binding in .vscode/settings.json with the status bar showing the bound Dev account and AdministratorAccess role

Workspace binding in .vscode/settings.json, with the bound Dev account and AdministratorAccess role in the status bar.

When the workspace opens, the extension sees the binding and checks it against the active credential. If they don't match, it prompts once in a trusted workspace. Set awsesh.workspace.applyOnOpen to true if you want it to apply silently.

The integrated terminal gets the same profile. It sets AWS_PROFILE and AWS_REGION, and the AWS CLI and SDK resolve the credentials from ~/.aws/credentials. That means aws commands, SAM deploys, and anything else using the AWS SDK run against the account the repo expects. No more checking which account I'm in before a deploy.

How It Works

The extension uses the same Sesh sessions and credentials as the CLI, TUI, and desktop app. The Sesh desktop app does not need to be running. The extension reads the shared state. If you switch accounts in the desktop app or the CLI, the extension sees it within a minute or when the window regains focus. If you switch in the extension, the other clients see it too.

That means the extension uses the credentials Sesh already writes to ~/.aws/credentials. It does not keep a second copy or put AWS tokens or credentials in VS Code settings or secret storage.

In an untrusted workspace, the extension is read-only until you trust the folder. It shows the current credential, but it will not write credentials or change terminal environment variables.

The same extension is published to the Marketplace and Open VSX, so it works in VS Code and Kiro.

Sesh AWS SSO running in Kiro with the Sesh view and Dev / AdministratorAccess in the status bar

Sesh AWS SSO in Kiro. The Sesh view is on the left, and the active profile is in the status bar.

Getting Started

You'll need:

  • An existing SSO session in Sesh. If you don't use Sesh yet, start with the Sesh README or the releases. You can create a session with the CLI, TUI, or desktop app. Pick whichever you prefer. You do not need all three.
  • VS Code 1.90 or newer, or a compatible editor such as Kiro, Cursor, Windsurf, or VSCodium.
  • The AWS CLI if you want to verify the terminal profile.

Install it from the VS Code Marketplace or Open VSX. In VS Code, you can also run:

code --install-extension gunnargrosch.awsesh-vscode 

Kiro installs from Open VSX. If you use the Kiro CLI, install it with:

kiro --install-extension gunnargrosch.awsesh-vscode 

Try It Out

  1. Open the Sesh view in the activity bar.
  2. Expand your SSO session and click a role to set credentials. If the session is expired, run Sesh: Sign in first.
  3. Check the status bar. It should show the account, role, and expiry.
  4. Open a terminal and run aws sts get-caller-identity. It should return the account ID and role shown in the status bar.
  5. Run Sesh: Bind workspace to current credential. The command fills in the session, account, and role from the active credential and saves the binding for this repo.

Troubleshooting

Token has expired and refresh failed in the terminal

Sesh writes static credentials to ~/.aws/credentials. If ~/.aws/config also defines the same profile as an SSO profile, the AWS CLI prefers the SSO provider and ignores the static credentials.

If you see this, either use a different profile name for Sesh, or remove the sso_session, sso_account_id, and sso_role_name lines from that [profile ...] block in ~/.aws/config. Keep the [sso-session ...] block if you still want aws sso login --sso-session.

The tree is empty

Make sure Sesh can see your session. Run awsesh sessions in a terminal. If the session is there but the extension is not showing it, check that the extension reads the same Sesh directories. The defaults are ~/.config/awsesh and ~/.local/share/awsesh. On Windows, those are %USERPROFILE%\.config\awsesh and %USERPROFILE%\.local\share\awsesh. If you use awsesh.configDir and awsesh.dataDir, or run Sesh and the editor in different environments, make sure both point at the same place.

Conclusion

Sesh already solved the AWS SSO part of my day. The extension puts those sessions in the editor and lets the workspace decide which profile to use. The same extension covers VS Code and Kiro.

The extension is open source and community maintained. If you use AWS SSO and spend your day in VS Code or Kiro, give it a try.

If you work across multiple editors, how do you keep your AWS profiles straight? Let me know in the comments.

Additional Resources