Kiro CLI Login Issues and Token Refresh Failures
Before opening, please confirm:
- [x] I have searched for duplicate or closed issues
Operating System
MacOS 26.5.1
Kiro Version
2.5.1
Bug Description
There are similar issues to this. However none seem exactly the same. There are one's talking about eager login expiry, the login process being iffy
Bug Report: Kiro CLI requires login on every new session
Summary
Each new Kiro CLI terminal session requires re-authentication, even when already logged in from another window.
Environment
- OS: macOS (Apple Silicon)
- Date: 2026-06-02
Actual Behavior
Every new terminal window running kiro-cli chat prompts for login, regardless of existing authenticated sessions.
Investigation Findings
Auth tokens are stored in a shared SQLite database:
- Location:
~/Library/Application Support/kiro-cli/data.sqlite3 - Table:
auth_kv - Key:
kirocli:external-idp:token
The shared storage infrastructure exists, but new sessions do not appear to pick up the existing valid token. No entry was found in the macOS Keychain for "kiro".
Possible Causes
- Token expiration without refresh — Only a short-lived access token is stored, with no refresh token to renew it silently.
- Missing token validation on startup — The CLI may not check
auth_kvfor an existing valid token before prompting login. - Database lock contention — Session
.lockfiles may prevent concurrent reads of the auth database.
Steps to Reproduce
- Open a terminal and run
kiro-cli chat - Complete the login flow
- Open a second terminal and run
kiro-cli chat - Observe: login is required again despite step 2
Expected Behavior
Logging in once should persist across all concurrent and subsequent CLI sessions without requiring re-authentication. In addition when the login expires the cli shouldn't just hang it should prompt the user to reauthenticate.
Conversation ID
No response
Additional Context
No response
🤖 Potential Duplicate Detected
This issue appears to be similar to:
- #9046: IDE Auth Issue After Authenticating CLI (85% similar)
- #7136: Relogin in Kiro IDE (85% similar)
- #6603: kiro-cli acp returns authMethods in initialize response despite being already authenticated via kiro-cli login (85% similar)
- #6255: Cannot login via CLI (85% similar)
- #6199: After enabling an experimental feature in Windows/WSL environment, running kiro-cli chat gives "Failed to sync resources for active agent: IO Error: Failed to create store" error and hangs. (85% similar)
- #6170: kiro-cli chat --no-interactive logs/errs Failed to get auth profile: missing field profile_name due to profile JSON casing mismatch (85% similar)
What happens next?
- ⏰ This issue will be automatically closed in 3 days
- 🏷️ If this is not a duplicate, you can prevent automatic closure by adding a comment or reacting with 👎 to this message.
- 💬 Comment on the original issue if you have additional information
Why is this marked as duplicate? Both report authentication issues with Kiro CLI on macOS, involving problems with login persistence and token management across sessions
Those issues are either not specific to the kiro-cli or not the same
Thank you for your feedback! 🙏
The duplicate label has been removed and this issue has been sent back for maintainer review.
A maintainer will review this issue shortly.
Hi @shanel-10x,
Thanks for raising this! We've marked it as a bug and will investigate further. Your investigation into the SQLite auth storage is helpful context for the fix.
Hey @shanel-10x could you provide a trace log file? It sounds like kiro-cli does not have permissions to write to your macOS keychain, which is required as part of authentication.
export KIRO_LOG_LEVEL=trace
kiro-cli login
# Log file on macOS at $TMPDIR/kirocli-log/cli.log
@brandonskiser
Unless I'm misunderstanding where that log file is:
export KIRO_LOG_LEVEL=trace
kiro-cli login
error: Already logged in, please logout with kiro-cli logout first
→ ~ cat $TMPDIR/kirocli-log/cli.log
cat: /var/folders/4w/4cc91nmn3h33x4771p4cp_0w0000gp/T//kirocli-log/cli.log: No such file or directory
Then immediately after it tells me it's logged in
→ ~ kiro-cli
You are not logged in. Login now?
❯ Yes
No
Apologies @shanel-10x , there was a bug it seems with logging around this flow that should be resolved in the latest version. The log file will be at $TMPDIR/kiro-log/cli.log
@brandonskiser Doesn't appear to be.
→ ~ kiro-cli --version
kiro-cli 2.6.1
→ ~ kiro-cli login
error: Already logged in, please logout with kiro-cli logout first
→ ~ cat $TMPDIR/kirocli-log/cli.log
cat: /var/folders/4w/4cc91nmn3h33x4771p4cp_0w0000gp/T//kirocli-log/cli.log: No such file or directory
@shanel-10x It looks like you're still using the kirocli-log path, can you try checking $TMPDIR/kiro-log/cli.log?
Today I had a similar issue and I found that using the sqlite3 query ".recover" multi-step process to recover the database addressed my issue.