Loading image...Kiro
  • CLI
  • Powers
  • Autonomous agent
  • Enterprise
  • Pricing
  • Docs
SIGN INDOWNLOADS
Loading image...Kiro
Loading image...Kiro
Product
  • About Kiro
  • CLI
  • Powers
  • Autonomous agent
  • Pricing
  • Downloads
For
  • Enterprise
  • Startups
  • Students
Resources
  • Documentation
  • Blog
  • Changelog
  • FAQs
  • Report a bug
  • Suggest an idea
  • Billing support
Social
Site TermsLicenseResponsible AI PolicyLegalPrivacy PolicyCookie Preferences
  1. Docs
  2. CLI
  3. Headless

Headless mode

On this page
  • Authentication
  • Running headless commands
  • CI/CD examples
  • GitHub Actions
  • Other patterns
  • Flags reference
  • Best practices
  • Limitations
  • Related

Headless mode lets you run Kiro CLI as part of your CI/CD pipeline to automate code reviews, generate tests, or troubleshoot build failures — no interactive terminal required. Authenticate with an API key, pass a prompt, and Kiro executes it end-to-end.

Authentication

Headless mode requires an API key set as the KIRO_API_KEY environment variable. If you haven't created one yet, follow the steps in Generate an API key.

Info

API key authentication is only available for Kiro Pro, Pro+, and Power subscribers. If your subscription is managed by an administrator, they need to enable API key generation first. See API key governance.

For details on authentication precedence and checking your active credentials, see Authentication.

Info

API keys are associated with your user account. Any governance rules configured by your Kiro administrator — including MCP server restrictions, model access policies, and web fetch permissions — apply to headless sessions the same way they apply to interactive ones.

Running headless commands

Pass --no-interactive along with your prompt:

bash
kiro-cli chat --no-interactive "your prompt here"

Since there's no user to approve tool calls, use --trust-all-tools or --trust-tools to grant permissions upfront:

bash
# Trust all tools kiro-cli chat --no-interactive --trust-all-tools "Write tests for the auth module and run them" # Trust only specific tool categories kiro-cli chat --no-interactive --trust-tools=read,grep "Find all TODO comments in src/"

CI/CD examples

GitHub Actions

yaml
name: Kiro Code Review on: [pull_request] jobs: review: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install Kiro CLI run: curl -fsSL https://cli.kiro.dev/install | bash - name: Review PR changes env: KIRO_API_KEY: ${{ secrets.KIRO_API_KEY }} run: kiro-cli chat --no-interactive --trust-tools=read,grep "Review the changes in this PR for security issues"

Other patterns

bash
# Generate and run tests kiro-cli chat --no-interactive --trust-all-tools "Write tests for the auth module and run them" # Troubleshoot a failing build cat build-error.log | kiro-cli chat --no-interactive "Explain this build failure and suggest a fix"

Use --require-mcp-startup to fail fast if MCP servers can't connect — useful for pipelines that depend on external tools. See exit codes for handling failures in scripts.

Flags reference

FlagDescription
--no-interactiveRun without an interactive session. Requires a prompt as an argument
--trust-all-toolsAuto-approve all tool calls without prompting
--trust-tools=<categories>Auto-approve specific tool categories (e.g., read, grep, write)
--require-mcp-startupFail immediately if any MCP server fails to connect

Best practices

  • Store KIRO_API_KEY as a secret in your CI/CD platform — never hardcode it in pipeline configs or commit it to source control.
  • Use --trust-tools with specific categories instead of --trust-all-tools to follow the principle of least privilege.
  • Add --require-mcp-startup when your pipeline depends on MCP servers to fail fast instead of hanging.
  • Pipe context into your prompt for richer results — for example, git diff | kiro-cli chat --no-interactive "Review these changes".
  • Check exit codes in your pipeline to handle failures gracefully.
  • Rotate API keys regularly and revoke any that are no longer in use from the Kiro portal.

Limitations

  • You must provide an initial prompt as an argument.
  • No mid-session user input is possible.
  • Interactive slash commands (/model picker, /agent picker) are not available.
  • Terminal UI features are disabled.

Related

  • Authentication — API key setup and authentication methods
  • Exit codes — Handle failures in scripts
  • CLI commands — Full CLI flag reference
Page updated: April 13, 2026
ACP
Experimental