Kiro supports the following authentication providers:
kiro-cli or kiro-cli login. You'll be prompted to press Enter to complete sign-in in your browser.When running Kiro CLI on a remote machine (via SSH, SSM, containers, etc.), authentication works differently since the remote machine cannot open a browser.
Builder ID, IAM Identity Center, Google, and GitHub support device flow authentication in remote environments. The CLI displays a URL and a one-time code that you enter in any browser, no port forwarding required.
kiro-cli login and select your sign-in method (for example, Use with Builder ID, Use with Google, Use with GitHub, or Use with Your Organization)No port forwarding or tunnel setup required.
For CI/CD pipelines and automation scripts, you can authenticate using an API key instead of interactive sign-in.
Set the KIRO_API_KEY environment variable and run Kiro CLI in non-interactive mode:
export KIRO_API_KEY=ksk_xxxxxxxx kiro-cli chat --no-interactive "your prompt here"
On Windows:
$env:KIRO_API_KEY = "ksk_xxxxxxxx" kiro-cli chat --no-interactive "your prompt here"
API key authentication supports all Kiro CLI features available in non-interactive mode. For interactive sessions, use browser-based sign-in instead.
For CI/CD pipelines, automation scripts, and detailed headless usage, see Headless mode.
When multiple credentials are available, Kiro CLI uses this precedence order:
kiro-cli login)KIRO_API_KEY environment variableTo check which authentication method is active, run kiro-cli whoami.
Credits consumed using the API key are decremented from your subscription credits.
To sign out of Kiro CLI
kiro-cli logout.If you encounter problems during the authentication process, such as browser redirect failures or sign-in errors, check our troubleshooting guide for platform-specific solutions and common fixes.
Authentication methods