Awsm
awsm (AWS Manager) is a standalone binary written in Go that simplifies the tedious process of switching between AWS profiles, handling MFA, assuming roles, and generating console sign-in links. It's a robust and portable replacement for shell function-based helpers.
Install / Use
/learn @AleG03/AwsmREADME
AWSM - AWS Manager
A powerful CLI tool to simplify working with AWS profiles, credentials, and sessions.
Features
- Profile Management: Easily switch between AWS profiles with interactive selection
- SSO Support: Complete AWS SSO (IAM Identity Center) integration with automatic profile generation
- MFA Support: Streamlined MFA token handling for IAM profiles
- Smart Conflict Resolution: Intelligent handling of profile name conflicts during creation
- Console Access: Open the AWS console in your browser with proper credentials
- Connect & Port Forwarding: Connect to EC2 instances via SSM and setup advanced port forwarding (RDS, remote hosts)
- Region Management: Easily switch between AWS regions
- Search & Discovery: Powerful search across profiles, account IDs, and SSO sessions with partial matching
- Browser Integration: Open the console in specific Chrome profiles or Firefox containers
- Shell Completion: Full autocompletion support for bash, zsh, fish, and PowerShell
- Interactive UI: Beautiful terminal interface with responsive design
- Import/Export: Backup and restore your AWS configuration
Installation
From Releases
Download the latest release for your platform from the Releases page.
Copy the binary to your PATH and run awsm from anywhere.
For MacOS users, you can also copy the binary into /usr/local/bin and run from everyone.
For arch linux users, the binary is available in the AUR.
Using Homebrew
If you have Homebrew installed, you can install awsm with:
brew tap aleg03/awsm
brew install awsm
From Source
git clone https://github.com/AleG03/awsm.git
cd awsm
go build -o awsm .
Usage
Profile Management
# List all profiles
awsm profile list
# List profiles with detailed information
awsm profile list --detailed
# Login to SSO profile and set as active
awsm profile set my-profile
# Change default region for a profile
awsm profile change-default-region my-profile eu-central-1
# Add new profiles
awsm profile add iam-user my-user # Add IAM user profile with access keys
awsm profile add iam-role my-role # Add IAM role with assumption
# Edit profiles
awsm profile edit my-profile # Edit existing profile interactively
# Delete profiles
awsm profile delete my-profile # Delete single profile
awsm profile delete --all-sso my-session # Delete all profiles for SSO session
awsm profile delete --force my-profile # Delete without confirmation
Interactive Profile Selection
# Interactive profile selector with arrow keys
awsm select
SSO Management
# Add SSO session to config and automatically generate profiles
awsm sso add my-session https://d-123456789.awsapps.com/start/ us-east-1
# Login to SSO session
awsm sso login my-sso-session
# Generate profiles from SSO (discovers all accounts/roles)
awsm sso generate my-sso-session
# List all SSO Sessions
awsm sso list
# List SSO Sessions with detailed information
awsm sso list --detailed
# Delete SSO session and all associated profiles
awsm sso delete my-session # Interactive deletion
awsm sso delete --force my-session # Delete without confirmation
Credential Management
Clear all credentials from default profile
awsm clear
Export/Import configurations
awsm export [output-file] # Export all profiles and SSO sessions awsm import <export-file> # Import from export file awsm import --force <export-file> # Import without confirmation
### Console Access
AWSM can open the AWS console in your browser with proper credentials. It supports both Chrome profiles and Firefox containers for better organization.
#### Basic Usage
```bash
# Open AWS console in default browser
awsm console
# Just print the URL without opening browser
awsm console --no-open
Chrome Profile Integration
To use Chrome profiles with AWSM, you need to configure profile mappings in your AWSM configuration file.
Step 1: Find Your Chrome Profile Numbers
Chrome stores profiles with numeric identifiers. To find your profile numbers:
- Open Chrome and go to
chrome://version/ - Look for the "Profile Path" - it will show something like:
Profile 1(for the first additional profile)Profile 2(for the second additional profile)Default(for the default profile)
Alternatively, you can check your Chrome profile directory:
- macOS:
~/Library/Application Support/Google/Chrome/ - Linux:
~/.config/google-chrome/ - Windows:
%LOCALAPPDATA%\Google\Chrome\User Data\
Step 2: Configure Profile Mappings
Create or edit ~/.config/awsm/config.toml and add your Chrome profile mappings:
[chrome_profiles]
work = "Profile 1"
personal = "Profile 2"
default = "Default"
company = "Profile 3"
Step 3: Use Chrome Profiles
# Open console in specific Chrome profile
awsm console --chrome-profile work
awsm console --chrome-profile personal
awsm console --chrome-profile default
Firefox Container Integration
For Firefox, AWSM uses the "Open external links in a container" extension to open AWS console links in specific containers.
Step 1: Install the Extension
- Install the Open external links in a container extension from Firefox Add-ons
- The extension allows external links to be opened in specific Firefox containers
Step 2: Use Firefox Containers
# Open console in Firefox container (uses profile name as container name)
awsm console --firefox-container
# This will attempt to open the AWS console in a Firefox container
# with the same name as your current AWS profile
Note: The container name will match your AWS profile name. If you have a profile named work-production, AWSM will try to open the console in a Firefox container named work-production.
Random Colors and Icons: When AWSM creates a new Firefox container, it automatically assigns a random color and icon from Firefox's available options. This helps visually distinguish between different AWS profiles. Available colors include: blue, turquoise, green, yellow, orange, red, pink, and purple. Available icons include: fingerprint, briefcase, dollar, cart, circle, gift, vacation, food, fruit, pet, tree, and chill.
Zen Container Integration
Same as Firefox, AWSM can open the AWS console in Zen browser containers.
Connect & Port Forwarding
AWSM provides a connect command (aliased as ssm or con) to connect to your EC2 instances via AWS Systems Manager (SSM) Session Manager without needing SSH keys or open inbound ports.
It also supports advanced port forwarding capabilities, including forwarding to remote hosts (like RDS databases) through an EC2 bastion.
Basic Usage
# Connect to an instance (opens interactive shell)
awsm connect i-0123456789abcdef0
# Select an instance interactively from a list of running instances
awsm connect
Port Forwarding
# Forward a remote port to your local machine
awsm connect i-0123456789abcdef0 --port-forwarding --remote-port 80 --local-port 8080
# Forward to a remote host (e.g., RDS) via the instance
awsm connect i-0123456789abcdef0 -p -r 5432 -H my-db.cluster-c1gqquowm81q.eu-west-1.rds.amazonaws.com
Configuration Files
You can define your connection parameters in a JSON file for easy reuse:
# connect.json
{
"instance_id": "i-0d7211b09c641f135",
"remote_host": "database-1.cluster-xxx.rds.amazonaws.com",
"remote_port": 5432,
"local_port": 5432
}
# Use the config file
awsm connect -f connect.json
Region Management
# List all available AWS regions
awsm region list
# Set region for default profile
awsm region set us-west-2
Search and Discovery
# Search everything (profiles, account IDs, SSO sessions)
awsm search my-profile # Find profiles containing 'my-profile'
awsm search 123456789012 # Find profiles with this account ID
awsm search 1234 # Find profiles with partial account ID
awsm search test # Find SSO sessions or profiles with 'test'
# Search specific types only
awsm search --account 8517 # Search only account IDs for '8517'
awsm search --profile prod # Search only profile names for 'prod'
awsm search --sso my-session # Search only SSO session names
# Case-sensitive search
awsm search --case-sensitive MyProfile
Installation
Shell Completion
AWSM supports tab completion for commands, subcommands, flags, and profile names across multiple shells.
Bash
Linux:
# Install completion
awsm completion bash | sudo tee /etc/bash_completion.d/awsm
# Reload your shell
source ~/.bashrc
macOS:
# Install bash-completion if not already installed
brew install bash-completion
# Install AWSM completion
awsm completion bash > $(brew --prefix)/etc/bash_completion.d/awsm
# Reload your shell
source ~/.bash_profile
Zsh
User-specific installation:
# Create completions directory
mkdir -p ~/.zsh/completions
# Generate completion file
awsm completion zsh > ~/.zsh/completions/_awsm
# Add to ~/.zshrc (if not already present)
echo 'fpath=(~/.zsh/completions $fpath)' >> ~/.zshrc
echo 'autoload -U compinit && compinit' >> ~/.zshrc
# Reload your shell
source ~/.zshrc
System-wide installation (macOS):
# Install to system directory
sudo mkdir -p /usr/local/share/zsh/site-functions
sudo awsm completion zsh > /usr/local/share/zsh/site-functions/_awsm
# Reload your shell
source ~/.zshrc
Fish
# Create completions directory
mkdir -p ~/.config/fish/completions
# Generate completion file
awsm completion fish > ~/.config/fish/completions/awsm.fish
# Completions are autom
