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

**URL:** <https://forum.cursor.com/t/open-workspace-from-cli-instead-of-invoking-the-agent-by-default/132944>\
**Category:** Bug Reports\
**Tags:** cli, nightly\
**Created:** [September 8, 2025, 1:02pm UTC](https://forum.cursor.com/t/open-workspace-from-cli-instead-of-invoking-the-agent-by-default/132944 "2025-09-08T13:02:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![AmruthPillai](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/amruthpillai/32/78242_2.png) [@AmruthPillai](https://forum.cursor.com/u/AmruthPillai)\
**Post date:** [September 8, 2025, 1:02pm UTC](https://forum.cursor.com/t/open-workspace-from-cli-instead-of-invoking-the-agent-by-default/132944/1 "2025-09-08T13:02:45Z")

</div>

### 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

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [September 8, 2025, 1:58pm UTC](https://forum.cursor.com/t/open-workspace-from-cli-instead-of-invoking-the-agent-by-default/132944/2 "2025-09-08T13:58:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![AmruthPillai](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/amruthpillai/32/78242_2.png) [@AmruthPillai](https://forum.cursor.com/u/AmruthPillai)\
**Post date:** [September 8, 2025, 2:59pm UTC](https://forum.cursor.com/t/open-workspace-from-cli-instead-of-invoking-the-agent-by-default/132944/3 "2025-09-08T14:59:32Z")

</div>

@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:

```bash
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.

---

<div class="post-metadata">

**Author:** ![nff](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/nff/32/70283_2.png) [@nff](https://forum.cursor.com/u/nff)\
**Post date:** [September 11, 2025, 6:35am UTC](https://forum.cursor.com/t/open-workspace-from-cli-instead-of-invoking-the-agent-by-default/132944/4 "2025-09-11T06:35:40Z")

</div>

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:

```plaintext
$ 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
[...]

```

---

<div class="post-metadata">

**Author:** ![nff](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/nff/32/70283_2.png) [@nff](https://forum.cursor.com/u/nff)\
**Post date:** [September 21, 2025, 8:20pm UTC](https://forum.cursor.com/t/open-workspace-from-cli-instead-of-invoking-the-agent-by-default/132944/5 "2025-09-21T20:20:48Z")

</div>

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

```auto
$ 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 🙂

---

<div class="post-metadata">

**Author:** ![xoel](https://avatars.discourse-cdn.com/v4/letter/x/e36b37/32.png) [@xoel](https://forum.cursor.com/u/xoel)\
**Post date:** [September 30, 2025, 10:28am UTC](https://forum.cursor.com/t/open-workspace-from-cli-instead-of-invoking-the-agent-by-default/132944/6 "2025-09-30T10:28:59Z")

</div>

`cursor editor /some/directory` also works

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/system/32/99069_2.png) [@system](https://forum.cursor.com/u/system)\
**Post date:** [October 22, 2025, 10:29am UTC](https://forum.cursor.com/t/open-workspace-from-cli-instead-of-invoking-the-agent-by-default/132944/7 "2025-10-22T10:29:12Z")

</div>

Closed on October 22, 2025, 10:29am UTC

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