Open PhpStorm from Terminal/Command line

Open a file/project in PhpStorm using the command line

2 min readJan 11, 2021

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


pstrom projectname

or go inside the project and just type


Solution 2:

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

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


alias pstrom="open -a ''"

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 '' file-or-folder

See more here: