kiro-cli guide — CLI Guide ▶ Playground
Cookbook

Cookbook

String the earlier features into real scenarios: fixing bugs, adding tests, refactoring, parallel multi-project work, and CI automation.

Let’s combine what you’ve learned so far into the situations you’ll actually run into at work.

Scenario 1: getting your head around an unfamiliar project

cd ~/some-repo
kiro-cli chat
❯ I just inherited this project. Help me: 1) explain what it's for and its architecture 2) list the main entry points 3) point out which files I should read first

Scenario 2: fix a bug and verify

❯ Run the tests, pick out the failing ones, find the root cause and fix it, then run them again to confirm everything's green
TIP

Having Kiro “run them again after fixing” is the key part — that way it verifies the result itself instead of just calling it done after making the change.

Scenario 3: add tests

❯ Which files under src/services/ have no tests? Add unit tests for the uncovered ones and run them

Scenario 4: a safe refactor

First switch to mode two (writing files without approval, shell goes through an allowlist):

kiro-cli chat --trust-tools=read,write,grep,glob,code
❯ Rewrite the callback-style async code into async/await, keep the behavior unchanged, and run the tests when done

Scenario 5: run multiple projects at once (batch a whole pile of tasks)

#!/usr/bin/env bash
projects=(~/proj/a ~/proj/b ~/proj/c)
for p in "${projects[@]}"; do
  ( cd "$p" && kiro-cli chat --trust-all-tools --no-interactive \
      "Update dependencies, fix warnings, run the tests, and finish with a summary of the changes" \
      > kiro-run.log 2>&1 ) &
done
wait
echo "All done ✓"

Each project runs in the background on its own, logs are stored separately, and the conversations are isolated per directory too.

Scenario 6: parallel analysis, then consolidate

❯ Analyze the security risks of the auth, payment, and search modules in parallel, and consolidate the results into one report when done

Kiro will spin up subagents to run the three analyses simultaneously, then fan the results back into a single report. Remember the parent agent needs crew trust set up first (see the Subagent chapter for details).

Scenario 7: headless automation in CI

Inside a CI step:

kiro-cli chat --no-interactive --trust-tools=read,grep,shell \
  "Run lint and tests; if anything fails, summarize why and exit with a non-zero code"
!

In CI, try to grant precise permissions with --trust-tools rather than just flipping on --trust-all-tools. Narrow the range of commands that can run down to just enough — that’s how you keep the risk under control.

Scenario 8: save your progress as you go

❯ /chat save refactor-orders-module

Come back the next day and pick up where you left off:

kiro-cli chat --resume
# or
kiro-cli chat
/chat load refactor-orders-module

Next chapter: how to investigate when things go wrong.