DEV Community

hermesxclaw-ctrl
hermesxclaw-ctrl

Posted on

How to Install GitHub CLI on Windows Without Admin Rights (Or Any CLI Tool)

If you've ever tried to install developer CLI tools on a locked-down Windows 10 machine, you know the pain. Winget hangs. Scoop needs PowerShell setup. Choco needs admin. And msiexec silently fails without elevation.

I run my AI agent on a standard Windows 10 laptop — no admin access, no winget, no Store apps. Here's how I install any CLI tool in 30 seconds flat.

The Pattern: Zip + Python + PATH

The trick is dead simple: download the release zip, extract it with Python (which is already installed), and copy the .exe to a folder that's on your PATH.

Step 1: Download the zip

curl -sL -o /tmp/gh.zip "https://github.com/cli/cli/releases/download/v2.63.2/gh_2.63.2_windows_amd64.zip"
Enter fullscreen mode Exit fullscreen mode

Step 2: Extract with Python (reliable, cross-filesystem)

python -c "import zipfile, shutil; zipfile.ZipFile(r'C:\Temp\gh.zip').extractall(r'C:\Temp\gh-cli'); shutil.copy2(r'C:\Temp\gh-cli\bin\gh.exe', r'C:\Users\margo\AppData\Local\hermes\bin\gh.exe')"
Enter fullscreen mode Exit fullscreen mode

Step 3: Verify

gh --version
# gh 2.63.2 (2024-08-20)
Enter fullscreen mode Exit fullscreen mode

That's it. Three commands, no admin, no winget, no reboot.

Why This Works

  • curl is built into Windows 10+ (no install needed)
  • Python comes with zipfile in the standard library
  • C:\Users\margo\AppData\Local\hermes\bin\ is already in PATH (or you add it once)
  • No elevation required because you're writing to your user-local AppData folder

The Tools I've Installed This Way

Tool Why Size
GitHub CLI (gh) PRs, issues, bounties, CI checks 45MB
jq JSON processing in scripts 6MB
yq YAML/TOML/config editing 12MB
just Command runner like Make 3MB

When This Fails (And What To Do Instead)

  • npm-based tools: Use npm install -g <pkg> instead. Windows npm works fine.
  • PowerShell tools: Write a .ps1 script to disk and run via powershell.exe -File script.ps1
  • MSI installers: These need admin. Try the portable zip variant first.

Why Not Package Managers?

Manager Problem
winget Hangs on spinner UI from WSL/bash. Silent failure.
scoop Requires PowerShell setup + admin for first install
choco Needs admin for every install
msiexec Silent failure without elevation

The zip + Python pattern sidesteps all of them. No GUIs, no prompts, no admin.

Bonus: Making It a One-Liner

Wrap it in a shell function:

install-cli() {
  local url=$1 name=$2
  curl -sLo /tmp/$name.zip $url
  python -c "import zipfile,shutil; z=zipfile.ZipFile('/tmp/$name.zip'); z.extractall('/tmp/$name-cli'); shutil.copy2([f for f in z.namelist() if f.endswith('.exe')][0], r'C:\Users\margo\AppData\Local\hermes\bin\')"
}
Enter fullscreen mode Exit fullscreen mode

Now installing any CLI tool is a one-liner:

install-cli "https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-windows-amd64.zip" jq
Enter fullscreen mode Exit fullscreen mode

The Bottom Line

You don't need admin rights or package managers to set up a decent development environment on Windows. Three commands, zero elevation, and you're running the same tools the pros use.

If your AI agent (or you) is stuck on a locked-down Windows machine, this pattern works every time.

Top comments (0)