open project folder in IDE from terminal

I am suing phpstorm 2017 2.4 and I can not find any way to open IDE from project folder by command. I research in internet and i found this tools -> create command-line launcher. but there is nothing in tools menu in phpstorm 2017 2.4 please help how i can perform my task

0
6 comments

Hi there?

Your OS? That "tools -> create command-line launcher" you have mentioned should be available for Linux/Mac only. Not sure if it moved elsewhere etc -- I'm a Windows user.

Other than that -- you can create such "launcher" yourself. The idea is -- call PhpStorm executable and pass full path to the desired folder as a parameter -- IDE will launch and open that folder as a project (or create new project if it will not find existing .idea subfolder)

In general: https://www.jetbrains.com/help/phpstorm/opening-files-from-command-line.html

1
Avatar
Permanently deleted user

Thanks for your response, I am also a window's user and I didn't find any good way to create a command for launcher. can you please describe in details. I will really appreciate your response. 

i just want to create a command like in atom i write atom . and it opens atom with current directory

i am also looking same thing for phpstorm

0

>i just want to create a command like in atom i write atom . and it opens atom with current directory

That's what that launcher does on Linux/Mac.

For Windows you seem to have to create one yourself (not sure -- I have never bothered with this -- I'm launching it via standard shortcut and then choose what project I want to work with from Welcome screen -- it's not that different for me .. so why bother with launcher at all; plus, I'm mainly working with 1-2 projects whole day long .. so no need to constantly switching between many of them).

Anyway: create a "phpstorm.cmd" or "pstorm.cmd" (whatever the name you like the most) and just write this kind of command:

FULL\path\to\PhpStorm.exe $*
  • phpstorm.exe is for 32 bit JDK and phpstorm64.exe for 64-bit one
  • $* will pass ALL provided parameters as is

So it could be like this (you may adjust the path to match yours):

"C:\Program Files\JetBrains\PhpStorm\bin\phpstorm64.exe" $*

Now place it in a folder that is already present in your PATH environment variable (or add folder with such .cmd file there manually) and see how it will work.

 

NOTE: I'm not sure if "." (dot) will be recognized correctly though ... as IDE expects full path to the folder... and on Linux/Mac that launcher file seems to convert "." into actual full folder path.

1

Note: I'm using a Macbook

I did some testing and I got it to work exactly as I hoped on my Macbook

I ran Tools > Create Command Line Launcher

Then I opened a terminal to the folder I wanted to open in and entered "webstorm ."

Webstorm then opened in my current directory

1
Avatar
Permanently deleted user

I use Windows and on git bash in my ~/.bashrc I did:

alias pstorm='/c/Users/jkinsman/AppData/Local/JetBrains/Toolbox/apps/PhpStorm/ch-0/192.7142.51/bin/phpstorm.bat'

then source ~/.bashrc

and then

pstorm ./

0

Please sign in to leave a comment.