A simple CLI tool to manage AWS SSO sessions
Project description
Tori - AWS SSO Session Manager
Ultra-simple CLI tool to manage AWS SSO sessions across multiple organizations. Configure once per org, then just tori assume <account> and you're in!
Installation
Tori uses uv for dependency management.
# Install uv if you don't have it
brew install uv # or: curl -LsSf https://astral.sh/uv/install.sh | sh
# Sync dependencies and install tori in editable mode
uv sync
# Run tori via uv (no activation needed)
uv run tori --help
# Or activate the venv to use `tori` directly
source .venv/bin/activate
tori --help
Quick Start
- Configure Tori with your SSO details:
tori configure my-org
Enter your SSO start URL and region when prompted. Tori will authenticate and cache all available accounts.
- List available accounts:
tori list
This shows all AWS accounts you have access to via SSO across all configured orgs.
- Assume a role:
tori assume my-account-name
This will:
- Authenticate with AWS SSO (if needed)
- Get temporary credentials
- Back up your current default profile (if exists) to a named profile
- Configure your default AWS CLI profile automatically
- You're ready to use AWS CLI immediately!
Commands
tori configure <org-name>
Configure AWS SSO settings for an organization. You can configure multiple orgs.
Example:
tori configure my-company
# Enter SSO start URL: https://my-company.awsapps.com/start
# Enter SSO region: us-east-1
The first org you configure becomes the default. All accounts will be cached automatically.
tori assume <account> [org-name]
Assume an AWS SSO role and configure the default AWS profile with credentials.
Examples:
# Assume by account name (uses default org)
tori assume production
# Assume by account ID
tori assume 123456789012
# Assume from specific org
tori assume production my-company
# Assume with specific role (skips interactive selection)
tori assume production my-company --role AdminRole
Profile Backup: When you assume a new role, Tori automatically backs up your current default profile to profile_<account_id>_<role_name> so you can switch back later.
tori refresh [org-name]
Refresh cached accounts for an organization. Use this when new accounts or roles are added.
Examples:
# Refresh default org
tori refresh
# Refresh specific org
tori refresh my-company
tori list [org-name]
List all configured orgs and their AWS SSO accounts.
Examples:
# List all orgs and accounts
tori list
# List accounts for specific org
tori list my-company
tori status
Check your current AWS credentials status and see all backed up profiles.
tori default <org-name>
Set the default organization to use when org name is not specified.
Example:
tori default my-company
Configuration
Tori stores its configuration in ~/.tori/config.yaml:
default_org: my-company
orgs:
my-company:
sso_start_url: https://my-company.awsapps.com/start
sso_region: us-east-1
cached_accounts:
production:
accountId: '123456789012'
accountName: production
email: aws-prod@company.com
roles:
- AdminRole
- ReadOnlyRole
another-org:
sso_start_url: https://another-org.awsapps.com/start
sso_region: us-west-2
cached_accounts: {}
active_profiles:
profile_123456789012_AdminRole:
account_id: '123456789012'
role_name: AdminRole
timestamp: '2025-11-21T10:30:00'
Credentials are automatically written to ~/.aws/credentials (default profile).
Multi-Org Workflow
Tori supports multiple SSO organizations:
- Configure multiple orgs:
tori configure company-prod
tori configure company-dev
tori configure client-org
- Set a default org (optional):
tori default company-prod
- Assume roles:
# Uses default org
tori assume my-account
# Uses specific org
tori assume my-account company-dev
- List all orgs:
tori list
Profile Management
When you assume a new role, Tori:
- Backs up your current default profile to a named profile
- Sets the new credentials as the default profile
- Tracks all backed up profiles in the config
Backed up profile naming: profile_<account_id>_<role_name>
View backed up profiles:
tori status
Switch back to a previous profile:
Simply use tori assume with the account and role you want to switch to.
How it Works
- One-time setup per org: Store your SSO start URL and region
- Automatic caching: Accounts and roles are cached during configuration
- Explicit refresh: Only re-fetch accounts when you run
tori refresh - Assume roles:
- Authenticate via AWS SSO (browser-based, only when needed)
- Get temporary credentials for the selected account and role
- Backup current default profile
- Write new credentials to default AWS profile
- Use AWS CLI normally!
No need to manage multiple profiles manually or remember account details - just use the account name!
Requirements
- Python 3.8+
- boto3 (AWS SDK)
- click (CLI framework)
- questionary (interactive prompts)
- pyyaml (config management)
- Internet connection for SSO authentication
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 ssof-0.1.0.tar.gz.
File metadata
- Download URL: ssof-0.1.0.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
48201cc573dc7970c16495278184ce01a870f3c14e22510684f85e85f1880a61
|
|
| MD5 |
dd5e9d15dc695c24ece4d5a1ba1eb424
|
|
| BLAKE2b-256 |
bfc3eb3362cdaec05c660ae6bfba8f4d5825fa737bf92e481221f772f46de373
|
Provenance
The following attestation bundles were made for ssof-0.1.0.tar.gz:
Publisher:
publish-pypi.yml on mrlikl/ssof
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ssof-0.1.0.tar.gz -
Subject digest:
48201cc573dc7970c16495278184ce01a870f3c14e22510684f85e85f1880a61 - Sigstore transparency entry: 1807202960
- Sigstore integration time:
-
Permalink:
mrlikl/ssof@c2a1e1ea07694d59d1e4e29e4c0dbb38e9b5a555 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/mrlikl
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@c2a1e1ea07694d59d1e4e29e4c0dbb38e9b5a555 -
Trigger Event:
release
-
Statement type:
File details
Details for the file ssof-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ssof-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb4e376d526cfbe4a819d5683fdba7157b8e854723e09c01ad4660147586ead2
|
|
| MD5 |
32530e2b32defc4c6dc571a170dee7ab
|
|
| BLAKE2b-256 |
a6a5403239c7a29921cb0d48fdb5ec7e1bd516f546cf7e00501cf49dd378ccc4
|
Provenance
The following attestation bundles were made for ssof-0.1.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on mrlikl/ssof
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ssof-0.1.0-py3-none-any.whl -
Subject digest:
eb4e376d526cfbe4a819d5683fdba7157b8e854723e09c01ad4660147586ead2 - Sigstore transparency entry: 1807203070
- Sigstore integration time:
-
Permalink:
mrlikl/ssof@c2a1e1ea07694d59d1e4e29e4c0dbb38e9b5a555 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/mrlikl
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@c2a1e1ea07694d59d1e4e29e4c0dbb38e9b5a555 -
Trigger Event:
release
-
Statement type: