DEV Community

Cover image for Getting started with Kiro CLI
Ricardo Sueiras for AWS

Posted on • Edited on

Getting started with Kiro CLI

Update: On November 17th Amazon Q CLI became Kiro CLI - functionally, they work the same. I have updated this post to reflect the name changes and update links

If you are reading this then there is a good chance your curiosity has been piqued by the excitement that Kiro CLI has been generating online. Developers have been sharing how they have been using Kiro CLI to create amazing automations, create new applications from scratch, vibe code fun games, and much more (check out the end of this post for a small selection of those). You don't need to have an AWS Account to be able to use Kiro CLI, so everyone can join in the fun...yes everyone!

In this post I am going to talk more about what Kiro CLI is, and then help you get started. Lets dive right in.

What is Kiro CLI

How often to you use your terminal or shell? As a developer, I spend probably most of my time in the terminal when I am not writing code in my IDE. If you are not a developer, maybe you work as a sysadmin, or perhaps a devops engineer, you might spend all of your time in the terminal - writing scripts to automate stuff, running various tools to help with your job, and helping to fix things when they go wrong. The terminal is an essential part of our job, and so we need to make sure we are 'command line confident' as I like to say.

It's tough though, with so many tools we use to help with our activities, it is easy to sometimes forget command line parameters and options - especially when these are being updated to support newer versions. With generative AI increasingly being integrated and enabled in developer tooling, wouldn't it be great if we could have some of those capabilities to use in the command line.

Well the good news is that you can! All the goodness you have in the IDE with tools like Kiro or the Amazon Q Developer IDE plugin, you can now have at your fingertips in your terminal and on the command line. Kiro CLI provides these capabilities:

  • command auto complete - if you are a fan of how auto completion works in the IDE, Kiro CLI supports hundreds of popular CLI tools (for example git, docker, aws) and brings that to the command line
  • natural language to command translation - helps you convert your intent to the appropriate tools and arguments that you can then run in the command line - perfect for those situations where you might forget all the various command line parameters and options, but you know what you want to do
  • natural language chat with agentic execution - lets you interact with your terminal using natural language (ask questions, debug issues, explore the codebase, etc) and then take action (generate code, edit files, automate Git workflows, resolve merge conflicts, and more) with your permission

Whats more, if English is not your first language then don't worry as you can interact with Kiro CLI in lots of languages. My colleague Jeff Barr was even able to use it with Quechua, the indigenous language dating back to pre-Columbian times (read more here). I have tried it in Spanish, and my colleagues from across the world have tried it in their local languages and we all give it the thumbs up!

Ok so I hope this sounds good to you. Lets get started, by walking you through the installation steps and then showing you how to get started.

Installing

