'Use script "code ." in terminal to open PhpStorm

I want to type the script "code ." in terminal in order to open my code editor, PhpStorm. How can I do that?



Solution 1:[1]

The code command is used to open VS Code specifically. PhpStorm doesn't come with a command-line interface, but you can create one by following this tutorial (you will need the Toolbox app in order to generate a shell script if an alias isn't enough for you): https://www.jetbrains.com/help/phpstorm/working-with-the-ide-features-from-command-line.html

Solution 2:[2]

type code NameOftheProject and it will be open, make sure you are in the correct directory
forex c:\composer\NameOftheProject> code NameOftheProject.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ElectricShadow
Solution 2 soufiane