IntelliJ IDEA 2019.3 Help

Open files from the command line

Open an arbitrary file or folder in IntelliJ IDEA from the command line, optionally specifying where to put the caret after opening.

Syntax
idea.bat [--line <number>] [--column <number>] <path ...>
Examples

Open a project:

idea.bat C:\MyProject

Open a specific file on line number 42 column 7:

idea.bat --line 42 --column 7 C:\MyProject\scripts\numbers.js
Syntax
idea --line <number> <path>
Examples

Open a project:

idea ~/MyProject

Open a specific file on line number 42 column 7:

idea --line 42 --column 7 ~/MyProject/scripts/numbers.js
Syntax
idea.sh --line <number> <path>
Examples

Open a project:

idea.sh ~/MyProject

Open a specific file on line number 42 column 7:

idea.sh --line 42 --column 7 ~/MyProject/scripts/numbers.js

When you specify the path to a file or directory in an existing project, IntelliJ IDEA opens this project. If the file does not belong to a project, IntelliJ IDEA creates a temporary project for it. If you open a directory that is not a part of a project, IntelliJ IDEA adds the .idea directory to it, making it a project.

Last modified: 19 February 2020