To use Kiro CLI all you need is a supported operating system (MacOS, Linux, and Windows using the Windows Subsystem for Linux, wsl), a supported terminal (don't worry, unless you are using something very different it is likely you are using a supported terminal), and a supported shell (zsh, bash, and fish).

The installation process installs the binaries for your platform, configures integration with the terminal (or shell), and then help you log in. I have put together a couple of guides to help with installation. First up is the Essential guide to installing Kiro CLI on Linux for those of you who are using Linux, and then for Windows users I put together The essential guide to installing Kiro CLI on Windows. For MacOS users, they have the simplest installation which you can find here.

Once installed, you will need to login. There are two types of account you can login with: Builder ID and Identity Centre accounts. To get started for free, we can use the Builder ID login. If you have not already used this, then it is super simple. Access the Builder ID page, and you can register for your free Builder ID alias using your email address. You don't need to have an AWS Account.

Here is a short video of what this looks like:

Once you have installed it, you are good to go and will now have a number of new commands available from within your terminal. Lets take a look at these and how you can get started.

Getting started

Now that you have Kiro CLI installed, all we need to do to use it is open up a terminal. Your terminal will open up a shell, and as part of the installation, that shell will make kiro-cli available. Lets walk through some things to get you up and running.

Translating commands

Kiro CLI can help you translate your intent to a specific command. Lets say for example we wanted to run a command but we could not remember all the parameters and command line options we needed. This happens to me all the time. So for example, lets say I wanted to find all the files in my local directory that contained the world "kiro".

From a terminal I can type:

kiro-cli translate "find all the files in my current directory and all subdirectories that contain the word kiro but exclude hidden files and directories"
Enter fullscreen mode Exit fullscreen mode

and after a short moment, this is what I will get

kiro-cli translate "find all the files in my current directory and all subdirectories that contain the word kiro but exclude hidden files and directories"

  Shell · find . -type f -name "*kiro*" -not -path "*/.*" -not -path "./.*"

❯ ⚡ Execute command
  📝 Edit command
  🔄 Regenerate answer
  ❓ Ask another question
  ❌ Cancel
Enter fullscreen mode Exit fullscreen mode

I can now use the arrow keys to select the option. The default option is to execute the command when pressing enter. I can also edit the command if I wanted, ask it to redo the answer if I think it has made a mistake, ignore this and ask a different question (at which point it will provide me with a prompt) or just cancel and exit this.

I use this capability a lot and its super handy when working with all the command line tools you use day in day out,

Agentic Chat

Kiro CLI provides a chat interface that allows you to engage in natural language conversations, ask questions, and receive responses from Kiro CLI.

But wait, it does more than just respond to your prompts. Kiro CLI has full agentic capabilities, taking your prompts and then breaking these down into tasks which it will act upon. You will notice this as you start using it and see the word "Thinking..." appear. As it starts to work on the tasks you have given it, it will prompt you along the way as and when it needs more input, to confirm an operation it wants to do, or to keep you informed. Check at the end of this post for some good examples of some of the things that you can achieve.

Ok so lets take a look at how to use this. From the terminal simply type:

kiro-cli
Enter fullscreen mode Exit fullscreen mode

which will open up Kiro CLI and let you start a new chat session:

You can also invoke a chat session with some text using the format:

kiro-cli chat "Can you tell me which is the largest file in my directory"
Enter fullscreen mode Exit fullscreen mode

Which will open up the chat session and start working immediately on the question you asked it.

> Can you tell me which is the largest file in my directory

I'll help you find the largest file in your current directory. Let me run a command to check that for you.

Execute shell command
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I will run the following shell command:
find . -type f -maxdepth 1 -exec du -h {} \; | sort -hr | head -n 10

Allow this action? Use 't' to trust (always allow) this tool for the session. [y/n/t]:
Enter fullscreen mode Exit fullscreen mode

It will wait for you to respond with "y" or "t" to proceed, before completing the request.

Asking for permission

When performing operations using the tools, Kiro CLI generally prompts you to confirm that you want to allow it to perform those actions. It doesn’t seek permission for the following readonly commands: ls, cat, echo, pwd, which, head, and tail. If you want to change this behaviour, you can use "/tools trust-all" to automatically accept all the requests. You will notice that the prompt changes from ">" to "!>" Use with care always supervise what is going on.

Available commands

You can use "/help" at any time to get a list of the commands available.

Context

As you work with tools like Kiro CLI, it is important to understand how to configure context to provide more relevant and context-aware responses. The default is that Kiro CLI for command line will integrate contextual information from your local development environment, i.e. the directory you are currently in. It will look for the following documents and automatically include them as part of context:

  • AmazonQ.md
  • AGENTS.md
  • README.md
  • {home}/.kiro/steering/*/.md

Creating documents in markdown format is a good way to help steer the output. For example, I typically put together my own coding preferences in a doc within a directory called "steering" in the working directory I have, which provide additional context for Kiro CLI. It will review those resources and factor that into the output created.

You can add specific files and resources within a "kiro-cli" session to fine tune that context. If you us the "/context show" command, it will provide you with details of how it will use certain files to help with its suggestions.

> /context show

Agent (kiro_default)
  - AmazonQ.md (no matches)
  - AGENTS.md (no matches)
  - README.md (no matches)
  - /Users/ricsue/.kiro/steering/**/*.md (no matches)
  - /Users/ricsue/.kiro/steering/**/*.md (no matches)

Session (temporary)
  <none>
Enter fullscreen mode Exit fullscreen mode

You can add additional files you want to add to the context, which is super useful if you have a standard way of working and you want to define these in those markdown docs.

As your projects get larger and the use cases more complex, being able to fine tune context will help you achieve better output.

Executing commands

When you are in a "kiro-cli" session, you can execute commands without leaving by using the "!" prefix. So for example, I could use:

> ! echo "Kiro is cool"
Enter fullscreen mode Exit fullscreen mode

And that command will execute (and you should see the output from running the tool). This is useful to know.

Exiting

To leave the chat session, you enter "/q" and this will return you to the shell.

Get started with Kiro CLI

Try Kiro CLI today for free. Register by signing up for a Builder ID and then using the links in this post to help you install Kiro CLI on your system.

I have put together an hands on workshop for those that want to dive even deeper with Kiro CLI which you can do at your own pace. If that sounds like something you would like to try, go grab it here

Until next time folks!

Made with 🧡 by DevRel!

Top comments (1)

Collapse
 
darkosubotica profile image
Darko Mesaroš ⛅️ AWS

I cant wait for MCP support to come!