How to open WebStorm from the terminal on MacOS
If you prefer using a code editor plus separate terminal over a full IDE, opening WebStorm from the CLI isn’t as straightforward as with Atom or VSCode.
To set up a shortcut to open WebStorm:
- Open WebStorm
- Press `⇧` twice to open the search window
- Type “Create Command Line Launcher…” and press Enter
You’ll see this dialog box:
Whatever you type in there, your computer will run it as a script. You’re saying to it: “hi please store this thing webstorm
inside my local binary files”. Binary files are computer-readable but not human-readable, and when the computer reads a binary file, it executes it. (Actually, in this instance it’s a python script, it’s not a true binary file, but whatever. /bin
can just hold executable files).
To create the shortcut itself,
4. Type /usr/local/bin/{your-shortcut-here}
and press Enter
5. In the terminal, you’ll now be able to use the shortcut as a command, eg webstorm .
Eventually, I shortened my filename to /usr/local/bin/web
because the keys were ever so slightly too close together when typing webstorm .
or even ws .
— typing just web .
was a lot easier.
Enjoy!