Skip to content

mrbrandao/ncursor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

ncursor - Cursor Profile Switcher

A simple shell script to manage multiple profiles for Cursor.

Cursor doesn't natively support multiple profiles (e.g., for work and personal use). This script helps you switch between different user configurations by managing the ~/.config/Cursor directory.

Notes and Motivation Cursor uses AppImage which does not support several CLI flags that are natively supported by vscode. For example, in vscode you can specify a custom user data directory using: code --user-data-dir /path/to/my/config/code.

Cursor also supports profiles, by using cursor --profile work for example, however profiles are saved in ~/.config/Cursor/profiles/User and this will only save settings, and will not allow you to change between cursor accounts.

In fact the Authentication Session of cursor is saved in the SQLite database in ~/.config/Cursor/User/globalStorage/state.vscdb, however in order to save everything it was easy to just switch between the entire cursor directories for now.

How It Works

The script works by renaming your active ~/.config/Cursor directory to ~/.config/Cursor-<profile-name> and then creating a symbolic link named Cursor pointing to the active profile's directory. This tricks Cursor into loading the settings, extensions, and authentication from the profile you choose.

Installation

  1. Clone or download the ncursor.sh script to your local machine.
  2. Make it executable:
    chmod +x ncursor.sh
  3. (Optional) Move it to a directory in your $PATH for easier access, like /usr/local/bin.

Usage

Here's a typical workflow for setting up and using multiple profiles.

1. Create Your First Profile (e.g., "work")

  1. Open Cursor for the first time.
  2. Log in with your work account and set up your preferences.
  3. Close Cursor.
  4. Run the init command to save this setup as the work profile:
    ./ncursor.sh init work
    This will rename ~/.config/Cursor to ~/.config/Cursor-work and create a symlink ~/.config/Cursor pointing to it.

2. Create a Second Profile (e.g., "personal")

  1. Detach the current profile. This removes the symlink, so Cursor will start fresh.
    ./ncursor.sh detach
  2. Open Cursor again. It will be like a fresh installation.
  3. Log in with your personal account.
  4. Close Cursor.
  5. Run the init command to save this as your personal profile:
    ./ncursor.sh init personal

3. Switch Between Profiles

Now you can easily switch between your saved profiles.

  • List available profiles:

    ./ncursor.sh list

    Output:

    Available profiles:
    work
    personal
    
  • Switch to a different profile:

    ./ncursor.sh use work

    This command will stop any running Cursor process, update the ~/.config/Cursor symlink to point to the work profile, and let you know the switch was successful.

  • Check the currently active profile:

    ./ncursor.sh get

    Output:

    Using Context:
    work
    

Commands

  • ncursor.sh init <profile-name>: Saves the current Cursor configuration as a new profile.
  • ncursor.sh list: Lists all saved profiles.
  • ncursor.sh use <profile-name>: Switches the active Cursor profile.
  • ncursor.sh get: Shows the currently active profile.
  • ncursor.sh detach: Removes the active profile symlink, allowing a fresh start.
  • ncursor.sh help: Shows the usage message.

About

Switch Between Cursor Directories

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages