Skip to content

Conversation

@marius-kilocode
Copy link
Collaborator

Summary

Fixes the Windows CLI authentication issue where kilocode auth shows an empty/invisible provider selection list and crashes with "Provider not found" when pressing Enter.

Root Cause

The inquirer v13+ upgrade introduced stricter TTY raw mode requirements. Without raw mode enabled, the list choices are not rendered properly and users cannot navigate with arrow keys. This affects both Windows and Linux terminals.

Solution

  • Add cli/src/auth/utils/terminal.ts with ensureRawMode() and withRawMode() utilities
  • Wrap all inquirer prompts with withRawMode() to ensure raw mode is properly enabled before interactive prompts
  • Add comprehensive test coverage for the terminal utilities

Testing

  • All 1959 CLI tests pass
  • Manual testing on Windows PowerShell and CMD should show provider list correctly

Fixes #5097

…dows

The inquirer v13+ upgrade introduced stricter TTY raw mode requirements.
This fix ensures raw mode is properly enabled before inquirer prompts,
restoring arrow key navigation in list selections like provider choice
during `kilocode auth`.

Fixes #5097
@changeset-bot
Copy link

changeset-bot bot commented Jan 16, 2026

🦋 Changeset detected

Latest commit: 331e243

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@kilocode/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@marius-kilocode marius-kilocode requested a review from a team January 16, 2026 12:15
@kiloconnect
Copy link
Contributor

kiloconnect bot commented Jan 16, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Overview

This PR introduces a well-designed fix for CLI interactive prompts (arrow key navigation) not working on Windows. The solution wraps inquirer prompts with a withRawMode() helper that ensures raw mode is properly enabled before prompts and restored afterward.

Key observations:

  • ✅ Clean implementation with proper error handling and cleanup
  • ✅ Graceful degradation when TTY is not available or setRawMode fails
  • ✅ Comprehensive test coverage for both ensureRawMode() and withRawMode() functions
  • ✅ Consistent application across all inquirer prompt usages in the auth flow
  • ✅ Good documentation explaining why this fix is needed (inquirer v13+ stricter TTY requirements)
Files Reviewed (7 files)
  • .changeset/fix-cli-interactive-prompts-windows.md - Changeset with clear description
  • cli/src/auth/index.ts - Added withRawMode wrapper to provider selection prompt
  • cli/src/auth/providers/factory.ts - Added withRawMode wrapper to generic auth prompts
  • cli/src/auth/providers/kilocode/shared.ts - Added withRawMode wrapper to organization selection
  • cli/src/auth/providers/kilocode/token-auth.ts - Added withRawMode wrapper to token input prompt
  • cli/src/auth/utils/terminal.ts - New utility module with ensureRawMode() and withRawMode() functions
  • cli/src/auth/utils/__tests__/terminal.test.ts - Comprehensive tests covering all edge cases

@marius-kilocode marius-kilocode enabled auto-merge (squash) January 16, 2026 12:23
@marius-kilocode marius-kilocode merged commit 15a8d77 into main Jan 16, 2026
12 checks passed
@marius-kilocode marius-kilocode deleted the 5097_bug_windows_cli_kilocode_auth branch January 16, 2026 12:33
@github-actions github-actions bot mentioned this pull request Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Windows CLI: "kilocode auth" provider list is empty & crashes with "Provider not found"

3 participants