Summary
On Windows, /cursor:setup always fails with cursor-agent not found on PATH even when the CLI is installed (native PowerShell installer) and works fine from a terminal.
Root cause (two layers)
resolveBin() probes with which (scripts/lib/cursor.mjs) — which doesn't exist on Windows, so both candidates fail and the resolver throws.
- Even if the shim were found, it couldn't be spawned: the Windows install exposes
cursor-agent only as .cmd / .ps1 shims (%LOCALAPPDATA%\cursor-agent\cursor-agent.{cmd,ps1}), and the plugin spawns without shell: true. Since Node's CVE-2024-27980 fix, spawn() of a .cmd/.bat without a shell fails with EINVAL. Pointing CURSOR_AGENT_BIN at the shim therefore doesn't help either.
Fix that works (tested locally)
The official cursor-agent.ps1 shim just locates the newest version directory and runs its bundled node: %LOCALAPPDATA%\cursor-agent\versions\<YYYY.MM.DD[-HH-MM-SS]-hash>\node.exe index.js. The plugin can do the same thing directly:
- In
resolveBin(), add a win32 branch that scans %LOCALAPPDATA%\cursor-agent\versions\, picks the newest dir (numeric date compare, same as the .ps1), and resolves to that node.exe, remembering [index.js] as prefix args.
- Prepend those prefix args at each
run(bin, …) / spawn(bin, …) call site (7 sites: runHeadless, authStatus, listModels ×2, listConfiguredMcps, listChats, and the --version check in setup.mjs).
With that patch applied to the cached plugin, /cursor:setup on Windows 11 goes fully green (binary found at versions\2026.08.11-e8db854\node.exe, login detected, jobs dir writable) and headless delegation works.
Happy to share the full diff if useful.
Environment: Windows 11 Home 10.0.26200, plugin 0.6.1 (7174bd0), cursor-agent 2026.08.11-e8db854, Node 24.
Summary
On Windows,
/cursor:setupalways fails withcursor-agent not found on PATHeven when the CLI is installed (native PowerShell installer) and works fine from a terminal.Root cause (two layers)
resolveBin()probes withwhich(scripts/lib/cursor.mjs) —whichdoesn't exist on Windows, so both candidates fail and the resolver throws.cursor-agentonly as.cmd/.ps1shims (%LOCALAPPDATA%\cursor-agent\cursor-agent.{cmd,ps1}), and the plugin spawns withoutshell: true. Since Node's CVE-2024-27980 fix,spawn()of a.cmd/.batwithout a shell fails withEINVAL. PointingCURSOR_AGENT_BINat the shim therefore doesn't help either.Fix that works (tested locally)
The official
cursor-agent.ps1shim just locates the newest version directory and runs its bundled node:%LOCALAPPDATA%\cursor-agent\versions\<YYYY.MM.DD[-HH-MM-SS]-hash>\node.exe index.js. The plugin can do the same thing directly:resolveBin(), add awin32branch that scans%LOCALAPPDATA%\cursor-agent\versions\, picks the newest dir (numeric date compare, same as the.ps1), and resolves to thatnode.exe, remembering[index.js]as prefix args.run(bin, …)/spawn(bin, …)call site (7 sites:runHeadless,authStatus,listModels×2,listConfiguredMcps,listChats, and the--versioncheck insetup.mjs).With that patch applied to the cached plugin,
/cursor:setupon Windows 11 goes fully green (binary found atversions\2026.08.11-e8db854\node.exe, login detected, jobs dir writable) and headless delegation works.Happy to share the full diff if useful.
Environment: Windows 11 Home 10.0.26200, plugin 0.6.1 (7174bd0), cursor-agent 2026.08.11-e8db854, Node 24.