Skip to main content

aws-assume

CI PyPI License: MIT

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

Metadata

Release files for aws-assume-cli 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aws-assume-cli 0.1.1
File Size Uploaded Provenance Actions
aws_assume_cli-0.1.1.tar.gz 10.5 kB With provenance Details for aws_assume_cli-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aws-assume-cli 0.1.1
File Interpreter ABI Platform Actions
aws_assume_cli-0.1.1-py3-none-any.whl Python 3 none any Details for aws_assume_cli-0.1.1-py3-none-any.whl

Total release size: 19.4 kB

Release files / aws_assume_cli-0.1.1.tar.gz

Download URL aws_assume_cli-0.1.1.tar.gz
Size 10.5 kB
Tags Source
SHA-256 checksum
How to use checksums
05de387e1b1862246de152313a250ed02a9dc66cffd639b3062821b8eb23ac84
BLAKE2b-256 checksum
How to use checksums
379233826d6e4861a464c84ccc75297a039d079113c6902b7d38fe4cc4c39a2e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 26, 2026.

Transparency log

Release files / aws_assume_cli-0.1.1-py3-none-any.whl

Download URL aws_assume_cli-0.1.1-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
48fb598fe080716ac678b6ea51a220a568c095d8acde4b0c93b5b7a3e546e01a
BLAKE2b-256 checksum
How to use checksums
6c260e1cef586b8c25b0fe8663022be61fc001a6859a6cab9ee7351a93f77df6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 26, 2026.

Transparency log

Security for aws-assume-cli 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for aws_assume_cli-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page