Open PhpStorm from Terminal/Command line
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.
or go inside the project and just type
Open the .zshrc file or bash file and put this alias:
alias pstorm='open -a /Applications/PhpStorm.app "`pwd`"'
alias pstrom="open -a 'phpstorm.app'"
source the bash file
and then use
pstorm like solution 1
Navigate to the inside of the desired directory and do
It will open the whole current directory
Type in terminal this:
open -a 'phpstorm.app' file-or-folder
See more here: