PHP command line tools
IntelliJ IDEA supports running commands of popular third-party or user-defined PHP tools: Symfony 1.1+, Symfony2, Zend Framework 1, Zend Framework 2 (ZFTool), Yii, Composer, Drush 5.8+, Laravel and Doctrine (Symfony console-based), WordPress Command Line Interface.
Install the PHP and Command Line Tool plugins
This functionality relies on the PHP and Command Line Tool plugins that should be installed and enabled in your IDE.
The plugins are available only in IntelliJ IDEA Ultimate.
Press Control+Alt+S to open the IDE settings and select
.Switch to the Marketplace tab and use the search field to find the PHP and Command Line Tool plugins.
Click Install and restart the IDE if prompted.
Integrate an external PHP command line tool with IntelliJ IDEA
Download and install the tool.
In the Settings dialog (Control+Alt+S), go to .
Click on the toolbar.
In the Command Line Tools dialog, choose the tool from the list, and specify its visibility level (Project or Global).
When you click OK, the tool settings dialog opens. In this dialog, set up the tool execution.
Click OK to apply changes and return to the Command Line Tool Support page. Optionally, click to edit the tool properties, or to customize the commands set. See Customize a tool for details.
Run commands
Run a command
From the main menu, choose
or press Control twice.In the Run Anything window that opens, type the call of the command in the
<default alias> <command>
format.The command execution result is displayed in the Run tool window.
Terminate a command
Click on the Run tool window toolbar.
Customize a tool
In the Settings dialog (Control+Alt+S), go to .
On the Command Line Tools Support page, select the tool in the list and click on the toolbar. The xml tool descriptor opens in the editor.
Update the definitions of the commands (see Define your own command line tool for details). As you type, the tool descriptor is checked for well-formedness on the fly.
Reload the command definitions. On the Command Line Tools Support page of the Settings dialog (Control+Alt+S), select the tool in the list and click on the toolbar.
Define your own command line tool
In the Settings dialog (Control+Alt+S), go to .
Click on the toolbar and in the Command Line Tools dialog that opens, select Custom tool from the Choose tool list, and specify the visibility level for it (Project or Global).
In the Tool Settings dialog, type the path to the tool and the tool alias.
When you click OK, IntelliJ IDEA brings you to the Command Line Tools Support page, where the new tool is added to the list.
Click OK to accept the changes and close the Settings dialog.
The tool definition xml file automatically opens in the editor, letting you define the tool commands.
A command's definition is organized as follows:
<command> <!--the command's container--> <name> <!--the command itself, mandatory, and non-empty--> </name> <help> <!--the command's help message, optional--> </help> <params> <!--the command's parameters and their default values--> </params> <optionsBefore> <!--the command's options container--> <option name="" shortcut=""> <!--the option itself, mandatory, and non-empty; you can also provide a shorthand abbreviation and the usage pattern via attributes--> <help> <!--the command's help message, optional--> </help> </option> </optionsBefore> </command>Reload the command definitions. On the Command Line Tools Support page of the Settings dialog (Control+Alt+S), select the tool in the list and click on the toolbar.
Keep a tool descriptor consistent
Every time you edit a command definition in the xml tool descriptor, IntelliJ IDEA checks it for well-formedness on the fly. Full validation is performed every time you invoke a command.
If any inconsistencies are detected, an error message in displayed in the Run tool window.
Verify the tool definition
In the Settings dialog (Control+Alt+S), go to . The tools having an inconsistent descriptor are marked with .
Select the tool in the list and click on the toolbar. The xml tool descriptor opens in the editor.
Update the definitions of the commands as required. See Define your own command line tool for details.
Custom Tools Command Definitions
The following table lists several custom command line tools provided by third-party developers.
Tool | Author |
---|---|