Skip to content

Feature request: Add kiro agent kind for Kiro CLI 2.0 #489

@craigedmunds

Description

@craigedmunds

Summary

Add a new kiro agent kind to sortie, enabling Kiro CLI (formerly Amazon Q Developer CLI) as an agent backend alongside claude-code, copilot-cli, and codex.

Why Kiro CLI

Kiro CLI has strong alignment with sortie's existing architecture:

  • Headless mode via kiro-cli chat --no-interactive "prompt" — maps directly to sortie's subprocess-per-turn model used by claude-code and copilot-cli
  • Declarative agent config in .kiro/agents/*.json with prompt, model, tools, resources, and hooks — could map to sortie's passthrough config block
  • Tool permission flags (--trust-all-tools, --trust-tools=read,grep,write) — similar to claude-code's permission_mode
  • MCP support natively — consistent with sortie's tool ecosystem
  • Multi-model support — Claude frontier models, with the model selectable per-agent config
  • Agent selection via kiro-cli --agent <name> flag

Proposed Design

Workflow config

agent:
  kind: kiro
  command: kiro-cli

kiro:
  model: claude-sonnet-4
  trust_tools: "read,grep,write,edit"    # or trust_all_tools: true
  agent: my-custom-agent                  # optional: select a .kiro/agents/ agent
  require_mcp_startup: false

Adapter implementation

Following the existing pattern in internal/agent/:

  1. internal/agent/kiro/kiro.goAgentAdapter implementation using the subprocess-per-turn model (like claude-code)
  2. internal/agent/kiro/command.go — Build CLI args: kiro-cli chat --no-interactive --trust-tools=<tools> "prompt"
  3. internal/agent/kiro/parse.go — Parse Kiro CLI stdout into domain.AgentEvent structs

Registration:

func init() {
    registry.Agents.RegisterWithMeta("kiro", NewKiroAdapter, registry.AgentMeta{
        RequiresCommand: true,
    })
}

Open questions

  1. Output format: Does Kiro CLI support structured output (JSONL/JSON) in headless mode, or is it plain text only? Sortie's existing adapters rely on JSONL event streams from stdout. If Kiro only emits plain text, the parser would need a different approach.
  2. Session continuity: Does kiro-cli support resuming sessions across turns (like claude --resume)? This affects whether sortie can maintain multi-turn conversations.
  3. Exit codes: What exit codes does kiro-cli use for success/failure/timeout?
  4. Token usage reporting: Does Kiro CLI report token usage in its output? Sortie emits EventTokenUsage events for cost tracking.

Context

We use sortie to orchestrate agent-driven workflows (CI/CD, code generation, wiki updates) and would like to offer Kiro CLI as an alternative backend. Happy to contribute a PR if there's interest and the open questions above can be resolved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:agent-adapterAgent interface, Claude Code adapter, Copilot adapter, mock

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions