Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

CLI Commands

Global Options

kg [OPTIONS] <COMMAND>

Options:

  • -d, --debug - Enable debug output
  • -t, --trace <AGENT_NAME> - Enable trace logging for specific agent (use all for everything)
  • -c, --color <WHEN> - Control color output: always, auto, never (default: auto)
  • -f, --format <FORMAT> - Output format: table, json (default: table)
  • -h, --help - Show help
  • -V, --version - Show version

Commands

validate

Validate configuration without generating files.

kg validate [OPTIONS]

Options:

  • --local - Ignore global ~/.kiro/generators/ config
  • --global - Ignore local .kiro/generators/ config
  • --show-skeletons - Include skeleton agents in output

Output:

Table view shows:

  • Agent name
  • Location (📁 local, 🏠 global, 🌍 both)
  • MCP servers configured
  • Allowed tools
  • Resources
  • Forced permissions

Examples:

# Validate all agents
kg validate

# Only validate local agents
kg validate --local

# Show skeletons in output
kg validate --show-skeletons

# JSON output for scripting
kg validate --format json

generate

Generate agent JSON files for kiro-cli.

kg generate [OPTIONS]

Options:

  • --local - Ignore global config, only generate local agents
  • --global - Ignore local config, only generate global agents
  • --show-skeletons - Include skeleton agents in output

Output:

Generates JSON files:

  • Global agents → ~/.kiro/agents/<agent-name>.json
  • Local agents → .kiro/agents/<agent-name>.json

Skeletons are never generated.

Examples:

# Generate all agents
kg generate

# Only generate global agents
kg generate --global

# Only generate local agents
kg generate --local

# Debug specific agent generation
kg generate --trace rust

version

Display version information.

kg version

Shows kg version and build info.

Output Formats

Table (default)

Human-readable table with agent details:

╭────────────────────┬─────┬─────────────────┬────────────────────────────────────────────────╮
│ Agent 🤖 (PREVIEW) ┆ Loc ┆ MCP 💻          ┆ Allowed Tools ⚙️                               │
╞════════════════════╪═════╪═════════════════╪════════════════════════════════════════════════╡
│ rust               ┆ 📁  ┆ cargo, rustdocs ┆ @cargo, @rustdocs, knowledge, read, web_search │
╰────────────────────┴─────┴─────────────────┴────────────────────────────────────────────────╯

JSON

Machine-readable output for scripting:

kg validate --format json | jq '.agents[] | select(.name == "rust")'

Debugging

Use trace logging to debug configuration issues:

# Trace specific agent
kg validate --trace rust

# Trace all agents (very verbose)
kg validate --trace all

# Debug mode (less verbose than trace)
kg validate --debug

Trace output shows:

  • Configuration file loading
  • Inheritance resolution
  • Merge operations
  • Force property application