Cursor command doesn't work

Where does the bug appear (feature/product)?

Cursor CLI

Describe the Bug

Cursor command doesn’t work, tip: cursor-agent not found, installing via CLI · Cursor

Steps to Reproduce

just run “cursor .”

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

版本: 1.6.3
提交: 1.99.3
日期: 6ff61021bde05fe311c784a7d29c9320976128c0
Electron: 2025-09-09T22:59:10.623Z
ElectronBuildId: 34.5.8
Chromium: undefined
Node.js: 132.0.6834.210
V8: 20.19.1
OS: 13.2.152.41-electron.0

Does this stop you from using Cursor

No - Cursor works, but with this issue

2 Likes

you have to use cursor-agent for the CLI

cursor will open the IDE

Hey, thanks for the report, you need to install the command shell in the command palette.

1 Like

Now, every time you run the “cursor” command, it prompts, even if cursor-agent has already been installed

You guys changed the default behavior of the cursor command, and this completely broke all of my scripts!

2 Likes

You can simply try to reinstall the shell command, and it should fix the issue.

I’ve tried reinstalling. It doesn’t work. I’m on the beta release, so perhaps that’s what others are experiencing as well.

edit: Issue is fixed after switching and updating back to “Stable”

1 Like

@deanrie

/Applications/Cursor.app/Contents/Resources/app/bin/code in previous version:

#!/usr/bin/env bash
#
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.

# when run in remote terminal, use the remote cli
if [ -n "$VSCODE_IPC_HOOK_CLI" ]; then
	REMOTE_CLI="$(which -a 'cursor' | grep /remote-cli/)"
	if [ -n "$REMOTE_CLI" ]; then
		"$REMOTE_CLI" "$@"
		exit $?
	fi
fi

