WebStorm 2018.1 Help

Opening Files from Command Line

You can open an arbitrary file, folder, or project for editing in WebStorm from the command line, optionally specifying where the caret should rest after opening the file.

  • In the command line, run the following command:
    <WebStorm> [--line <number>] path

    Alternatively, you can use the following syntax:

    <WebStorm> path:<number>

The command options are as follows:

Option Description
<WebStorm>

The platform-specific WebStorm launcher.

On macOS and Linux, it is recommended to use the command-line launcher created during the WebStorm installation, or create one manually by selecting Tools | Create Command-line Launcher on the WebStorm main menu. Refer to Besides working from within WebStorm, you can perform the following actions from the command line: for details.

On Windows, it is recommended to add the path to the WebStorm executable to the Path environment variable.

path

The path to the file or the folder to be opened.

  • If the file or folder belongs to an existing project, this project will be opened.
  • If the file does not belong to any project, a temporary project for this file will be created automatically.
  • If the folder does not belong to any project, a new project will be created inside this folder.
--line <number> (optional) The line number, on which the caret should rest after opening the file.

Examples

Syntax
webstorm.exe --line <number> path
Alternative syntax
webstorm.exe path:<number>
Examples
webstorm.exe --line 3 C:\MyProject\scripts\numbers.js webstorm.exe C:\MyProject\scripts\numbers.js:3
Syntax
webstorm --line <number> path
Alternative syntax
webstorm path:<number>
Example
webstorm --line 3 ~/MyProject/scripts/numbers.js webstorm ~/MyProject/scripts/numbers.js:3
Last modified: 20 July 2018