Skip to content

Instantly share code, notes, and snippets.

@shalomb
Created December 13, 2025 22:08
Show Gist options
  • Select an option

  • Save shalomb/f1dc6c84e60d80bfaceee024b533dd3c to your computer and use it in GitHub Desktop.

Select an option

Save shalomb/f1dc6c84e60d80bfaceee024b533dd3c to your computer and use it in GitHub Desktop.
Kiro CLI Social Login Workaround for Remote/SSH Environments

Kiro CLI Social Login Workaround for Remote/SSH Environments

Problem

Kiro CLI blocks social login (Google/GitHub) when running in remote environments (SSH sessions), showing:

Social login is not supported in remote environments. 
Please use BuilderID or Identity Center authentication.

Root Cause

The CLI detects remote environments by checking for SSH environment variables:

  • SSH_CLIENT
  • SSH_CONNECTION
  • SSH_TTY

When any of these are present, it forces device code flow and restricts login methods to BuilderID/IDC only.

Workaround

Copy social login tokens from a working local installation to the remote environment.

Step 1: Extract tokens from local machine

# On your local Mac/Windows where social login works
sqlite3 "/Users/username/Library/Application Support/kiro-cli/data.sqlite3" \
  "SELECT key, value FROM auth_kv WHERE key = 'kirocli:social:token';"

sqlite3 "/Users/username/Library/Application Support/kiro-cli/data.sqlite3" \
  "SELECT value FROM state WHERE key = 'api.codewhisperer.profile';"

Step 2: Insert tokens on remote machine

# On remote Linux machine
# Replace TOKEN_JSON with the actual token value from step 1
printf "INSERT OR REPLACE INTO auth_kv (key, value) VALUES ('kirocli:social:token', '%s');\n" \
  'TOKEN_JSON' | sqlite3 "/home/username/.local/share/kiro-cli/data.sqlite3"

# Replace PROFILE_JSON with the actual profile value from step 1  
printf "INSERT OR REPLACE INTO state (key, value) VALUES ('api.codewhisperer.profile', '%s');\n" \
  'PROFILE_JSON' | sqlite3 "/home/username/.local/share/kiro-cli/data.sqlite3"

Step 3: Verify

kiro-cli doctor  # Should show authentication success
kiro-cli chat --no-interactive  # Should work with your social login

Why This Works

  • Kiro CLI only blocks social login during the authentication flow
  • It doesn't prevent using existing social login tokens
  • The tokens are encrypted and tied to your social account
  • Database location: ~/.local/share/kiro-cli/data.sqlite3 (Linux/Mac)

Limitations

  • Tokens will eventually expire and need refreshing
  • You'll need to repeat this process when tokens expire
  • This is a workaround, not an official solution

Alternative Solutions

  1. Use BuilderID or Identity Center authentication (official recommendation)
  2. Run Kiro CLI locally and use SSH port forwarding for remote development
  3. Request official support for social login in remote environments

This workaround was discovered by analyzing the open source Amazon Q Developer CLI codebase and the closed source Kiro CLI behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment