Replies: 1 comment
-
You might be interested in the "Suggestions UI"1 It can't do exactly what you're describing quite yet. But, I think if you had a fragment with the command to enable each of the AWS sso profiles, all nested under one header, then you could get pretty close. Make a file2 that looks like this, and drop it into {
"actions": [
{
"name": "AWS Profiles...",
"commands": [
{
"command": {
"input": "doTheThing --enable profile1 -i --clearlyKnowAws",
"action": "sendInput"
},
"name": "Profile 1",
"description": "Enable AWS SSO profile 1"
},
{
"command": {
"input": "doTheThing --enable profile2 -i --clearlyKnowAws",
"action": "sendInput"
},
"name": "Profile 2",
"description": "Enable AWS SSO profile 2"
},
// etc... Then bind {
"command":
{
"action": "showSuggestions",
"source": "all",
"useCommandline": true // optional
},
} In your main It's not a single key chord per-profile, but it might scale out better than that. You think that would work for you? Footnotes |
Beta Was this translation helpful? Give feedback.
-
I've recently begun experimenting with using the AWS CLI in a backup role for our company's primary AWS engineer. My company has a bunch of AWS accounts (about 25+) for a variety of workloads, all managed through the AWS Org feature + using SSO.
I've been able to streamline the access process a bit with SSO profiles and the use of environment variables, all within Visual Studio Code + the built-in integration with an inline Windows Terminal prompt.
I'm trying to figure out a way to shortcut an "auto-type" function so that I can quickly trigger a shift between AWS accounts through the re-definition/switch of an AWS related environment variable (tied to my various AWS account sso profiles) in my VSC/Terminal window. I've rigged this through Keepass at the current time, where I can trigger a < ctrl >+< alt >+ a key-combo to bring up a keepass dialog box with a list of aws sso profile options. I scroll through the options till I find the right one, select it and that particular profile selection variable re-definition is auto-typed into my Windows Terminal window.
I wanted to see if Windows Terminal could be configured to perform a similar function, without having to rely or make use of Keepass?
I think I found a base option through the use of Windows Terminal actions via sendInput, but I haven't been able to overcome some challenges yet:
-) The action / sendInput function seems to only allow unique key-combo's per individual instance. It would mean having to configure and memorize 25+ separate unique key-combinations, one per profile. That's a tall ask and doesn't scale too well. I was hoping for a single keyboard shortcut with a trigger for a menu of selectable auto-type entries
-) If I try to define multiple sendInput functions, all tied to the "same" key-combo, the system only seems to honor the "last" entry in the settings file.
I know this is a weird/tall ask, but I'm hoping someone has some suggestions as to how I can accomplish this using native Windows Terminal if possible.
Thanks,
Beta Was this translation helpful? Give feedback.
All reactions