Skip to content

Command-line launcher for JetBrains IDE which stores .idea in a separate directory

License

Notifications You must be signed in to change notification settings

nathan818fr/jetbrains-launcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 

Repository files navigation

JetBrains Launcher

A command-line launcher to open your projects in a JetBrains IDE, but with a twist: it stores the IDE config (.idea) in a separate directory!

Why is this beneficial?

Storing .idea in a separate directory has several advantages:

  1. Version control friendly: It's easier to manage your version control system (like Git) as you don't have to worry about excluding IDE-specific files. Also, your IDE will not break if a team member pushes its .idea content (it happens).
  2. Cleaner project directory: Your project directory remain clean and IDE agnostic.
  3. Support multiple IDEs: You can open your project with different JetBrains IDEs without having to worry about configuration conflicts (e.g. when using both IntelliJ IDEA and CLion, or PyCharm and CLion).

Installation

Supported platforms:

To install or update jetbrains-launcher, you should download jetbrains-launcher.sh, rename it to the name of the JetBrains IDE you want to use (e.g. idea or idea.sh), and put it in your PATH.

One-liners to do this are available below:

idea (IntelliJ IDEA logo IntelliJ IDEA, ultimate or community - click to expand)
  • 🐧 Linux, 🪟 Windows (using Bash)
    Download the launcher to ~/.local/bin/idea (make sure ~/.local/bin is in your PATH):

    curl -fsSL https://github.com/nathan818fr/jetbrains-launcher/raw/main/jetbrains-launcher.sh | install -vDT /dev/stdin ~/.local/bin/idea
  • 🍏 macOS (see requirements above)
    Download the launcher to ~/.local/bin/idea (make sure ~/.local/bin is in your PATH):

    mkdir -p ~/.local/bin && curl -fsSL https://github.com/nathan818fr/jetbrains-launcher/raw/main/jetbrains-launcher.sh -o ~/.local/bin/idea && chmod +x ~/.local/bin/idea
pycharm (PyCharm logo PyCharm, professional or community - click to expand)
  • 🐧 Linux, 🪟 Windows (using Bash)
    Download the launcher to ~/.local/bin/pycharm (make sure ~/.local/bin is in your PATH):

    curl -fsSL https://github.com/nathan818fr/jetbrains-launcher/raw/main/jetbrains-launcher.sh | install -vDT /dev/stdin ~/.local/bin/pycharm
  • 🍏 macOS (see requirements above)
    Download the launcher to ~/.local/bin/pycharm (make sure ~/.local/bin is in your PATH):

    mkdir -p ~/.local/bin && curl -fsSL https://github.com/nathan818fr/jetbrains-launcher/raw/main/jetbrains-launcher.sh -o ~/.local/bin/pycharm && chmod +x ~/.local/bin/pycharm
webstorm (WebStorm logo WebStorm - click to expand)
  • 🐧 Linux, 🪟 Windows (using Bash)
    Download the launcher to ~/.local/bin/webstorm (make sure ~/.local/bin is in your PATH):

    curl -fsSL https://github.com/nathan818fr/jetbrains-launcher/raw/main/jetbrains-launcher.sh | install -vDT /dev/stdin ~/.local/bin/webstorm
  • 🍏 macOS (see requirements above)
    Download the launcher to ~/.local/bin/webstorm (make sure ~/.local/bin is in your PATH):

    mkdir -p ~/.local/bin && curl -fsSL https://github.com/nathan818fr/jetbrains-launcher/raw/main/jetbrains-launcher.sh -o ~/.local/bin/webstorm && chmod +x ~/.local/bin/webstorm
