To edit files from terminal I use subl (for sublime text) in order to edit the file; example: If i need to edit app.js file I use subl app.js Is there any way I can set up webstorm to open from the terminal ?
15 Answers
Update January 2016 using Webstorm 11.0.3 on mac os x
There was no option as described in the accepted answer.
Instead, just use the already installed command line binary wstorm designed for this purpose. Location shown below:
If you actually wish to open webstorm and have it load the contents of the current working directory for example, then place a . after the command:
wstorm .
Noted, others had made similar comments in this answers section, and wished to clarify the situation.
I also downloaded WebStorm and wanted to use a similar shortcut to open files directly from the terminal.
I was surprised to find I already had a shortcut in my command line tools for webstorm:
subl is to Sublime as wstorm is to Webstorm.
Otherwise, as anstarovoyt has kindly pointed out, you can simply create your own shortcut via "Tools" > "Create Command Line Launcher"
Another way to do that:
open -a /Applications/WebStorm.app #Open last project
open -a /Applications/WebStorm.app Desktop #Open particular folder
open -a /Applications/WebStorm.app Desktop myscript.js #Open particular file
You can add alias to your config file:
#Edit your config:
vim ~/.bashrc
#add line:
alias ws='open -a /Applications/WebStorm.app'
#Read your config file:
source ~/.bashrc
Now you can use it:
ws . myscript.js
I know this is an older thread, but trying to achieve this using Windows was kind of a pain and I wasn't able to find anything specifically designed for my purposes. I created a Bash function that you can add as an alias (for Git Bash on Windows) that works similar to the command line functions in Visual Studio Code.
If you change the integrated terminal in WebStorm to Git Bash (instructions included in the Gist), you can perform the following actions:
Create a new file in the current working directory and open it in the editor:
wstorm foo.js
Create a new file in an existing relative path and open it in the editor:
wstorm foo/bar.js
This also works with subdirectories that don't exist:
wstorm this/path/doesnt/exist/file.js
If you're working in a Git Bash terminal (not in WebStorm) and want to open WebStorm up in the current directory, you can open it similar to Visual Studio Code:
wstorm .
Note: This needs to be done in a directory with a .idea folder.
As of 2019-03-09, WebStorm 2018.3.4 on Mac does not have Tools > "Create Command Line Launcher...". However, this works:
- WebStorm Preferences > Keymap > Main Menu > Tools > Create Command-line Launcher...
- Right-click "Create Command-line Launcher..." > Add Keyboard Shortcut
- Assign a keyboard shortcut
- Close Preferences
- Type the keyboard shortcut to open "Create Launcher Script"
- Click Ok to run the script
- You can now launch WebStorm from the terminal with
webstormand can choose a directory to open
A short solution relevant to the year 2021 for Linux users.
Just execute the comand:
sudo ln -s /<your path to Webstorm directory>/bin/webstorm.sh /usr/local/bin/webstorm
Since /usr/local/bin should be in the PATH environment variable by default, you should be able to run the webstorm command from anywhere in the shell.
More details Webstorm docs
I am running Windows 10 and whipped up a batch file (ws.bat) that implements this with optional command line argument for path to load).
:: place this batch file in your path and set to your WS EXE
:: ref: https://www.robvanderwoude.com/battech_defined.php
:: author: [email protected]
@echo off
set target=%1
if defined target (goto passedarg) else (goto noarg)
:passedarg
echo Starting WebStorm with '%target%'
"C:\Program Files\JetBrains\WebStorm 2018.3.2\bin\webstorm.exe" %target%
goto:EOF
:noarg
echo Starting WebStorm with 'Current Dir'
"C:\Program Files\JetBrains\WebStorm 2018.3.2\bin\webstorm.exe" .
Pretty simple but it works.
I know that this is a pretty old thread, but I recently came across this problem on Windows (I'm using the JetBrains Toolbox). With the following steps all new and existing applications that have been installed with the Toolbox will be added to your path!
Follow these steps to achieve this:
- Because of permissions, we need to create a new directory in your user. I named it
.path, so that I can also store any other application there in the future. So this will beC:\Users\<PC_USER>\.path\. - The the Toolbox click on the gear icon in the top right corner.
- Then click on
Enable Shell Scriptsand/orGenerate Shell Scripts. - In the input field that is located under the switch paste your path folder. (
C:\Users\<PC_USER>\.path\) - Open your
Edit the system environment variablesprogram that can be found in Windows search or the control panel. - Click on the
Environment Variables...button that is located in the right corner, a new window should pop up. - In the new window select the variable that says
Pathin theVariablecolumn from the top list and then click on the edit button that is situated under the top list. Another new window should pop-up. - Click on new and paste your path there. (
C:\Users\<PC_USER>\.path\) - Click on
OkinEdit environment variable>Environment Variables>System Properties. - Go to
C:\Users\<PC_USER>\.path\and all your toolbox installed applications should be there. - Restart your CLI and it should work.


open -a /Applications/Webstorm.appI cannot test right now - meda