Open workspace from CLI, instead of invoking the agent by default

Where does the bug appear (feature/product)?

Cursor CLI

Describe the Bug

My cursor-agent version is 2025.09.04-fc40cd1, also using the pre-release cycle of my Cursor Editor.

Over time, I’ve been using the shortcut cursor <pathname> or cursor . to open the editor directly in the workspace I’m in, but lately it just invokes the agent and starts the CLI in AI chat mode. I have tried looking around in the forums, and even the CLI help descriptions, but I can’t seem to find a way to open the editor directly. Right now, I am resorting to opening Cursor using Spotlight, then once it has loaded my previous workspace, I then have to open a new window and switch workspaces.

VS Code has always had the functionality to open a file/folder in the editor by running code <path>, and would love to have the same functionality on Cursor as well.

Steps to Reproduce

Open a terminal, run cursor .. It invokes the AI agent instead of opening the folder in the editor.

Expected Behavior

It should open the file/folder in the Cursor Editor window.

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.6.0-dev.36
VSCode Version: 1.99.3
Commit: 5f2772adfe856ebf92be474c1c613fc6e33f3380
Date: 2025-09-06T08:16:38.351Z
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Darwin arm64 25.0.0

Does this stop you from using Cursor

No - Cursor works, but with this issue

1 Like

Hey, thanks for the report. We’ll look into it.

@deanrie Thank you for the response.

I’d also like to add a workaround I’m using for now. This works only on macOS, but I’m sure the same idea can be replicated on other operating systems.

In my .zshrc file, I have this function:

function cursor() {
  if [ -n "$1" ]; then
    open -a Cursor $@
  else
    open -a Cursor
  fi
}

This lets me run cursor <path/to/file/folder> just like before. But I would still appreciate the option to do it via the official CLI so that I can communicate the same to others in my team using Cursor, but not on macOS.

3 Likes

Thanks for the shell function! I had the same impression as you today after upgrading.

By the way, I also tried using code since I was running code -n . for ages before Cursor came around, but unfortunately that doesn’t work either:

$ find /Applications/Cursor.app -type f -name code 
/Applications/Cursor.app/Contents/Resources/app/bin/code

$ /Applications/Cursor.app/Contents/Resources/app/bin/code -n .
error: unknown option '-n'

$ /Applications/Cursor.app/Contents/Resources/app/bin/code --help
Usage: cursor-agent [options] [command]

Cursor Agent
[...]
1 Like

This was fixed since my last comment, at least on the beta channel:

$ cursor --help | grep -E '^Usage| -n'
Usage: cursor-agent [options] [command] [paths.../prompt...]
  -n, --new-window              Force to open a new window.

cursor -n /some/directory does open it in a new window again.

/cc @AmruthPillai no need for a workaround anymore :slight_smile:

2 Likes

cursor editor /some/directory also works

1 Like

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.