Open PhpStorm from Terminal/Command line

Solution 1:

For opening your current working directory in PhpStorm

You need first open Phpstrom and then go to Tools menu and find the

Create Command-line launcher
Tools -> Create command line launcher

Then it will open a window which is for “Create Launcher Script”

It says specify the name of the script you want to use in the terminal. By default it choose “pstorm” and we can change it, but it’s ok for me.

and that’s it!

After this we can open any file or project from terminal. To do this, Navigate to the project/folder you want to open.

We need to use what is written after “/usr/local/bin/ “ that is pstorm.

pstorm filename

or

pstrom projectname

or go inside the project and just type

pstorm

Solution 2:

Open the .zshrc file or bash file and put this alias:

alias pstorm='open -a /Applications/PhpStorm.app "`pwd`"'

or

alias pstrom="open -a 'phpstorm.app'"

source the bash file

source .zshrc

and then use pstorm like solution 1

Navigate to the inside of the desired directory and do

pstorm .

It will open the whole current directory

Solution 3:

Type in terminal this:

open -a 'phpstorm.app' file-or-folder

See more here:

https://www.jetbrains.com/help/phpstorm/opening-files-from-command-line.htmlhttps://www.jetbrains.com/help/phpstorm/working-with-the-ide-features-from-command-line.html#standalonehttps://www.jetbrains.com/help/phpstorm/opening-files-from-command-line.html

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store