Kiro CLI Cheatsheet
CLI Commands
kiro-cli chat | Start interactive chat |
chat --agent <name> | Use specific agent |
chat --model <id> | Use specific model |
chat --resume | Resume last session |
chat --resume-picker | Interactive session picker |
chat --list-sessions | List saved sessions |
chat --delete-session <ID> | Delete a session |
chat --no-interactive "q" | Headless mode |
chat --trust-all-tools | Auto-approve all tools |
chat --trust-tools=a,b | Auto-approve specific tools |
chat --legacy-mode | Legacy terminal UI |
agent list|create|edit|validate|set-default | Manage agents |
settings list --all | List all settings |
settings <key> <value> | Set a setting |
settings --delete <key> | Delete a setting |
settings open | Open in editor |
mcp | Manage MCP servers |
login / logout / whoami | Authentication |
diagnostic | Run diagnostic tests |
acp | Start Agent Client Protocol |
Slash Commands — Session & Navigation
/help | Show all commands |
/quit /exit | Exit chat |
/chat new [prompt] | Fresh conversation |
/chat save <path> | Save session |
/chat load <path> | Load session |
/clear | Erase history |
/compact | Summarize to free context |
/context | View context usage |
/context add|remove|clear | Manage context files |
/transcript | Open in $PAGER |
/copy | Copy last response |
/usage | Show billing info |
Slash Commands — Agent & Model
/agent [name] | Switch agent |
/agent create | Create agent (AI-assisted) |
/agent edit [name] | Edit agent config |
/model [name] | Switch model |
/plan [prompt] | Switch to planner |
/guide [question] | Switch to guide |
/spawn <task> | Spawn parallel session |
Slash Commands — Tools & MCP
/tools | View tools & permissions |
/tools trust <names> | Trust for session |
/tools untrust <names> | Revert to approval |
/tools trust-all | Trust all tools |
/tools reset | Reset permissions |
/mcp | MCP server status |
/prompts | List/execute MCP prompts |
Slash Commands — Code & Knowledge
/code init|status|logs|overview|summary | Code intelligence |
/knowledge show|add|remove|update|clear|cancel | Knowledge bases |
Slash Commands — Editing & Misc
/editor [text] | Open $EDITOR to compose |
/reply | Editor with last response |
/paste | Paste image from clipboard |
/hooks | View hooks |
/theme | Change color theme |
/feedback | Submit feedback |
Built-in Tools
fs_read | Read files, dirs, images |
fs_write | Create/modify files |
execute_bash | Shell commands |
grep | Regex search in files |
glob | Find files by pattern |
code | Code intelligence (tree-sitter + LSP) |
use_aws | AWS CLI API calls |
knowledge | Knowledge base store/retrieve |
web_search | Search the web |
web_fetch | Fetch URL content |
subagent | Spawn sub-agents (DAG) |
todo_list | Task tracking |
introspect | Search Kiro docs |
Built-in Agents
kiro_default | General-purpose agent |
kiro_guide | Answers Kiro CLI questions |
kiro_planner | Structured planning |
Agent Configuration
JSON files in .kiro/agents/ (workspace) or ~/.kiro/agents/ (global)
{
"name": "my-agent",
"description": "...",
"prompt": "System prompt or file:///path",
"model": "<model-id>",
"tools": ["fs_read", "fs_write", "execute_bash"],
"allowedTools": ["fs_read", "grep"],
"toolsSettings": {
"fs_write": { "allowedPaths": ["src/**"] },
"execute_bash": { "autoAllowReadonly": true }
},
"resources": ["file://src/**/*.rs", "skill://.kiro/skills/**/SKILL.md"],
"hooks": { "agentSpawn": [{ "command": "git status" }] },
"mcpServers": { "git": { "command": "mcp-server-git", "args": ["--stdio"] } },
"keyboardShortcut": "ctrl+shift+r",
"welcomeMessage": "Ready!"
}
name | Agent identifier |
prompt | System prompt (inline or file://) |
tools | Available tools list |
allowedTools | Auto-approved (wildcards: fs_*, @server) |
toolsSettings | Per-tool config (paths, commands) |
resources | file:// always loaded, skill:// on-demand |
hooks | Lifecycle hook commands |
mcpServers | MCP servers (stdio or HTTP) |
toolAliases | Remap tool names |
keyboardShortcut | Quick-switch shortcut |
Hooks System
| Trigger | When | Block? |
agentSpawn | Agent initializes | No |
userPromptSubmit | User sends message | No |
preToolUse | Before tool runs | Yes (exit 2) |
postToolUse | After tool runs | No |
stop | Assistant finishes | No |
Exit Codes
- 0 — Success, STDOUT added to context
- 2 — Block tool (preToolUse only)
- Other — Warning, continues
Hook Options
command (required), matcher (tool pattern)
timeout_ms (default: 10000), max_output_size (default: 10240)
cache_ttl_seconds (default: 0)
Settings Reference
chat.defaultAgent <name>
chat.defaultModel <model-id>
chat.enableKnowledge true
chat.enableCodeIntelligence true
chat.enableSubagent true
chat.enableTodoList true
chat.enableThinking true
chat.enableNotifications true
chat.greeting.enabled false
chat.disableAutoCompaction true
chat.autoExpandToolOutput true
telemetry.enabled false
hooks.showStatus false
Knowledge Settings
knowledge.indexType Fast|Best
knowledge.maxFiles 10000
knowledge.chunkSize 512
knowledge.chunkOverlap 128
knowledge.defaultIncludePatterns '["**/*.rs"]'
knowledge.defaultExcludePatterns '["target/**"]'
Scopes
- Global:
~/.kiro/settings/cli.json
- Workspace:
.kiro/settings/cli.json
- Priority: Session > Workspace > Global
MCP Servers
Stdio (Local)
{ "command": "mcp-server-git",
"args": ["--stdio"],
"env": { "KEY": "value" },
"timeout": 120000,
"disabled": false,
"disabledTools": ["dangerous_tool"] }
HTTP (Remote)
{ "url": "https://mcp.example.com/sse",
"headers": { "Authorization": "Bearer $TOKEN" },
"oauthScopes": ["mcp", "profile"] }
Code Intelligence
Tree-sitter (Built-in, 18 languages)
Bash, C, C++, C#, Elixir, Go, Java, JS, Kotlin, Lua, PHP, Python, Ruby, Rust, Scala, Swift, TSX, TS
Ops: search_symbols, pattern_search, pattern_rewrite, generate_codebase_overview, search_codebase_map, get_document_symbols, lookup_symbols
LSP (requires /code init)
Ops: find_references, goto_definition, rename_symbol, format, get_diagnostics, get_hover, get_completions
Keyboard Shortcuts
Ctrl+C | Cancel / exit |
Ctrl+R | Search history |
Shift+Tab | Toggle plan/execution |
Up/Down | Navigate history |
File Locations
| Global agents | ~/.kiro/agents/ |
| Workspace agents | .kiro/agents/ |
| Global settings | ~/.kiro/settings/cli.json |
| Workspace settings | .kiro/settings/cli.json |
| Sessions | ~/.kiro/sessions/cli/ |
Environment Variables
EDITOR / VISUAL | Editor for /editor, /reply |
KIRO_CHAT_LOG_FILE | Override log location |
KIRO_LOG_NO_COLOR | Disable ANSI colors (set to 1) |
Tool Permission Levels
- allowed — Auto-approved
- requires-approval — Prompts each use (default)
- denied — Blocked
Tips
- Local agents override global with same name
- Use
--trust-all-tools in CI/headless mode
- Agent shortcuts toggle back to previous agent
skill:// on-demand vs file:// immediate
- Use
/compact near context limits
@server_name trusts all tools from MCP server
@builtin trusts all built-in tools