Windows CLI launcher fails after update: version directory regex no longer matches new folder format

Where does the bug appear (feature/product)?

Cursor CLI

Describe the Bug

Description:
After a recent Cursor CLI update on Windows, running agent (or cursor-agent) fails immediately with:
C:\Users\hugom\AppData\Local\cursor-agent\agent.ps1 : No version directories found in C:\Users\hugom\AppData\Local\cursor-agent
Environment

OS: Windows 10/11 (PowerShell 5.1.26100.8655)

Install path: %LOCALAPPDATA%\cursor-agent

Version directories present under versions:

2026.06.16-20-30-07-a07d3ac

2026.06.19-20-24-33-653a7fb
Root cause
The launcher scripts agent.ps1 and cursor-agent.ps1 filter version folders with this regex:
$name -match ‘^\d{4}.\d{1,2}.\d{1,2}-[a-f0-9]+$’
That pattern expects the old format: YYYY.MM.DD-
The installer now creates folders with a timestamp: YYYY.MM.DD-HH-MM-SS-
Because none of the installed version directories match the regex, the script exits with “No version directories found”.
Suggested fix
Update the regex in both agent.ps1 and cursor-agent.ps1 to accept the optional time segment:
$name -match ‘^\d{4}.\d{1,2}.\d{1,2}(-\d{1,2}-\d{1,2}-\d{1,2})-[a-f0-9]+$’
Optionally, update Parse-VersionString to include HH-MM-SS when sorting versions on the same day.
Workaround (local patch)
Manually edit the two .ps1 files under %LOCALAPPDATA%\cursor-agent\ with the regex above. After the change, agent --version works again. Note: a future CLI update may overwrite these files.

Steps to Reproduce

Install or update Cursor CLI on Windows.
2.
Confirm that %LOCALAPPDATA%\cursor-agent\versions\ contains folders in the new format, e.g. 2026.06.19-20-24-33-653a7fb.
3.
Open PowerShell and run agent or cursor-agent.
4.
Observe the error: No version directories found in C:\Users<user>\AppData\Local\cursor-agent.
To confirm the mismatch, inspect agent.ps1 line 48 — the regex only accepts YYYY.MM.DD-, not YYYY.MM.DD-HH-MM-SS-.

Expected Behavior

The launcher should detect the latest version directory under versions, then run the bundled node.exe and index.js for that version. Running agent --version should print the active CLI version (e.g. 2026.06.19-20-24-33-653a7fb).

Operating System

Windows 10/11

Version Information

CLI:
CLI Version 2026.06.19-20-24-33-653a7fb
OS win32 (x64)
Shell cmd / PowerShell 5.1.26100.8655
Subscription Tier Pro

Additional Information

Affected files: %LOCALAPPDATA%\cursor-agent\agent.ps1 and %LOCALAPPDATA%\cursor-agent\cursor-agent.ps1 (same logic in both).

The bug appears to be a mismatch between the installer (new folder naming) and the launcher scripts (old regex), not a missing installation.

Before applying the local regex patch, the CLI was completely non-functional on Windows — every invocation of agent failed at startup.

After manually updating the regex locally, agent about and agent --version work correctly with version 2026.06.19-20-24-33-653a7fb.

This workaround is fragile: the next official CLI update may overwrite the patched .ps1 files and break the CLI again

Does this stop you from using Cursor

Yes - Cursor is unusable

Hey, thanks for the detailed report, your diagnosis is correct. The Windows launcher scripts agent.ps1 and cursor-agent.ps1 filter version folders using a regex that was built for the old YYYY.MM.DD-<commit> format, and it doesn’t match the new YYYY.MM.DD-HH-MM-SS-<commit> format. This is a known bug on our side and it’s being tracked. I can’t share a fix timeline yet.

Your workaround is correct, it’s a valid option until we ship a fix. I’d just use a slightly simpler regex that’s more future-proof (line 48) in both files under %LOCALAPPDATA%\cursor-agent\:

$name -match '^\d{4}\.\d{1,2}\.\d{1,2}-.+$'

Your version with the optional group (-\d{1,2}-\d{1,2}-\d{1,2})? also works and it’s stricter, but if the version format changes again, it can break again. -.+$ is safer long term.

As you noted, the next CLI update may overwrite the patched .ps1 files, so you might need to reapply the change after updating.

Alternative option is to run the payload directly and skip the launcher:

& "%LOCALAPPDATA%\cursor-agent\versions\<version>\node.exe" "%LOCALAPPDATA%\cursor-agent\versions\<version>\index.js" --version

Once I have an update on the fix, I’ll reply in the thread.

Hey, quick promised update: we shipped a fix for this issue. The launcher scripts now correctly detect the new version folder format YYYY.MM.DD-HH-MM-SS-<commit>.

What to do:

  1. Run agent update to pull the latest launcher.
  2. After the update, check agent --version. It should work without any manual regex edits.

Since the update overwrites the .ps1 files in %LOCALAPPDATA%\cursor-agent\, your local regex patch isn’t needed anymore. The official scripts already include the fixed pattern. If you previously edited agent.ps1 or cursor-agent.ps1 by hand, after agent update they’ll be updated to the correct versions.

Let me know if you still see “No version directories found” after updating, and we’ll dig deeper.