Simple CLI for AWS SSO credential management across multiple accounts and roles
Project description
aws-assume
Simple CLI for AWS SSO credential management across multiple accounts and roles.
Installation
pip install aws-assume-cli
Usage
# Eval into your shell (most common usage)
eval $(aws-assume my-profile)
# List available profiles
aws-assume --list
# Output as JSON
aws-assume my-profile --json
# Write to a Docker .env file
aws-assume my-profile --env-file .env
# Write to ~/.aws/credentials
aws-assume my-profile --credentials
# Write credentials under a specific profile name
aws-assume my-profile --credentials --credentials-profile temp-dev
# Set session duration (for role assumption)
aws-assume my-profile --duration 3600
# Skip automatic SSO login prompt
aws-assume my-profile --no-auto-login
How it works
aws-assume reads your ~/.aws/config and supports three profile types:
SSO profiles — logs you in via aws sso login if the session is expired, then fetches temporary credentials.
[profile my-sso]
sso_start_url = https://my-org.awsapps.com/start
sso_region = us-east-1
sso_account_id = 123456789012
sso_role_name = AdministratorAccess
region = us-east-1
Role assumption profiles — assumes a role using another profile as the source.
[profile prod-admin]
role_arn = arn:aws:iam::999999999999:role/AdminRole
source_profile = my-sso
region = us-east-1
SSO + role chaining — the source profile itself uses SSO. aws-assume handles the chain automatically.
Output modes
| Flag | Output | Use case |
|---|---|---|
| (default) | export VAR=... |
eval $(aws-assume profile) in shell |
--json |
JSON object | Scripting, piping |
--env-file PATH |
Docker .env format |
docker run --env-file .env ... |
--credentials |
~/.aws/credentials |
SDK / tool compatibility |
Development
git clone https://github.com/Specter099/aws-assume-cli
cd aws-assume-cli
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aws_assume_cli-0.1.1.tar.gz.
File metadata
- Download URL: aws_assume_cli-0.1.1.tar.gz
- Upload date:
- Size: 10.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05de387e1b1862246de152313a250ed02a9dc66cffd639b3062821b8eb23ac84
|
|
| MD5 |
0db3ed476564db8cdc0d32c52edb3aeb
|
|
| BLAKE2b-256 |
379233826d6e4861a464c84ccc75297a039d079113c6902b7d38fe4cc4c39a2e
|
Provenance
The following attestation bundles were made for aws_assume_cli-0.1.1.tar.gz:
Publisher:
publish.yml on Specter099/aws-assume-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aws_assume_cli-0.1.1.tar.gz -
Subject digest:
05de387e1b1862246de152313a250ed02a9dc66cffd639b3062821b8eb23ac84 - Sigstore transparency entry: 999633974
- Sigstore integration time:
-
Permalink:
Specter099/aws-assume-cli@bbbe7631e48f83a784d33348a5267728c3a8fe5e -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Specter099
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bbbe7631e48f83a784d33348a5267728c3a8fe5e -
Trigger Event:
release
-
Statement type:
File details
Details for the file aws_assume_cli-0.1.1-py3-none-any.whl.
File metadata
- Download URL: aws_assume_cli-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
48fb598fe080716ac678b6ea51a220a568c095d8acde4b0c93b5b7a3e546e01a
|
|
| MD5 |
e1535b979f1162443d9e89930cdbc044
|
|
| BLAKE2b-256 |
6c260e1cef586b8c25b0fe8663022be61fc001a6859a6cab9ee7351a93f77df6
|
Provenance
The following attestation bundles were made for aws_assume_cli-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on Specter099/aws-assume-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aws_assume_cli-0.1.1-py3-none-any.whl -
Subject digest:
48fb598fe080716ac678b6ea51a220a568c095d8acde4b0c93b5b7a3e546e01a - Sigstore transparency entry: 999634038
- Sigstore integration time:
-
Permalink:
Specter099/aws-assume-cli@bbbe7631e48f83a784d33348a5267728c3a8fe5e -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Specter099
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bbbe7631e48f83a784d33348a5267728c3a8fe5e -
Trigger Event:
release
-
Statement type: