Skip to content

[Bug]: Kiro login import misses Windows Kiro CLI token DB path #710

Description

@minerva32

Client or integration

OpenCodex dashboard

Area

Authentication and account pool

Summary

On Windows, ocx login kiro does not import an existing Kiro CLI login. It reports that no kiro-cli token was found and falls back to manual access-token input, even though kiro-cli whoami confirms an active login.

I expected OpenCodex to import the local Kiro CLI session automatically, the same way it does for the other supported CLI token-store locations.

Root cause appears to be credential discovery: the Kiro credential lookup does not include the Windows Kiro CLI default SQLite path.

Reproduction

  1. Install Kiro CLI on Windows with the official installer (irm 'https://cli.kiro.dev/install.ps1' | iex).
  2. Run kiro-cli login and complete sign-in.
  3. Confirm the session with kiro-cli whoami, which prints the logged-in account.
  4. Run ocx provider add kiro.
  5. Run ocx login kiro.
  6. Observe that the login prompts for a manual access token instead of importing the local CLI session.

Workaround that resolves it:

  1. Set the Windows Kiro CLI DB path as a persistent user environment variable:
[Environment]::SetEnvironmentVariable(
  'KIROCLI_DB_PATH',
  "$env:LOCALAPPDATA\Kiro-Cli\data.sqlite3",
  'User'
)
  1. Restart the proxy with ocx restart so the server process picks up the new environment.
  2. Run ocx login kiro again. It now succeeds without any manual token paste.

Note that setting the variable only in the calling shell is not enough, because the running proxy process performs the import and does not see the shell-local value.

The Windows Kiro CLI stores its auth database at:

%LOCALAPPDATA%\Kiro-Cli\data.sqlite3

That database has the expected shape, including an auth_kv row keyed kirocli:social:token and a state row keyed api.codewhisperer.profile.

Suggested fix: add %LOCALAPPDATA%\Kiro-Cli\data.sqlite3 to the Kiro credential discovery candidates alongside the existing macOS/Linux paths.

Version

2.7.42

Operating system

Windows 11 Pro 25H2 (10.0.26200)

Provider and model

kiro / kiro-auto

Logs or error output

> ocx login kiro

Opening browser for kiro login...

No kiro-cli token found. Paste a Kiro access token below (starts with 'aoa'). Otherwise install the Kiro CLI (`curl -fsSL https://cli.kiro.dev/install | bash`), run `kiro-cli login`, and retry - or set KIRO_ACCESS_TOKEN.
   No kiro-cli token found. Paste a Kiro access token (starts with 'aoa'), or install the Kiro CLI and run `kiro-cli login` first.
Paste redirect URL or code (or wait for browser):

# after setting KIROCLI_DB_PATH and running `ocx restart`
> ocx login kiro
Logged in via an existing local CLI/keychain token - no browser needed.
Logged in to kiro.

> ocx status
   OAuth logins:
     kiro       logged in

Redacted configuration

{
  "providers": {
    "kiro": {
      "adapter": "kiro",
      "baseUrl": "https://runtime.us-east-1.kiro.dev",
      "authMode": "oauth",
      "defaultModel": "kiro-auto"
    }
  }
}

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions