Using Developer Profiles with the Alexa Skills Kit CLI
Tags: mydeveloperjourney, alexa, amazon
Published: 2019-09-30 23:03:38

---
title: Using Developer Profiles with the Alexa Skills Kit CLI
published: true
cover_image: https://thepracticaldev.s3.amazonaws.com/i/9uzh730g1bwlgl2qec88.png
tags: My Developer Journey,alexa,amazon
canonical_url: https://yiddish.ninja/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](https://www.npmjs.com/package/ask-cli), 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](https://gitforwindows.org/#bash) on Windows machines with [ConEmu-Maximus5](https://conemu.github.io/). 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](http://yiddish.ninja/wp-content/uploads/2019/09/cli1.jpg)

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](https://github.com/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](https://dev.to/yiddishninja/aws-pro-tip-manage-cli-user-identities-with-profiles-584f). I checked, and sure enough, there’s [profile support in the Amazon ASK CLI](https://developer.amazon.com/docs/smapi/manage-credentials-with-ask-cli.html).

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](https://developer.amazon.com/docs/smapi/manage-credentials-with-ask-cli.html#profiles-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.