MoonshotAI / MoonshotAI/kimi-cli

[Windows] kimi command stuck/unable to start/unresponsive - Python 3.13 asyncio compatibility issue (official installation script installs by default)

Open
#1,997 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
11.4k
Forks
1.3k
Avg merge
9h 47m
Merged PRs (30d)
2

Description

Problem Description (Symptoms)

After installing Kimi CLI on a Windows system, executing the kimi command results in no response / infinite hang / stuck (hang/stuck). The process starts but produces no output, no prompt, CPU usage stays at 0%, and it must be forcibly terminated via Task Manager.

Only kimi --version returns normally, all other commands are stuck.

Common Search Terms

If you are searching for these keywords, this issue is likely what you need:

  • kimi stuck, kimi hang, kimi freeze, kimi no response
  • kimi not working, kimi process stuck, kimi cli hang
  • kimi login stuck, kimi --debug stuck, kimi interactive shell stuck

Critical: Official Installation Method Causes This Bug

The official getting-started guide at https://www.kimi.com/code/docs/kimi-cli/guides/getting-started.html recommends:

# Windows official installer script (defaults to Python 3.13)
Invoke-RestMethod https://code.kimi.com/install.ps1 | Invoke-Expression

Additionally, the documentation explicitly recommends:

# For users with uv already installed (recommends Python 3.13)
uv tool install --python 3.13 kimi-cli

Both officially recommended installation methods result in a completely broken CLI on Windows, where all commands except --version hang indefinitely.

Affected Commands
  • kimi (interactive shell)
  • kimi login
  • kimi --debug
  • kimi --print
  • Any command that triggers the async event loop
Symptoms
  • Process starts but produces no output or prompt
  • Cursor may blink, but the > prompt never appears
  • CPU usage stays at 0%
  • Ctrl+C or Ctrl+D have no response
  • Must force-end via Task Manager

Root Cause

Python 3.13.12 (installed by default via uv) has a critical asyncio compatibility issue on Windows where asyncio.run() enters the event loop but never executes the coroutine.

Why does kimi --version work?

Because it uses an is_eager=True callback that exits before reaching asyncio.run(), avoiding the async event loop entirely.


Quick Verification (1 Minute Test)

If you are unsure whether you are experiencing the same issue, run these tests:

# Test 1: Check Python version
uv tool list
# If it shows kimi-cli using Python 3.13.x, this is your issue

# Test 2: Simple asyncio test
& "$env:APPDATA\uv\tools\kimi-cli\Scripts\python.exe" -c "import asyncio; asyncio.run(asyncio.sleep(0.1)); print('OK')"
# If this command also hangs, this is 100% confirmed

Solution (Verified)

Immediate Fix: Downgrade to Python 3.12
# Step 1: Uninstall the Python 3.13 version of kimi-cli
uv tool uninstall kimi-cli

# Step 2: Reinstall with Python 3.12
uv tool install --python 3.12 kimi-cli

# Step 3: Verify the fix
kimi --version          # Should show version number
kimi                    # Should show interactive Shell welcome screen
kimi login              # Should show login prompt

All commands work normally after downgrading.

Alternative: Use environment variable to bypass update check (if network is also an issue)
$env:KIMI_CLI_NO_AUTO_UPDATE = "1"
kimi

Reproduction Steps (Following Official Docs)

# Step 1: Run the official installer script (or the uv command from docs)
Invoke-RestMethod https://code.kimi.com/install.ps1 | Invoke-Expression
# Or: uv tool install --python 3.13 kimi-cli

# Step 2: Verify installation (this succeeds)
kimi --version  # Returns: kimi, version 1.37.0

# Step 3: Try using Kimi (this hangs forever)
kimi --debug    # No output, no prompt, must end via Task Manager
kimi            # Same as above
kimi login      # Same as above

Environment

Item Broken Working
OS Windows 11 -
Python 3.13.12 (default/recommended by official installer) 3.12.x
kimi-cli 1.37.0 1.37.0
uv 0.10.6 0.10.6
Terminal PowerShell / CMD PowerShell / CMD
Additional Context
  • kimi --version works because it uses the is_eager=True callback and exits before reaching asyncio.run()
  • Direct Python module execution (python -m kimi_cli) also hangs in the 3.13 environment
  • Simple asyncio.run(asyncio.sleep(0.1)) test also hangs in the 3.13 environment
  • This issue is unrelated to firewall, proxy settings, or MCP configuration - it is a Python 3.13 asyncio event loop bug

Suggested Actions

Urgent (Documentation Fix)
  • Update the getting-started documentation to explicitly recommend --python 3.12 for Windows users instead of 3.13
  • Add Python version detection and warnings to the Windows branch of the install.ps1 script
Short-Term (Installer Fix)
  • Modify install.ps1 to default to --python 3.12 on Windows
  • Or add a health check after installation that detects the asyncio hang and prompts users to downgrade
Long-Term (Root Cause Fix)
  • Investigate and fix the Python 3.13 asyncio compatibility issue on Windows (possibly related to ProactorEventLoop or SelectorEventLoop)
  • Consider adding timeout detection in code to prevent infinite hangs

Related Issues

  • #1984 - fix: terminal hang on exit and MCP connection leak (different hang issue, but similar symptoms)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the hang on Windows with the documented Python 3.13 installation and compare it with Python 3.12, including the standalone asyncio.run test. Then inspect install.ps1, the getting-started documentation, and the kimi_cli module entry point to determine whether the fix belongs in installation guidance, version detection, or async startup. Done means the agreed scope prevents or fixes the hang and the affected commands work normally.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell, python
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.