MoonshotAI / MoonshotAI/kimi-code

install.ps1: powershell script might download release version faster by few lines changes in windows installation script

Open Beginner friendly
#697 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
7.5k
Forks
1.2k
Avg merge
11h 53m
Merged PRs (30d)
350

Description

Hi, this is ancient bug of powershell itself, related to: https://github.com/PowerShell/PowerShell/issues/2138
tl;dr: very slow downloading when used Invoke-WebRequest in powershell. That why its so slow to download binary from github.

Report & Suggestion about:

irm https://code.kimi.com/kimi-code/install.ps1 | iex

try {
  $binaryUrl = "$KimiBinaryBase/$version/$filename"
  $tmpBinary = Join-Path $tmp $filename
  Write-Step "Downloading $binaryUrl"
  Invoke-WebRequest -Uri $binaryUrl -OutFile $tmpBinary

  Write-Step "Verifying checksum"
  Test-Sha256 $tmpBinary $checksum

Windows 11, latest build.
Replace with: Start-BitsTransfer -Source

And this will help a lot to speedup downloading cli on windows.
Internet speed not issue here, i already reported earlier (not to Kimi) but to another big software about the issue and its fixed by simple changes in script.

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

Review the Windows installation path in install.ps1, starting at the Invoke-WebRequest call that downloads the binary. Check how the suggested Start-BitsTransfer replacement interacts with the existing temporary file and checksum verification. Done means the Windows installer downloads the release binary through the faster path while preserving checksum verification.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.