function app_realpath() {
	SOURCE=$1
	while [ -h "$SOURCE" ]; do
		DIR=$(dirname "$SOURCE")
		SOURCE=$(readlink "$SOURCE")
		[[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE
	done
	SOURCE_DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
	echo "${SOURCE_DIR%%${SOURCE_DIR#*.app}}"
}

APP_PATH="$(app_realpath "${BASH_SOURCE[0]}")"
if [ -z "$APP_PATH" ]; then
	echo "Unable to determine app path from symlink : ${BASH_SOURCE[0]}"
	exit 1
fi
CONTENTS="$APP_PATH/Contents"
ELECTRON="$CONTENTS/MacOS/Cursor"
CLI="$CONTENTS/Resources/app/out/cli.js"
export VSCODE_NODE_OPTIONS=$NODE_OPTIONS
export VSCODE_NODE_REPL_EXTERNAL_MODULE=$NODE_REPL_EXTERNAL_MODULE
unset NODE_OPTIONS
unset NODE_REPL_EXTERNAL_MODULE
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@"
exit $?

/Applications/Cursor.app/Contents/Resources/app/bin/code in 1.6.x:

#!/usr/bin/env bash
#
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.

function app_realpath() {
	SOURCE=$1
	while [ -h "$SOURCE" ]; do
		DIR=$(dirname "$SOURCE")
		SOURCE=$(readlink "$SOURCE")
		[[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE
	done
	SOURCE_DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
	echo "${SOURCE_DIR%%${SOURCE_DIR#*.app}}"
}

function find_cursor_cli() {
	# Clear the output variables
	CURSOR_CLI=""
	CURSOR_CLI_MODE=""

	# when run in remote terminal, use the remote cli
	if [ -n "$VSCODE_IPC_HOOK_CLI" ]; then
		REMOTE_CLI="$(which -a 'cursor' | grep /remote-cli/)"
		if [ -n "$REMOTE_CLI" ]; then
			CURSOR_CLI="$REMOTE_CLI"
			CURSOR_CLI_MODE="remote"
			return 0
		fi
	fi

	# Otherwise, use the electron app
	APP_PATH="$(app_realpath "${BASH_SOURCE[0]}")"
	if [ -z "$APP_PATH" ]; then
		echo "Unable to determine app path from symlink : ${BASH_SOURCE[0]}" >&2
		return 1
	fi
	CONTENTS="$APP_PATH/Contents"
	ELECTRON="$CONTENTS/MacOS/Cursor"
	CLI="$CONTENTS/Resources/app/out/cli.js"
	CURSOR_CLI="ELECTRON_RUN_AS_NODE=1 \"$ELECTRON\" \"$CLI\""
	CURSOR_CLI_MODE="local"
	return 0
}

# Main execution
export VSCODE_NODE_OPTIONS=$NODE_OPTIONS
export VSCODE_NODE_REPL_EXTERNAL_MODULE=$NODE_REPL_EXTERNAL_MODULE
unset NODE_OPTIONS
unset NODE_REPL_EXTERNAL_MODULE

# If cursor-agent exists, try to find CURSOR_CLI but don't fail if we can't
if find_cursor_cli 2>/dev/null; then
	# Export both variables if we found them
	if [ -n "$CURSOR_CLI" ]; then
		export CURSOR_CLI
		export CURSOR_CLI_MODE
	fi
fi

if ! command -v cursor-agent >/dev/null 2>&1; then
	echo "cursor-agent not found, installing via https://cursor.com/install ..."
	curl -sS https://cursor.com/install | bash >/dev/null 2>&1
	# Remove the previous log line from the terminal output
	tput cuu1 && tput el
fi

export CURSOR_CLI_COMPAT=1

exec ~/.local/bin/cursor-agent "$@"
3 Likes

it doesn’t fix the issue, only manually reverting the content of /usr/local/bin/code to the previous version that @lululau posted work.

Version: 1.6.6
VSCode Version: 1.99.3
Commit: 9455eaa4c87f2bad91eda3f2bc9b42b16eae1080
Date: 2025-09-11T01:16:54.096Z (7 hrs ago)
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.6.0

Thanks for the details @lululau and @Igloczek

Checking with the team on this

Also impacted by the same bug

Same issue here, cannot use any shell command (like commit with editor), the IDE become unusable…

same error

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Doing a echo hello | cursor - does not open cursor editor with text anymore. This was working till last update. Even cursor --version does not print anything

Steps to Reproduce

echo hello | cursor -

Expected Behavior

Open Cursor with temporary file containing hello

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.6.6
VSCode Version: 1.99.3
Commit: 9455eaa4c87f2bad91eda3f2bc9b42b16eae1080
Date: 2025-09-11T01:16:54.096Z
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

Yes - Cursor is unusable

Additional Info

$ which cursor
/Applications/Cursor.app/Contents/Resources/app/bin/code

If you look at the new one, this has maliciously and sneakily run curl -sS https://cursor.com/install | bash >/dev/null 2>&1 without asking.

WHAT THE HELL!!

I don’t want cursor-agent to be force installed on my machine. This makes it completely unacceptable on my corporate machine! Directly pulling a bash script and force running it with my user permissions is unacceptable.

4 Likes

For folks who don’t want to install cursor agent, set CURSOR_CLI_BLOCK_CURSOR_AGENT=true.
You’ll still get No such file or directory, and Cursor will still try to install cursor-agent, but at least the cli command will work.

Re: Cursor team, suggestions/code review:

  1. Allow any values for CURSOR_CLI_BLOCK_CURSOR_AGENT, that’s the common in idiom in bash.
  2. Cursor-agent shouldn’t be installed if the block is on. You’re missing an exit 0 after evaling the cli.
3 Likes

Where does the bug appear (feature/product)?

Cursor CLI

Describe the Bug

We want to use the cursor CLI to connect to a remove server. By setting the CURSOR_CLI_BLOCK_CURSOR_AGENT env, I expected it to actually “block” the of cursor-agent. But it doesn’t stop at launching IDE and still launches cursor-agent.

Steps to Reproduce

  1. Fresh install cursor, and add the cursor executable in the PATH
  2. run export CURSOR_CLI_BLOCK_CURSOR_AGENT=true and cursor

Expected Behavior

Only IDE GUI is launched.

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.6.23 (Universal)
VSCode Version: 1.99.3
Commit: 9b5f3f4f2368631e3455d37672ca61b6dce85430
Date: 2025-09-15T21:49:07.231Z
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Darwin x64 23.3.0

If you’ve already installed the cursor agent, you can run cursor editor in place of cursor for piping files into your editor.

(ex. some-process-that-generates-a-file | cursor - –> some-process-that-generates-a-file | cursor editor -)

Still not happy that they made this breaking change simply to slip a new tool into our workflows; would’ve been better to release this separately.

1 Like

i also got issue when i try to run cursor via my terminal appear like this

cursor-agent not found, installing via https://cursor.com/install ...

then

/usr/local/bin/cursor: line 112: /Users/<username>/.local/bin/cursor-agent: No such file or directory
/usr/local/bin/cursor: line 112: exec: /Users/<username>/.local/bin/cursor-agent: cannot execute: No such file or directory

i try installing cursor-agent

curl https://cursor.com/install -fsS | bash

then i did this

   echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
   source ~/.zshrc

i try running cursor-agent at terminal and cursor-agent didnt exist,also why we must install cursor-agent to run cursor.

Im running cursor Version: 1.6.23 at macos

1 Like

i run

> which cursor 
> /usr/local/bin/cursor

i uninstall then i run which cursor, cursor not found, then i install again the output is same,

currently i run cursor at cli by running

open -a cursor .