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/:
internal/agent/kiro/kiro.go — AgentAdapter implementation using the subprocess-per-turn model (like claude-code)
internal/agent/kiro/command.go — Build CLI args: kiro-cli chat --no-interactive --trust-tools=<tools> "prompt"
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
- 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.
- Session continuity: Does
kiro-cli support resuming sessions across turns (like claude --resume)? This affects whether sortie can maintain multi-turn conversations.
- Exit codes: What exit codes does
kiro-cli use for success/failure/timeout?
- 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.
Summary
Add a new
kiroagent kind to sortie, enabling Kiro CLI (formerly Amazon Q Developer CLI) as an agent backend alongsideclaude-code,copilot-cli, andcodex.Why Kiro CLI
Kiro CLI has strong alignment with sortie's existing architecture:
kiro-cli chat --no-interactive "prompt"— maps directly to sortie's subprocess-per-turn model used byclaude-codeandcopilot-cli.kiro/agents/*.jsonwith prompt, model, tools, resources, and hooks — could map to sortie's passthrough config block--trust-all-tools,--trust-tools=read,grep,write) — similar toclaude-code'spermission_modekiro-cli --agent <name>flagProposed Design
Workflow config
Adapter implementation
Following the existing pattern in
internal/agent/:internal/agent/kiro/kiro.go—AgentAdapterimplementation using the subprocess-per-turn model (likeclaude-code)internal/agent/kiro/command.go— Build CLI args:kiro-cli chat --no-interactive --trust-tools=<tools> "prompt"internal/agent/kiro/parse.go— Parse Kiro CLI stdout intodomain.AgentEventstructsRegistration:
Open questions
kiro-clisupport resuming sessions across turns (likeclaude --resume)? This affects whether sortie can maintain multi-turn conversations.kiro-cliuse for success/failure/timeout?EventTokenUsageevents 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.