Before:
PROFILE ROLE ARN EXPIRATION REMAINING STATUS
----------------------------------------------------------------------------------------------------
prod-admin arn:aws:iam::123456789012:role/AdminRole 2025-11-20 10:30:00 45m30s ACTIVE
After:
Active Sessions
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
🟢 prod-admin ← current AdminRole (123456789012) 45m remaining
Expires: 2025-11-20 10:30:00
🔒 mfa-session MFA Session 11h45m remaining
Expires: 2025-11-20 22:30:00
Expiring Soon
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
🟡 staging DevOpsRole (987654321098) 12m remaining
Expires: 2025-11-20 09:42:00
Expired Sessions
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
🔴 old-session ReadOnlyRole (111222333444) expired
Expires: 2025-11-19 18:00:00
Features:
- ✅ Status icons: 🟢 Active | 🟡 Expiring | 🔴 Expired | 🔒 MFA Session
- ✅ Grouped by status (Active → Expiring → Expired)
- ✅ Account ID extraction from role ARN
- ✅ Role name extraction (cleaner display)
- ✅ Current session highlighting (← current)
- ✅ Better time formatting (11h45m instead of 11h45m30s)
- ✅ Dim styling for expired/secondary info
- ✅ Helpful onboarding message when no sessions exist
Before:
❌ You must specify --source, --profile, and --role.
After:
❌ Missing required parameters
--source: Source AWS profile or cloudctl session
--profile: Name for this session
--role: IAM role ARN to assume
💡 Example:
cloudctl login --source default --profile prod-admin --role arn:aws:iam::123456789012:role/AdminRole
Before:
Failed to load source profile default: ...
After:
❌ Profile 'default' not found
💡 Available AWS profiles:
• prod
• dev
• staging
💡 Available cloudctl sessions:
• mfa-session
• prod-admin
💡 To create a new profile:
aws configure --profile default
Before:
❌ Failed to get session token with MFA: ...
After:
❌ MFA authentication failed: InvalidClientTokenId: The security token included in the request is invalid
💡 Common issues:
• Check your MFA code is current (not expired)
• Verify MFA device ARN is correct
• Ensure device time is synchronized
• MFA ARN format: arn:aws:iam::<account-id>:mfa/<username>
Before:
❌ Failed to assume role: ...
After:
❌ Failed to assume role: AccessDenied: User is not authorized to perform: sts:AssumeRole
💡 Common issues:
• Check the role ARN is correct
• Verify the role's trust policy allows your source identity
• Ensure your source credentials have sts:AssumeRole permission
• Check if the role requires MFA (use --mfa flag)
💡 Role ARN format: arn:aws:iam::<account-id>:role/<role-name>
Before:
❌ Failed to load session for profile 'prod': ...
After:
❌ Profile 'prod' not found
💡 Available profiles:
• mfa-session
• prod-admin
• dev-readonly
Before:
❌ You must specify --secret or set CLOUDCTL_SECRET environment variable
After:
❌ Encryption secret required
💡 Set the secret:
export CLOUDCTL_SECRET="your-32-char-encryption-key"
eval $(cloudctl switch prod-admin)
-
cmd/status.go
- Added session grouping by status
- Added icon-based status indicators
- Added account ID and role name extraction
- Added current session detection and highlighting
- Added helpful onboarding message for empty state
- Improved time formatting
-
cmd/login.go
- Added detailed parameter validation with examples
- Added AWS profile listing on error
- Added cloudctl session listing on error
- Added MFA troubleshooting tips
- Added AssumeRole troubleshooting tips
- Added helper function
listAWSProfiles()
-
cmd/switch.go
- Added profile listing on error
- Added helpful setup instructions
- Improved secret missing message
-
cmd/mfa-login.go
- Added detailed parameter validation
- Added MFA troubleshooting tips
- Added profile not found handling
- Improved secret missing message
- ✅ Interactive Switch:
cloudctl switchnow opens a profile selector if no profile is provided. - ✅ Interactive Login:
cloudctl loginandmfa-loginprompt for missing parameters (Source Profile, Roles, etc.). - ✅ Visual Polish: Used
bubbleteaandlipglossfor modern CLI aesthetics.
- ✅ Tool Sync: Added
cloudctl syncto export sessions to~/.aws/credentialsfor external tool compatibility (Terraform, GUI apps). - ✅ Smart Alias: Updated
cloudctl initso theccsalias supports both direct switching (ccs prod) and interactive mode (ccswith no args). - ✅ Shell Completion: Enabled standard Cobra completion command (
cloudctl completion).
- Faster Troubleshooting - Users can immediately see what's wrong and how to fix it
- Better Onboarding - New users get helpful examples and guidance
- Reduced Support Burden - Common issues are self-documented
- Professional UX - Consistent emoji usage and formatting
- Improved Scannability - Grouped sessions and icons make status easier to read
- Context Awareness - Shows available options when something is missing
- Progress indicators for long operations
- Desktop notifications for expiring sessions
- Table filtering and sorting flags
- Daemon mode for background monitoring
- Quick action prompts after status display