phpstorm (PhpStorm logo PhpStorm - click to expand)
  • 🐧 Linux, 🪟 Windows (using Bash)
    Download the launcher to ~/.local/bin/phpstorm (make sure ~/.local/bin is in your PATH):

    curl -fsSL https://github.com/nathan818fr/jetbrains-launcher/raw/main/jetbrains-launcher.sh | install -vDT /dev/stdin ~/.local/bin/phpstorm
  • 🍏 macOS (see requirements above)
    Download the launcher to ~/.local/bin/phpstorm (make sure ~/.local/bin is in your PATH):

    mkdir -p ~/.local/bin && curl -fsSL https://github.com/nathan818fr/jetbrains-launcher/raw/main/jetbrains-launcher.sh -o ~/.local/bin/phpstorm && chmod +x ~/.local/bin/phpstorm
clion (CLion logo CLion - click to expand)
  • 🐧 Linux, 🪟 Windows (using Bash)
    Download the launcher to ~/.local/bin/clion (make sure ~/.local/bin is in your PATH):

    curl -fsSL https://github.com/nathan818fr/jetbrains-launcher/raw/main/jetbrains-launcher.sh | install -vDT /dev/stdin ~/.local/bin/clion
  • 🍏 macOS (see requirements above)
    Download the launcher to ~/.local/bin/clion (make sure ~/.local/bin is in your PATH):

    mkdir -p ~/.local/bin && curl -fsSL https://github.com/nathan818fr/jetbrains-launcher/raw/main/jetbrains-launcher.sh -o ~/.local/bin/clion && chmod +x ~/.local/bin/clion
rubymine (RubyMine logo RubyMine - click to expand)
  • 🐧 Linux, 🪟 Windows (using Bash)
    Download the launcher to ~/.local/bin/rubymine (make sure ~/.local/bin is in your PATH):

    curl -fsSL https://github.com/nathan818fr/jetbrains-launcher/raw/main/jetbrains-launcher.sh | install -vDT /dev/stdin ~/.local/bin/rubymine
  • 🍏 macOS (see requirements above)
    Download the launcher to ~/.local/bin/rubymine (make sure ~/.local/bin is in your PATH):

    mkdir -p ~/.local/bin && curl -fsSL https://github.com/nathan818fr/jetbrains-launcher/raw/main/jetbrains-launcher.sh -o ~/.local/bin/rubymine && chmod +x ~/.local/bin/rubymine
rustrover (RustRover logo RustRover - click to expand)
  • 🐧 Linux, 🪟 Windows (using Bash)
    Download the launcher to ~/.local/bin/rustrover (make sure ~/.local/bin is in your PATH):

    curl -fsSL https://github.com/nathan818fr/jetbrains-launcher/raw/main/jetbrains-launcher.sh | install -vDT /dev/stdin ~/.local/bin/rustrover
  • 🍏 macOS (see requirements above)
    Download the launcher to ~/.local/bin/rustrover (make sure ~/.local/bin is in your PATH):

    mkdir -p ~/.local/bin && curl -fsSL https://github.com/nathan818fr/jetbrains-launcher/raw/main/jetbrains-launcher.sh -o ~/.local/bin/rustrover && chmod +x ~/.local/bin/rustrover
goland (GoLand logo GoLand - click to expand)
  • 🐧 Linux, 🪟 Windows (using Bash)
    Download the launcher to ~/.local/bin/goland (make sure ~/.local/bin is in your PATH):

    curl -fsSL https://github.com/nathan818fr/jetbrains-launcher/raw/main/jetbrains-launcher.sh | install -vDT /dev/stdin ~/.local/bin/goland
  • 🍏 macOS (see requirements above)
    Download the launcher to ~/.local/bin/goland (make sure ~/.local/bin is in your PATH):

    mkdir -p ~/.local/bin && curl -fsSL https://github.com/nathan818fr/jetbrains-launcher/raw/main/jetbrains-launcher.sh -o ~/.local/bin/goland && chmod +x ~/.local/bin/goland
