Command Line Tools in PhpStorm
PhpStorm has had support for command line tools for a while. Using the command line tools, we can invoke commands right from our IDE! We can bring up the command line tool using the Tools | Run Command… menu or with Ctrl+Shift+X (Cmd+Shift+X on Mac).
The command line tools come with support for autocompletion of several known tools. Nothing comes for free: we have to add the tools we want to use through the IDE Settings | Command Line Tool Support pane. After adding Composer, for example, we get autocompletion on all composer commands:
From PhpStorm’s settings, the IDE Settings | Command Line Tool Support pane allows us to add support for other framework specific tools as well. For example, when working with a Symfony project, we can enable support for the symfony tool by adding it and specifying the path to where this tool resides:
The command line tools console will have autocompletion support for the Symfony tool, aliased as s.
Custom command line tools can be added through the IDE Settings | Command Line Tool Support pane as well. The only difference is we now have to specify the alias for the tool we wish to use as well as the path to this tool.
Of course, PhpStorm can not determine autocompletion for every custom tool we add automatically. Fortunately, we can create our own definition. From the settings dialog, click the Open definition in browser button to generate a boilerplate command line tool description.
We can now define commands, parameters and help information for our custom command line tool. Find a more detailed tutorial on our developer community website. After saving the XML file containing the description, PhpStorm will recognize the command and provide us with autocompletion for our custom command line tool.
A Gist for the above screenshot can be found here.
Develop with pleasure!
– JetBrains PhpStorm Team
Subscribe to Blog updates
Thanks, we've got you!
Qodana Clone Finder: Early Access Program
In December 2020, we announced the EAP for Qodana, which is rapidly evolving into a comprehensive platform that allows companies to perform multi-level evaluations of the quality of code they own, contract, or purchase. Qodana helps you detect bugs without relying on an IDE, either on a local machi…
PhpStorm 2020.2 EAP #3
The Early Access Program for PhpStorm 2020.2 is in full swing and today we’ve got the third build of the 2020.2 EAP for you. In this blog post, you can read about improvements for Git installed in WSL2 and Search Everywhere. Download PhpStorm 2020.2 EAP (more…)…
PhpStorm 2019.3.3 Preview
We’ve just rolled out a preview for the third minor update for PhpStorm 2019.3. Please give the PhpStorm 2019.3.3 Preview build 193.6494.5 a try and share your feedback with us. (more…)…
How to Upgrade to PHP 7.4 with PhpStorm
Check out our fresh video with a few nice tips and tricks on how to update your codebase to PHP 7.4. It combines materials from the PhpStorm 2019.2 and PhpStorm 2019.3 releases, with a few cool bonuses to boot. Nikita drew our attention to the fact that setters are slower than assigning prop…