# How to open cursor from terminal

**URL:** <https://forum.cursor.com/t/how-to-open-cursor-from-terminal/3757>\
**Category:** Help\
**Created:** [March 27, 2024, 4:06am UTC](https://forum.cursor.com/t/how-to-open-cursor-from-terminal/3757 "2024-03-27T04:06:14Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![trhun](https://avatars.discourse-cdn.com/v4/letter/t/e47774/32.png) [@trhun](https://forum.cursor.com/u/trhun)\
**Post date:** [March 27, 2024, 4:06am UTC](https://forum.cursor.com/t/how-to-open-cursor-from-terminal/3757/1 "2024-03-27T04:06:14Z")

</div>

Dear all,

I’m new to Cursor IDE. Could anyone here teach me how to open Cursor IDE from terminal such as the way to often do when using VSCode "open terminal → cd to folder → typing ‘code .’ ". Is there the same way for Cursor?

---

<div class="post-metadata">

**Author:** ![PerFrivik](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@PerFrivik](https://forum.cursor.com/u/PerFrivik)\
**Post date:** [March 27, 2024, 8:49am UTC](https://forum.cursor.com/t/how-to-open-cursor-from-terminal/3757/2 "2024-03-27T08:49:55Z")

</div>

I have the same issue that this feature fails during installation.

---

<div class="post-metadata">

**Author:** ![Jakob](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/jakob/32/93_2.png) [@Jakob](https://forum.cursor.com/u/Jakob)\
**Post date:** [March 27, 2024, 8:30pm UTC](https://forum.cursor.com/t/how-to-open-cursor-from-terminal/3757/3 "2024-03-27T20:30:32Z")

</div>

You need to run the `Shell Command: Install 'cursor' command` command from the Command Palette in Cursor.

---

<div class="post-metadata">

**Author:** ![Otto](https://avatars.discourse-cdn.com/v4/letter/o/bbe5ce/32.png) [@Otto](https://forum.cursor.com/u/Otto)\
**Post date:** [April 11, 2024, 12:17am UTC](https://forum.cursor.com/t/how-to-open-cursor-from-terminal/3757/4 "2024-04-11T00:17:02Z")

</div>

not available on ubuntu is it normal?

---

<div class="post-metadata">

**Author:** ![syd](https://avatars.discourse-cdn.com/v4/letter/s/3d9bf3/32.png) [@syd](https://forum.cursor.com/u/syd)\
**Post date:** [July 29, 2024, 10:35pm UTC](https://forum.cursor.com/t/how-to-open-cursor-from-terminal/3757/5 "2024-07-29T22:35:35Z")

</div>

> **[Running Visual Studio Code on macOS](https://code.visualstudio.com/docs/setup/mac#_launching-from-the-command-line)**
>
> Get Visual Studio Code up and running on Mac (macOS).

---

<div class="post-metadata">

**Author:** ![miguelsanchezp](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/miguelsanchezp/32/7251_2.png) [@miguelsanchezp](https://forum.cursor.com/u/miguelsanchezp)\
**Post date:** [August 25, 2024, 7:34pm UTC](https://forum.cursor.com/t/how-to-open-cursor-from-terminal/3757/6 "2024-08-25T19:34:06Z")

</div>

Hey! Not an official answer, but I managed to get it working by creating a function in `.bashrc` or `.zshrc` that points to the .AppImage (I create a function instead of an alias in order to use arguments). I did it as follows:

**On zsh** :

```zsh
function cursor {
        /home/user/path_to_appimage/Cursor.AppImage $@
}

```

**On bash** :

```bash
cursor() {
    /home/user/path_to_appimage/Cursor.AppImage "$@"
}

```

So far I have encountered no issues, since it works as the `code` command. For example, `cursor .` opens a window in the current directory or `cursor file_1 file_2 file_3` opens all three files.

---

<div class="post-metadata">

**Author:** ![alindsay55661](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/alindsay55661/32/3535_2.png) [@alindsay55661](https://forum.cursor.com/u/alindsay55661)\
**Post date:** [August 26, 2024, 4:01pm UTC](https://forum.cursor.com/t/how-to-open-cursor-from-terminal/3757/7 "2024-08-26T16:01:14Z")

</div>

This doesn’t work in some of the windows terminals however. For example, my default terminal is GitBash and the command is unrecognized there where vscode works fine.

---

<div class="post-metadata">

**Author:** ![TaylorDev](https://avatars.discourse-cdn.com/v4/letter/t/b3f665/32.png) [@TaylorDev](https://forum.cursor.com/u/TaylorDev)\
**Post date:** [August 28, 2024, 4:05am UTC](https://forum.cursor.com/t/how-to-open-cursor-from-terminal/3757/8 "2024-08-28T04:05:48Z")

</div>

Thanks! I was able to get this to work on Mac by adding this to `~/.zshrc`

```auto
function cursor {
  open -a "/Applications/Cursor.app" "$@"
}

```

---

<div class="post-metadata">

**Author:** ![mvavassori](https://avatars.discourse-cdn.com/v4/letter/m/779978/32.png) [@mvavassori](https://forum.cursor.com/u/mvavassori)\
**Post date:** [September 3, 2024, 7:22pm UTC](https://forum.cursor.com/t/how-to-open-cursor-from-terminal/3757/9 "2024-09-03T19:22:08Z")

</div>

With your solution it kept sending messages such as the PID number and other annoying info when i’d close the app. With this slight alteration i don’t see any weird messages in the terminal:

```auto
function cursor {
  (nohup /path/to/cursor.appimage "$@" > /dev/null 2>&1 &)
}

```

(I’m on Ubuntu)

---

<div class="post-metadata">

**Author:** ![himelmaj](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/himelmaj/32/4392_2.png) [@himelmaj](https://forum.cursor.com/u/himelmaj)\
**Post date:** [September 10, 2024, 8:32pm UTC](https://forum.cursor.com/t/how-to-open-cursor-from-terminal/3757/10 "2024-09-10T20:32:22Z")

</div>

Open Your Cursor App

CMD(Ctrl) + Shift + P

Shell Command :Install Cursor command

---

<div class="post-metadata">

**Author:** ![semijacks](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/semijacks/32/4843_2.png) [@semijacks](https://forum.cursor.com/u/semijacks)\
**Post date:** [September 14, 2024, 10:53pm UTC](https://forum.cursor.com/t/how-to-open-cursor-from-terminal/3757/11 "2024-09-14T22:53:18Z")

</div>

Worked like a charm. Thanks

---

<div class="post-metadata">

**Author:** ![bowman](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/bowman/32/25347_2.png) [@bowman](https://forum.cursor.com/u/bowman)\
**Post date:** [September 16, 2024, 12:58am UTC](https://forum.cursor.com/t/how-to-open-cursor-from-terminal/3757/12 "2024-09-16T00:58:08Z")

</div>

On Ubuntu 24.04: option to add `code` or `cursor` command fails during setup, and there’s no shell command in command palette.

---

<div class="post-metadata">

**Author:** ![trustor](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/trustor/32/7803_2.png) [@trustor](https://forum.cursor.com/u/trustor)\
**Post date:** [September 19, 2024, 9:47am UTC](https://forum.cursor.com/t/how-to-open-cursor-from-terminal/3757/13 "2024-09-19T09:47:03Z")

</div>

confirming this ☝

---

<div class="post-metadata">

**Author:** ![nachomac12](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/nachomac12/32/5564_2.png) [@nachomac12](https://forum.cursor.com/u/nachomac12)\
**Post date:** [September 20, 2024, 1:53am UTC](https://forum.cursor.com/t/how-to-open-cursor-from-terminal/3757/14 "2024-09-20T01:53:02Z")

</div>

Hey there, I’ve implemented this workaround in Pop Os which is a distro based on Ubuntu. I’m using zsh so it would be like this:

```auto
nano $HOME/.zshrc

function cursor() {
    /home/<your_username>/<path_to_appimage> </dev/null &>/dev/null $1 &
}

source $HOME/.zshrc

```

Usage:

```auto
cursor <your_file_or_folder>

```

Hope it works for you guys 🙂

---

<div class="post-metadata">

**Author:** ![jramiresbrito](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/jramiresbrito/32/5942_2.png) [@jramiresbrito](https://forum.cursor.com/u/jramiresbrito)\
**Post date:** [September 24, 2024, 9:55am UTC](https://forum.cursor.com/t/how-to-open-cursor-from-terminal/3757/15 "2024-09-24T09:55:40Z")

</div>

On Ubuntu 22.04.5 LTS this option is not available.

---

<div class="post-metadata">

**Author:** ![josh0x](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/josh0x/32/7296_2.png) [@josh0x](https://forum.cursor.com/u/josh0x)\
**Post date:** [October 5, 2024, 4:14am UTC](https://forum.cursor.com/t/how-to-open-cursor-from-terminal/3757/16 "2024-10-05T04:14:34Z")

</div>

After you run this shell command… then what?

---

<div class="post-metadata">

**Author:** ![dawoodjee](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/dawoodjee/32/7273_2.png) [@dawoodjee](https://forum.cursor.com/u/dawoodjee)\
**Post date:** [October 7, 2024, 9:51am UTC](https://forum.cursor.com/t/how-to-open-cursor-from-terminal/3757/17 "2024-10-07T09:51:08Z")

</div>

Added this to Ubuntu `bashrc` file

sudo nano ~/.bashrc

```auto
function cursor {
    if [[$# = 0]]
    then
        open -a "Cursor"
    else
        local argPath="$1"
        [[$1 = /*]] && argPath="$1" || argPath="$PWD/${1#./}"
        open -a "Cursor" "$argPath"
    fi
}

```

Load the changes

```auto
source ~/.bashrc

```

I suspect this should with `zsh` as well

---

<div class="post-metadata">

**Author:** ![madhavmadupu](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/madhavmadupu/32/8355_2.png) [@madhavmadupu](https://forum.cursor.com/u/madhavmadupu)\
**Post date:** [October 13, 2024, 12:00pm UTC](https://forum.cursor.com/t/how-to-open-cursor-from-terminal/3757/18 "2024-10-13T12:00:07Z")

</div>

In Ubuntu just do this:

1. Run:  
find ~/ -name “\*.AppImage”  
and copy the cursor path

2. Open .zshrc file and paste this:  
function cursor {  
/home/madhavmadupu/Applications/cursor-0.40.3x86\_64\_0624b665a8721425564eff1bb6c8cc88.AppImage $@  
}

3. Done!

---

<div class="post-metadata">

**Author:** ![alejorrojas](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/alejorrojas/32/91725_2.png) [@alejorrojas](https://forum.cursor.com/u/alejorrojas)\
**Post date:** [October 14, 2024, 2:59pm UTC](https://forum.cursor.com/t/how-to-open-cursor-from-terminal/3757/19 "2024-10-14T14:59:46Z")

</div>

In my case (macOS), I just ran:

CMD + Shift + P

Shell Command :Install Cursor command

After that, navigate to your folder in the terminal and run `cursor .`

---

<div class="post-metadata">

**Author:** ![alejorrojas](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/alejorrojas/32/91725_2.png) [@alejorrojas](https://forum.cursor.com/u/alejorrojas)\
**Post date:** [October 14, 2024, 3:02pm UTC](https://forum.cursor.com/t/how-to-open-cursor-from-terminal/3757/20 "2024-10-14T15:02:25Z")

</div>

After that, navigate to your folder in the terminal and run `cursor .` (macOS)

[Next page](https://forum.cursor.com/t/how-to-open-cursor-from-terminal/3757.md?page=2)
