DEV Community

Cover image for Using Developer Profiles with the Alexa Skills Kit CLI
Greg Bulmash 🥑
Greg Bulmash 🥑

Posted on • Originally published at on

Using Developer Profiles with the Alexa Skills Kit CLI

I’m ALWAYS the edge case. I broke the CLI on my first try.

I’d installed the Amazon Alexa Skills Kit Command Line Interface, ran the ask init command to set it up with my account, and then ran the following to create a new skill:

ask new -n MyNewSkill

For a long time I’ve wrapped GitBash on Windows machines with ConEmu-Maximus5. For some reason, this particular combo did not like the menus in the CLI. This is what the first menu should look like…

cli capture - ask new

Only for me, there were no different colors, no > arrow to indicate my choice. There was just a blinking thin cursor that was always on the wrong line.

So I then tested it in GitBash without the ConEmu wrapper. It worked fine. Windows command prompt? Fine. Windows Powershell? Fine. A preview of the new Microsoft Terminal. Fine. The terminal in VS Code. Fine. The only thing that broke it was my oddball default configuration… because I’m special that way.

But let’s talk about profiles

I glossed over the part above where I ran ask init. But as I ran it on my personal machine, I wondered which account to connect it to, personal or work?

Plus, I have to dive into a lot of different possible configurations as I build my expertise, because I’m going to have to help people who don’t always go with the “recommended configuration.” It asks to connect to an Amazon AWS account during the init process, so whichever account I chose, I was going to have to think about doing flavors that were AWS-connected and not.

I started going down a dark path as I thought about how was going to solve this: “Am I going to need to run virtual machines with different versions installed to be able to have all these different options?”

Then I remembered the blog post I wrote about 6 months ago on using Amazon AWS CLI profiles. I checked, and sure enough, there’s profile support in the Amazon ASK CLI.

You create a profile by running the init command with the -p flag, followed by the profile name. Like so:

ask init -p 'MyProfileName'

But managing the profiles is more interesting. You can always add a -p and a profile name onto every CLI command to ensure the correct profile is used, but that gets old and could lead to an error if you forget it. Making sure the one you want gets used without having to type a bunch of extra characters every time would be nice.

The documentation has a nice section on profile precedence to help you figure out how to make your favorite profile of the moment be the one that gets used.

There’s more stuff on profiles on their page, but I got what I wanted. It’ll obviously come up again. And I’ll be ready.

Now I just have to decide if I have time to debug ConEmu. We’ll see.

Discussion (0)