This is a community patched version of the Cursor Agent CLI that runs natively on Windows.
⚠️ Disclaimer: This is an unofficial, community-maintained patch. The official Cursor Agent CLI only supports Linux and macOS. Use at your own risk.
- Interactive TUI mode - Full interactive terminal UI works!
- Print mode (
--print) - Non-interactive agent queries - Text output - Clean text responses
- JSON output - Machine-readable responses
- Authentication - Login and API key support
- Basic agent functionality - Code generation, questions, file operations, etc.
- Shell mode - PTY-based shell features are stubbed (may have limited functionality)
- Repository indexing - Semantic code search is stubbed out (local file operations still work)
-
Node.js 18+ installed and in PATH
- Download from: https://nodejs.org/
- Or use:
winget install OpenJS.NodeJS.LTS
-
Cursor subscription - You need a valid Cursor subscription
-
Download this folder to a location of your choice (e.g.,
C:\cursor-agent\) -
Add the folder to your PATH, or run directly:
C:\cursor-agent\cursor-agent.cmd --version
-
Authenticate with Cursor:
cursor-agent.cmd login
Or set your API key:
set CURSOR_API_KEY=your-api-key-here
REM Simple question
echo What is 2 + 2? | cursor-agent.cmd --print --output-format text agent -
REM With a specific model
echo Explain recursion | cursor-agent.cmd --print --output-format text --model claude-4-sonnet agent -
REM JSON output
echo List 3 colors | cursor-agent.cmd --print --output-format json agent -
REM Force auto-approve tools
echo Create a hello.txt file | cursor-agent.cmd --print --output-format text --force agent -# Using the PowerShell script
.\cursor-agent.ps1 --version
# Piping input
"What is the capital of France?" | .\cursor-agent.ps1 --print --output-format text agent --v, --version Output the version number
--api-key <key> API key for authentication
-p, --print Print mode (non-interactive)
--output-format <format> text | json | stream-json
--model <model> Model to use
-f, --force Auto-approve tool usage
--workspace <path> Set workspace directory
--help Show help
This version has the following modifications to make it work on Windows:
- MerkleClient Stub - Repository indexing is stubbed out since the native Windows binary isn't available
- PTY Stub - Shell command execution is stubbed (interactive TUI still works via Ink framework)
- File URL Fix - Fixed Linux file URLs in createRequire calls
- Binary Replacements:
rg.exe- Windows ripgrep from Cursor IDEnode_sqlite3.node- Windows SQLite3 from Cursor IDEpty.node- Windows node-pty from Cursor IDE
index.js- Main patched entry point (~16MB)cursor-agent.cmd- Windows batch launchercursor-agent.ps1- PowerShell launcherrg.exe/rg- Windows ripgrep binarynode_sqlite3.node- Windows SQLite3 native modulepty.node- Windows PTY native modulescreenshot_*.png- Demo screenshots
If you want to patch a newer version:
-
Get the Linux CLI package from:
curl https://cursor.com/install -fsSL | bash # Package will be in ~/.cursor/
-
Copy the package to Windows, run
npx terser index.js --beautify --comments all > index-new.js -
Apply patches to
index.js:- Replace
../merkle-tree/native.jsmodule with stub - Replace PTY dlopen with stub
- Fix
createRequirefile URLs
- Replace
-
Copy Windows binaries from Cursor IDE installation:
C:\Program Files\cursor\resources\app\node_modules\@vscode\ripgrep\bin\rg.exeC:\Program Files\cursor\resources\app\node_modules\@vscode\sqlite3\build\Release\vscode-sqlite3.node
- Cursor (Anysphere) - Original Cursor Agent CLI
- Inspired by this blog post on making Cursor Agent work on Windows
This patch is provided for educational purposes. The underlying Cursor Agent CLI is proprietary software owned by Anysphere.
Patched from: 2026.01.02-80e4d9b

