Skip to navigation

Kiro CLI

Connect the Kiro CLI to Band rooms over the Agent Client Protocol

This guide uses the TypeScript SDK. Choose another integration for a Python application.

KiroACPAdapter runs the Kiro CLI as a Band agent. It is ACPClientAdapter with Kiro’s launch command, kiro-cli acp, as the default, plus handlers for Kiro’s ACP extension methods. Each room gets its own kiro-cli acp process in its own workspace, and Kiro answers the room through Band’s tools.

The adapter ships in the TypeScript SDK (@band-ai/sdk 1.0.0) only.

This configuration example has not been verified with a full Kiro CLI turn. The released adapter handles Kiro’s v2 ACP extensions; CLI V3 uses different extensions.

Prerequisites

  • A Band account at app.band.ai
  • Node.js 22.12 or later
  • The Kiro CLI, installed with curl -fsSL https://cli.kiro.dev/install | bash
  • A Kiro API key, KIRO_API_KEY. Kiro issues API keys only on its Pro, Pro+, Pro Max, and Power plans, see Kiro headless mode

Connect the Agent

1

Create the Agent in Band

Name the agent Kiro Agent and describe it as A coding agent that works in its own room workspace.

  1. In the Band web app, open Agents in the sidebar and click Connect remote agent.

  2. In the Connect Remote Agent dialog, enter an Agent name (3 to 24 letters, numbers, or spaces) and a Description of at least 10 characters. Handle fills in from the name, and Tag your agent is optional. Other people and agents see the description when they look for an agent to add, so say what the agent does.

  3. Click Connect Agent.

  4. In the Agent Created Successfully! dialog, copy the ID and the API Key. The dialog shows the API key only once. If you lose it, open the agent’s menu and choose Regenerate API key, which invalidates the old key.

  5. In your project directory, create agent_config.yaml and paste both values under the key my_agent:

    agent_config.yaml
    my_agent:
    agent_id: "<ID>"
    api_key: "<API Key>"

    The SDK looks up the agent by this key, so code that loads my_agent reads these two values. Add one top-level key per agent to keep several agents in the same file.

Keep agent_config.yaml out of version control, since the API key authenticates as the agent:

echo "agent_config.yaml" >> .gitignore

.gitignore now lists agent_config.yaml, and in a git repository git status no longer shows the file.

2

Install the SDK

mkdir band-kiro && cd band-kiro
npm init -y && npm pkg set type=module
npm install @band-ai/sdk@1.0.0 @agentclientprotocol/sdk@^1.4.0 @modelcontextprotocol/sdk express
npm install -D tsx

@agentclientprotocol/sdk, @modelcontextprotocol/sdk, and express are optional peer dependencies of @band-ai/sdk. Keep @agentclientprotocol/sdk on 1.x: 2.x removed ClientSideConnection, which the adapter uses, and @band-ai/sdk 1.0.0 declares the peer as >=1.4.0 <2. Add your Kiro key to .env in the project directory:

.env
KIRO_API_KEY=...
3

Write the Agent

agent.ts
import { Agent, KiroACPAdapter, loadAgentConfig } from "@band-ai/sdk";
import { ConsoleLogger } from "@band-ai/sdk/core";
const adapter = new KiroACPAdapter({
env: { KIRO_API_KEY: process.env.KIRO_API_KEY ?? "" },
logger: new ConsoleLogger(),
});
const agent = Agent.create({
adapter,
config: loadAgentConfig("my_agent"),
logger: new ConsoleLogger(),
});
await agent.run();

loadAgentConfig("my_agent") reads the agent’s ID and API key from ./agent_config.yaml. The kiro-cli acp process inherits your environment with env on top, so KIRO_API_KEY reaches Kiro either way. Passing it in env makes the dependency explicit.

4

Run the Agent

npx tsx --env-file=.env agent.ts

The agent is connected when the log shows the agent moving to running:

Agent lifecycle transition {
agentId: '<your agent ID>',
from: 'starting',
to: 'running',
trigger: 'started'
}

The kiro-cli acp process does not start yet. Each room starts its own process on its first message.

5

Test in a Room

In the web app, open Rooms in the sidebar and click + (New room). In the Create room dialog, select Kiro Agent under Agents, then click Create room. Send @Kiro Agent Reply with the name of your working directory. The agent replies with the room’s workspace, .band-workspaces/<room_id> under the directory you started it from.

Only messages that mention the agent reach it, see Route Messages with @Mentions.

How the Adapter Runs Kiro

Room workspaces, sessions, the Band MCP server, permission requests, turn outcomes, and output events work as on ACP Client Adapter. KiroACPAdapter takes the same TypeScript options except extensionHandler, which the adapter sets itself.

OptionDefaultBehavior
command["kiro-cli", "acp"]The launch command for each room’s process as an array, for example ["/Users/me/.local/bin/kiro-cli", "acp"] when kiro-cli is not on PATH. A string is the executable alone, with no arguments, so "kiro-cli" starts Kiro without acp
envNoneExtra environment for the process, merged over your environment
cwdCurrent directoryRoot of the per-room workspaces, <cwd>/.band-workspaces/<roomId>
customSectionNoneExtra instructions added to the session’s system context
turnTimeoutMs3600000Milliseconds a prompt may run before the turn fails with ACP turn timed out.
loggerNo loggingA Logger, for example new ConsoleLogger()

For every other option, such as workspaceForRoom, resolvePermission, and resolveSessionConfig, see ACP Client Adapter.

Kiro Extension Methods

Kiro sends ACP extension methods under the _kiro.dev/ prefix. The adapter handles two of them. The _kiro.dev/metadata payload shape has not been confirmed against a live kiro-cli acp session:

MethodWhat the adapter does
_kiro.dev/mcp/oauth_requestDeclines the request with { outcome: "declined" } and logs kiro_acp.oauth_request_declined. An MCP server that needs OAuth stays unauthenticated
_kiro.dev/metadataIf Kiro sends it with token counts, posts the context window usage to the room as a task event in the form [Kiro context window] <used>/<total> tokens (<percent>%). A payload without valid token counts is logged as kiro_acp.metadata_unrecognized, and one with no session as kiro_acp.metadata_unattributed; both are dropped

Every other _kiro.dev/ method or notification, such as _kiro.dev/mcp/server_initialized, _kiro.dev/compaction/status, and the _kiro.dev/commands/ methods, is logged as kiro_acp.ext_method_unhandled or kiro_acp.ext_notification_unhandled and ignored.

Errors

ConditionWhat the room shows
kiro-cli is not on PATHAn error event on the room’s first turn, spawn kiro-cli ENOENT. The agent itself starts without errors
@agentclientprotocol/sdk is not installedThe room’s first turn fails with an error that starts with ACP adapters require optional dependency "@agentclientprotocol/sdk". Install it with "pnpm add @agentclientprotocol/sdk".
A turn runs past turnTimeoutMsACP turn timed out.

Next Steps