PhpStorm 2017.2 Help

Running Tool Commands

You can run commands, analyze and export their output right in PhpStorm using the Command Line Tools Console tool window. The character set to be used in the tool window is chosen from the Console encoding drop-down list on the Command Line Tool Support page of the Settings/Preferences dialog box.

Before you start, make sure the Command Line Tool Support plugin is enabled on the Plugins page of the Settings / Preferences Dialog.

On this page:

Running a command

  1. On the main menu, choose Tools | Run Command. The pane opens as as a pop-up window or as a text box at the bottom of the Command Line Tools Console tool window.
  2. In the Input pane, type the call of the command in the format <tool alias> <command>.

    If you are using a tool from PhpStorm for the first time, create an initial tool project by running the tool-specific project generation command. The initial project is stored in the PhpStorm project root.

  3. View the result of command execution in the output tab named after the last invoked command.
  4. To terminate a command, click stop on the toolbar. If the Output tab is already closed, kill the current thread from the progress bar.

Exporting the output

  1. Click exportToTextFile on the toolbar or press Alt+O.
  2. In the Export Preview dialog that opens, do one of the following:
    • To save the output in a text file, specify the target text file in the Export to file text box and click Save. If the file with this name and location already exists, choose to overwrite its contents with the new data or to append the new data to the existing file.
    • To copy the output to the clipboard, click Copy.

Running a command line tool automatically after committing changes

  1. Open the External Tools page (File | Settings | Tools | Command Line Tool Support for Windows and Linux or PhpStorm | Preferences | Tools | Command Line Tool Support for macOS).
  2. Configure the command line tool as an external tool.
  3. Start committing your changes.
  4. In the After Commit area of the Commit Changes Dialog, choose your tool from the Run tool list.
Last modified: 28 November 2017

See Also