Skip to content

Instantly share code, notes, and snippets.

@amzar96
Created September 23, 2024 04:55
Show Gist options
  • Save amzar96/4c3ec4e16783641b89086f46b5d1f9ed to your computer and use it in GitHub Desktop.
Save amzar96/4c3ec4e16783641b89086f46b5d1f9ed to your computer and use it in GitHub Desktop.
Display current AWS SSO account name in zsh prompt
function awslogin() {
local profile_name=$1
aws sso login --profile $profile_name
export AWS_PROFILE_NAME=$profile_name
echo change the AWS_PROFILE_NAME to $profile_name
}
RPROMPT='%{$fg[cyan]%}%* %{$fg[yellow]%}($AWS_PROFILE_NAME)%{$reset_color%}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment