
Kiro CLI に入門
Kiro CLI は AWS製の「ターミナル上で動作するAIエージェントツール」です。 もともとは Amazon Q Developer CLI がありましたが、 2025/11/18 に後継として本ツール (Kiro CLI) が リリースされました。
ちょうどプロジェクトで Kiro CLI (Q Developer CLI) に入門する機会があったため、 その内容をまとめていきます。 主にセキュアに使うためのガードレールと、 これから拡張していくために役立つ機能に焦点を絞って書きました。
なお、使用しているKiro CLI のバージョンは以下のとおりです。
kiro-cli --version
# kiro-cli 1.20.0
インストール〜ログインまで
Installation - Kiro にインストール方法が記載されています。 また、既に分かりやすい解説ブログがあるため、詳細は割愛します。
インストール後、 kiro-cli login でログインします。 認証プロバイダーの詳細は Authentication - Kiro を参照ください。
本ブログでは Builder ID でサインインしました。

kiro-cli を実行して、無事起動できました。
kiro-cli
# ⠀⠀⠀⠀⠀⠀⠀
# ⠀⠀⠀⠀⠀⠀⠀ ⢀⣴⣶⣶⣦⡀⠀⠀⠀⢀⣴⣶⣦⣄⡀⠀⠀⢀⣴⣶⣶⣦⡀⠀⠀⢀⣴⣶⣶⣶⣶⣶⣶⣶⣶⣶⣦⣄⡀⠀⠀⠀⠀⠀⠀⢀⣠⣴⣶⣶⣶⣶⣶⣦⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀
# ⠀⠀⠀⠀⠀⠀⠀ ⢰⣿⠋⠁⠈⠙⣿⡆⠀⢀⣾⡿⠁⠀⠈⢻⡆⢰⣿⠋⠁⠈⠙⣿⡆⢰⣿⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⠻⣦⠀⠀⠀⠀⣴⡿⠟⠋⠁⠀⠀⠀⠈⠙⠻⢿⣦⠀⠀⠀⠀⠀⠀⠀
# ⠀⠀⠀⠀⠀⠀⠀ ⢸⣿⠀⠀⠀⠀⣿⣇⣴⡿⠋⠀⠀⠀⢀⣼⠇⢸⣿⠀⠀⠀⠀⣿⡇⢸⣿⠀⠀⠀⢠⣤⣤⣤⣤⣄⠀⠀⠀⠀⣿⡆⠀⠀⣼⡟⠀⠀⠀⠀⣀⣀⣀⠀⠀⠀⠀⢻⣧⠀⠀⠀⠀⠀
# ⠀⠀⠀⠀⠀⠀⠀ ⢸⣿⠀⠀⠀⠀⣿⡿⠋⠀⠀⠀⢀⣾⡿⠁⠀⢸⣿⠀⠀⠀⠀⣿⡇⢸⣿⠀⠀⠀⢸⣿⠉⠉⠉⣿⡇⠀⠀⠀⣿⡇⠀⣼⡟⠀⠀⠀⣰⡿⠟⠛⠻⢿⣆⠀⠀⠀⢻⣧⠀⠀⠀⠀
# ⠀⠀⠀⠀⠀⠀⠀ ⢸⣿⠀⠀⠀⠀⠙⠁⠀⠀⢀⣼⡟⠁⠀⠀⠀⢸⣿⠀⠀⠀⠀⣿⡇⢸⣿⠀⠀⠀⢸⣿⣶⣶⡶⠋⠀⠀⠀⠀⣿⠇⢰⣿⠀⠀⠀⢰⣿⠀⠀⠀⠀⠀⣿⡆⠀⠀⠀⣿⡆
# ⠀⠀⠀⠀⠀⠀⠀ ⢸⣿⠀⠀⠀⠀⠀⠀⠀⠀⠹⣷⡀⠀⠀⠀⠀⢸⣿⠀⠀⠀⠀⣿⡇⢸⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣼⠟⠀⢸⣿⠀⠀⠀⢸⣿⠀⠀⠀⠀⠀⣿⡇⠀⠀⠀⣿⡇
# ⠀⠀⠀⠀⠀⠀⠀ ⢸⣿⠀⠀⠀⠀⠀⣠⡀⠀⠀⠹⣷⡄⠀⠀⠀⢸⣿⠀⠀⠀⠀⣿⡇⢸⣿⠀⠀⠀⠀⣤⣄⠀⠀⠀⠀⠹⣿⡅⠀⠀⠸⣿⠀⠀⠀⠸⣿⠀⠀⠀⠀⠀⣿⠇⠀⠀⠀⣿⠇
# ⠀⠀⠀⠀⠀⠀⠀ ⢸⣿⠀⠀⠀⠀⣾⡟⣷⡀⠀⠀⠘⣿⣆⠀⠀⢸⣿⠀⠀⠀⠀⣿⡇⢸⣿⠀⠀⠀⠀⣿⡟⣷⡀⠀⠀⠀⠘⣿⣆⠀⠀⢻⣧⠀⠀⠀⠹⣷⣦⣤⣤⣾⠏⠀⠀⠀⣼⡟
# ⠀⠀⠀⠀⠀⠀⠀ ⢸⣿⠀⠀⠀⠀⣿⡇⠹⣷⡀⠀⠀⠈⢻⡇⠀⢸⣿⠀⠀⠀⠀⣿⡇⢸⣿⠀⠀⠀⠀⣿⡇⠹⣷⡀⠀⠀⠀⠈⢻⡇⠀⠀⢻⣧⠀⠀⠀⠀⠉⠉⠉⠀⠀⠀⠀⣼⡟
# ⠀⠀⠀⠀⠀⠀⠀ ⠸⣿⣄⡀⢀⣠⣿⠇⠀⠙⣷⡀⠀⢀⣼⠇⠀⠸⣿⣄⡀⢀⣠⣿⠇⠸⣿⣄⡀⢀⣠⣿⠇⠀⠙⣷⡀⠀⠀⢀⣼⠇⠀⠀⠀⠻⣷⣦⣄⡀⠀⠀⠀⢀⣠⣴⣾⠟
# ⠀⠀⠀⠀⠀⠀⠀ ⠀⠈⠻⠿⠿⠟⠁⠀⠀⠀⠈⠻⠿⠿⠟⠁⠀⠀⠈⠻⠿⠿⠟⠁⠀⠀⠈⠻⠿⠿⠟⠁⠀⠀⠀⠈⠻⠿⠿⠟⠁⠀⠀⠀⠀⠀⠈⠙⠻⠿⠿⠿⠿⠟⠋⠁
#
# ╭─────────────────────────────── Did you know? ────────────────────────────────╮
# │ │
# │ You can execute bash commands by typing ! followed by the │
# │ command │
# │ │
# ╰──────────────────────────────────────────────────────────────────────────────╯
#
# Model: Auto (/model to change) | Plan: KIRO FREE (/usage for more detail)
#
# Checkpoints are not available in this directory. Use '/checkpoint init' to enable checkpoints.
操作全般/最低限の設定
kiro-cli CLIコマンドについて
kiro-cli CLIコマンドのリファレンスは CLI commands - Kiro にまとめられています。 また、ターミナル上にて kiro-cli --help (詳細: --help-all )で確認できます。
kiro-cli help
# kiro-cli (Kiro CLI)
#
# Popular Subcommands Usage: kiro-cli [subcommand]
# ╭────────────────────────────────────────────────────╮
# │ chat Chat with Kiro CLI │
# │ agent Manage AI agents │
# │ doctor Debug installation issues │
# │ settings Customize appearance & behavior │
# │ quit Quit the app │
# ╰────────────────────────────────────────────────────╯
#
# Use --agent AGENT_NAME to start chat with a specific agent
#
# To see all subcommands, use:
# ❯ kiro-cli --help-all
セッション中に使えるスラッシュコマンドについて
チャットセッション中にて使えるコマンドは Slash commands - Kiro にまとめられています。 もしくは、セッション中に / タイプ後にタブ(Tab)2回押しで確認できます。
> /(タブを2回押す)
# /agent /compact /hooks rm /save
# /agent create /compact help /issue /tangent
# /agent delete /context /knowledge /tangent tail
# /agent generate /context add /knowledge add /todos
# /agent help /context clear /knowledge cancel /todos clear-finished
# /agent list /context help /knowledge clear /todos delete
# /agent rename /context rm /knowledge help /todos delete --all
# /agent schema /context show /knowledge remove /todos help
# /agent set /context show --expand /knowledge search /todos resume
# /changelog /editor /knowledge show /todos view
# /checkpoint /experiment /knowledge status /tools
# /checkpoint clean /help /knowledge update /tools reset
# /checkpoint diff /hooks /load /tools trust
# /checkpoint expand /hooks add /mcp /tools trust-all
# /checkpoint help /hooks disable /model /tools untrust
# /checkpoint init /hooks disable-all /paste /usage
# /checkpoint list /hooks enable /prompts
# /checkpoint restore /hooks enable-all /quit
# /clear /hooks help /reply
たとえば、 /context show コマンドを実行することで、 セッション内で読み込まれているコンテキストを把握できます。
> /context show
# Agent (kiro_default)
# - AmazonQ.md (no matches)
# - AGENTS.md (no matches)
# - README.md (no matches)
#
# Session (temporary)
# <none>
#
# No files in the current directory matched the rules above.
Introspect ツールをKiro CLIリファレンスとして使う
Kiro CLI にはビルトインで Introspect tool が搭載されており、 Kiro CLI に関する質問に対して正確な情報を提供します。
> あなたに搭載されている主要なスラッシュコマンド教えて
# > Kiro CLIで利用できる主要なスラッシュコマンドについて確認しますね。
# Introspecting to get you the right information (using tool: introspect) - Completed in 0.0s
#
# > Kiro CLIで利用できる主要なスラッシュコマンドは以下の通りです:
#
# 会話管理
# - /quit - アプリケーションを終了
# - /clear - 会話履歴をクリア
# - /save - 現在の会話を保存
# - /load - 以前の会話を読み込み
# - /compact - 会話を要約してコンテキストスペースを確保
#
# エージェント・ツール
# - /agent - エージェントを管理
# - /tools - ツールと権限を表示
# - /mcp - 読み込まれたMCPサーバーを確認
#
# ...以下略
最低限の設定(学習されないように)
以下コマンドを実行しました。
### CodeWhispererサービスとのコンテンツ共有を無効にする
kiro-cli settings codeWhisperer.shareCodeWhispererContentWithAWS false
### テレメトリ収集を無効にする
kiro-cli settings telemetry.enabled false
### 確認コマンド
kiro-cli settings list | grep -e codeWhisperer -e telemetry
# codeWhisperer.shareCodeWhispererContentWithAWS = false
# telemetry.enabled = false
※ 今回は Free Tier なので実行しましたが、 Q Developer Pro サブスクリプションを持っている場合は、 コンテンツは学習されないようになっています。
If you have an Amazon Q Developer Pro subscription and access Kiro through your AWS account with the Amazon Q Developer Pro subscription, then Kiro will not use your content for service improvement.
エージェント設定
カスタムエージェントを使うと、特定のユースケースに合わせて エージェントの立ち振る舞いや機能、ガードレールを設定できます。 以下のようなJSONで定義します。
{
"name": "my-agent",
"description": "A custom agent for my workflow",
"tools": ["read","write"],
"allowedTools": ["read"],
"resources": ["file://README.md", "file://.kiro/steering/**/*.md"],
"prompt": "You are a helpful coding assistant",
"model": "claude-sonnet-4"
}
– 引用: #Agent configuration file - Kiro
JSONの置き場所は ローカルとグローバルの2種類あります。
- ローカル(ワークスペース固有):
.kiro/agents/*.json - グローバル(ユーザー全体):
~/.kiro/agents/*.json
以降で、主要な設定項目を紹介していきます。
基本情報(name, description)
name, description フィールドにエージェント名や説明を記載します。
{
"name": "sample",
"description": "Default agent for general-purpose tasks"
}
kiro-cli を起動する時に引数として指定することで、 そのエージェントで立ち上がります。
### エージェント一覧を確認
kiro-cli agent list
# kiro_default **No path found**
# * sample /path/to/project/.kiro/agents
### sample エージェントでチャットを起動
kiro-cli --agent sample
デフォルトのチャットエージェントを設定するには kiro-cli settings chat.defaultAgent を実行します。
### デフォルトのチャットエージェントを設定
kiro-cli settings chat.defaultAgent sample
### 確認
kiro-cli settings list | grep chat.defaultAgent
# chat.defaultAgent = "sample"
システムプロンプト(prompt)
エージェント固有のシステムプロンプトを設定できます。
{
"prompt": "説明は簡潔で要点をおさえること"
}
インラインテキストと file:// URI の両方をサポートしています。
追加のコンテキスト/データ(resources)
追加のコンテキストやデータソースを resources にて指定できます。 指定したファイルがチャット起動時に読み込まれます。
{
"resources": [
"file://AGENTS.md",
"file://.kiro/rules/**/*.md"
]
}
起動後、 /context show コマンドで読み込まれたコンテキストを確認できます。
> /context show
# Agent (sample)
# - AGENTS.md /path/to/project/AGENTS.md
# - .kiro/rules/**/*.md /path/to/project/.kiro/rules/general.md
#
# Session (temporary)
# <none>
#
# 2 matched files in use
# - /path/to/project/.kiro/rules/general.md (0.0% of context window)
# - /path/to/project/AGENTS.md (0.0% of context window)
#
# Context files total: 0.0% of context window
ちなみに、Kiroデフォルトのエージェント ( kiro_default ) が読み込むコンテキストは以下の3つです。
> /context show
# Agent (kiro_default)
# - AmazonQ.md (no matches)
# - AGENTS.md /path/to/project/AGENTS.md
# - README.md (no matches)
#
# # 略
MCPサーバー(mcpServers)
MCPサーバー定義を記載するセクションです。 以下 AWS Knowledge MCP Server を設定する例です。
{
"mcpServers": {
"aws-knowledge-mcp-server": {
"url": "https://knowledge-mcp.global.api.aws",
"type": "http"
}
}
}
※この設定だけでは使えません。後述の tools 周りの設定が必要です。
利用可能なツール(tools)
エージェントが使用できるツールを指定します。 以下は「全てのビルトインツール」と 「前述の AWS Knowledge MCP Server」を許可する設定例です。
{
"tools": [
"@builtin",
"@aws-knowledge-mcp-server"
]
}
組み込みツールは名前で指定します( read や shell など )。 @builtin は全ての組み込みツールを含むキーワードです。
MCPサーバーは @server-name もしくは @server-name/tool-name で指定します。
自動許可されるツール(allowedTools)
ユーザーの確認なしで実行されるツールを定義できます。 リファレンスにあるサンプルを載せます。
{
"allowedTools": [
"read",
"write",
"@git/git_status",
"@server/read_*",
"@fetch"
]
}
デフォルト(kiro_default) もしくは明記しなかった場合の allowedTools 設定は以下のようになっています。 trusted と書かれているものが、承認無しで実行されるものです。
> /tools
# Tool Permission
# ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔Built-in
# - delegate not trusted
# - shell not trusted
# - read trust working directory
# - write not trusted
# - introspect trusted
# - knowledge not trusted
# - report not trusted
# - thinking trusted (prerelease)
# - todo trusted
# - aws trust read-only commands
ツールの詳細設定(toolsSettings)
read や write など、各ツールの挙動を細かく制御できます。 正確な情報/設定値は Built-in tools - Kiro を参照ください。
以下、サンプルです。
{
"toolsSettings": {
"fs_read": {
"deniedPaths": [
"**/.env",
"**/.env.*",
"**/id_rsa",
"**/id_rsa.*",
"**/*.pem",
"**/*.key"
]
},
"fs_write": {
"deniedPaths": [
"**/.env",
"**/.env.*",
"/etc/**",
"/usr/**",
"/System/**"
]
},
"execute_bash": {
"deniedCommands": [
"git push .*",
"rm -rf .*"
]
},
"use_aws": {
"autoAllowReadonly": true
}
}
}
フック(hooks)
エージェントのライフサイクルや特定のトリガーポイントで 実行するコマンドを定義できます。
以下サンプルです。 エージェントが初期化されたタイミングで git status が実行され、コンテキストとしてインプットされます。
{
"hooks": {
"agentSpawn": [
{
"command": "git status"
}
]
}
}
ほか
定型プロンプト(/prompts)
再利用可能なプロンプトを 定型プロンプト(/prompts)として管理できます。 Claude Code でいうカスタムスラッシュコマンドですね。
プロンプトには3種類あります。
- ローカルプロンプト(
.kiro/prompts/) - グローバルプロンプト(
~/.kiro/prompts/) - MCPプロンプト(MCPサーバー経由)
試しにローカルプロンプトを作ってみます。 /prompts create でプロンプトを新規作成でき、 プロンプトを呼び出すには @プロンプト名 を入力します。
### プロンプトを作成
> /prompts create --name diff --content "git status および git diff を実行して、更新差分を教えて下さい"
✓ Created local prompt diff at /path/to/project/.kiro/prompts/diff.md
### プロンプトを呼び出す
> @diff
# git status および git diff を実行して、更新差分を教えて下さい
#
#
# ✓ 1 of 1 hooks finished in 0.08 s
# > git statusとgit diffを実行します。
#
# I will run the following command: git status (using tool: shell)
# Purpose: git statusを実行
#
# ... 略
#
# > git status:
# - まだコミットがない状態(初期化直後)
# - 未追跡ファイル: .kiro/ と AGENTS.md
#
# git diff:
# - 差分なし(まだコミットがないため)
#
# まだ最初のコミットを作成していないため、差分は表示されません。ファイルをステージングしてコミットする必要があります。✓ Created checkpoint 1
実験的機能(/experiment)
/experiment で 実験的機能: Experimental features を有効化できます。 以下、2025/11/24時点の実験的機能の一覧です。
| 機能 | 説明 |
|---|---|
| Knowledge | セッション間で永続的なコンテキスト保存・取得( /knowledge ) |
| Thinking | 段階的思考プロセスによる複雑な推論を有効化 |
| Tangent Mode | 独立した一時的な会話モード( /tangent ) |
| Todo Lists | ToDo リスト作成・管理( /todos ) |
| Checkpoint | ワークスペースのスナップショット機能( /checkpoint ) |
| Context Usage Indicator | プロンプト内のコンテキスト使用率表示(例: [agent] 6% > ) |
| Delegate | 非同期サブエージェントプロセスの起動・管理 |
おわりに
Kiro CLI(旧: Q Developer CLI)に入門してみました。 まだ触りたてなので、見落としている機能も多くあります。
わたしは現在 Claude Code をメインに触っています。 その視点で感じた 「Kiro CLIの良さそうなポイント」は以下のとおりです。
- カスタムエージェント単位で、いろいろな振る舞いを定義・制御できるのは柔軟で良い
- ビルトインで aws ツールがあるのが便利
- AWS環境調査で AWS API MCP Server を入れる必要がない
- 実験的機能の Tangent Mode (脱線機能)あたりは Claude Code には無いので面白そう
- (地味ですが) ターミナルの文章をコピペしやすい
- Claude Code と違って、メッセージ冒頭に空白スペースが無い
今後、更に触ってみて感じたことや得られたことがあれば、 またブログにしようと思います。
以上、参考になれば幸いです。