datagrip (DataGrip logo DataGrip - click to expand)
  • 🐧 Linux, 🪟 Windows (using Bash)
    Download the launcher to ~/.local/bin/datagrip (make sure ~/.local/bin is in your PATH):

    curl -fsSL https://github.com/nathan818fr/jetbrains-launcher/raw/main/jetbrains-launcher.sh | install -vDT /dev/stdin ~/.local/bin/datagrip
  • 🍏 macOS (see requirements above)
    Download the launcher to ~/.local/bin/datagrip (make sure ~/.local/bin is in your PATH):

    mkdir -p ~/.local/bin && curl -fsSL https://github.com/nathan818fr/jetbrains-launcher/raw/main/jetbrains-launcher.sh -o ~/.local/bin/datagrip && chmod +x ~/.local/bin/datagrip
dataspell (DataSpell logo DataSpell - click to expand)
  • 🐧 Linux, 🪟 Windows (using Bash)
    Download the launcher to ~/.local/bin/dataspell (make sure ~/.local/bin is in your PATH):

    curl -fsSL https://github.com/nathan818fr/jetbrains-launcher/raw/main/jetbrains-launcher.sh | install -vDT /dev/stdin ~/.local/bin/dataspell
  • 🍏 macOS (see requirements above)
    Download the launcher to ~/.local/bin/dataspell (make sure ~/.local/bin is in your PATH):

    mkdir -p ~/.local/bin && curl -fsSL https://github.com/nathan818fr/jetbrains-launcher/raw/main/jetbrains-launcher.sh -o ~/.local/bin/dataspell && chmod +x ~/.local/bin/dataspell

Usage

Use this launcher to open your projects from the command line rather than from the JetBrains IDEs interfaces. e.g.:

# Open ~/projects/my-project with IntelliJ IDEA:
idea ~/projects/my-project

# Open the current directory with IntelliJ IDEA:
idea .

👉️ If a project has been opened once with this launcher, you can re-open it from the "Recent Projects" interface (or you can use this launcher again).

⚠️ But you should NOT open it from "File > Open...".


Usage: command [options] <project-path>

Options:

  • -h, --help – Show help message and exit.
    Use this to see all options and environment variables (this readme only summarizes the most useful ones).
  • --reset – Reset existing project configuration (if any) before starting the IDE.
    This deletes the .idea directory created by this launcher, not the one that may already exist in your project directory.
  • --no-detach – Start the IDE in foreground instead of detaching it.

Configuration

Script naming

The launcher script should be named after the JetBrains IDE you want to use.
This check is case-insensitive and allows partial matches (e.g. Idea and open-idea-ide are valid names for IntelliJ IDEA).

Supported names (click to expand)

It's case-insensitive. * is a wildcard that matches none or any character(s).

  • *idea* or *intellij* for IntelliJ IDEA
  • *pycharm* for PyCharm
  • *webstorm* for WebStorm
  • *phpstorm* for PhpStorm
  • *clion*nova* for CLion Nova
  • *clion* for CLion
  • *rubymine* for RubyMine
  • *rustrover* for RustRover
  • *goland* for GoLand
  • *datagrip* for DataGrip
  • *dataspell* for DataSpell

If this behavior is not suitable for you, you can override it by setting the JETBRAINS_LAUNCHER_IDE_OVERRIDE environment variable.
e.g., adding an alias to your shell configuration:

alias java_ide='JETBRAINS_LAUNCHER_IDE_OVERRIDE=idea /path/to/jetbrains-launcher.sh'
# now you can use: java_ide ~/projects/my-project

Projects configuration directory

By default, this launcher stores the IDE projects' configurations under ~/.local/share/JetBrainsProjects.
You can change this by setting the JETBRAINS_PROJECTS_DIR environment variable.

👨‍🏫 If you open the project /home/me/my-project in IntelliJ IDEA with this launcher, the IDE configuration will be stored in ${JETBRAINS_PROJECTS_DIR}/idea/home/me/my-project.

Contributing

If you encounter a bug or have a feature request, please open an issue to let me know. 😄

If you are a developer and want to contribute to this project, consider opening an issue to discuss your idea before submitting a pull request.