You can run commands and analyze their output right in PhpStorm using the dedicated 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 dialog box. If necessary, you can export the output.
In this part:
- Executing a command in the command line
- Terminating a running command
- Exporting the output
- Launching a command line tool automatically after checking in changes
- To access the Input pane, choose on the main menu or press Ctrl+Shift+X (Cmd-Shift-X on OS X).
In the Input pane, type the call of the command in the format:
<tool alias> <command>
- Besides tool-specific commands, you can also run simple, operating system-wide, commands, such as, ls, etc.
- Most command line tools operate within the context of their own projects. A tool project is not the same as a PhpStorm project. Therefore, when using a tool from PhpStorm for the first time, you need to create its own "initial" tool project besides you current PhpStorm project. To do so, run the project generation command specific for the current tool in the Command Line Tool Input pane. The "initial project" is located in the PhpStorm project root.
- View the result of command execution in the output tab named after the last invoked command.
- During the command execution, click the Stop toolbar button .
- Kill the current thread from the progress bar, if the output tab is already closed.
- Click the Export to Text toolbar button or press Alt+OAlt+OAlt+OAlt+OAlt+OAlt+OAlt+OAlt+OControl OControl OControl O.
In the Export Preview dialog box that opens, do one of the following:
- To have the output saved in a text file, specify the target text file in the Export to file text box and click the Save button. 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 the Copy button.
- Open the PhpStorm settings and configure the required command line tool as an external tool on the External Tools page.
- Start checking in your changes.
- In the After Commit area, specify the tool to launch in the Run tool drop-down list. Choose one of the available tools or define a new one: click the Browse button and configure the required command line tool as an external tool in the External Tools dialog box that opens.