synfinatic / aws-sso-cli

A powerful tool for using AWS Identity Center for the CLI and web console.
https://synfinatic.github.io/aws-sso-cli/
GNU General Public License v3.0
413 stars 49 forks source link

Make profile list interactive, to save typing #800

Open jabberwock opened 4 months ago

jabberwock commented 4 months ago

Is your feature request related to a problem? Please describe. I would like to be able to pull up aws-sso list but be able to, with a keyboard/mouse/tap/etc., select the profile to use.

Describe the solution you'd like I made this PoC for bash/zsh, and it requires the fzf program to be installed:

function aws-sso-select() {
    local aws_profile=$(aws-sso list | tail -n +5 | fzf --bind 'enter:execute(echo {7})+abort')
    eval $(/usr/local/bin/aws-sso eval -p $aws_profile)
}

Describe alternatives you've considered The alternative is shown in the PoC above. It works but I'd like to see it natively supported.

Additional context This simply saves me some time having to type aws-sso list, then aws-sso-profile, and pasting the profile. That's all. :)

synfinatic commented 4 months ago

It's a nice feature... just not sure about the fzf dependency.

jabberwock commented 4 months ago

No no. I was thinking of implementing it in Go. That fzf proof-of-concept is just that. I noticed you already have some keyboard/mouse interaction during the initial setup for selecting things and I figured it wouldn't be "too" hard to implement, but that could be my ignorance. I'll have a look at the codebase tomorrow and see if it's something I can do. Thanks!

-jw