Open files from the command line
Open an arbitrary file or folder in PyCharm from the command line, optionally specifying where to put the caret after opening.
- Syntax
- pycharm.bat [--line <number>] <path ...>
- Examples
-
Open a project:
pycharm.bat C:\MyProjectOpen a specific file on line number 42:
pycharm.bat --line 42 C:\MyProject\scripts\numbers.js
- Syntax
- pycharm --line <number> <path>
- Examples
-
Open a project:
pycharm ~/MyProjectOpen a specific file on line number 42:
pycharm --line 42 ~/MyProject/scripts/numbers.js
- Syntax
- pycharm.sh --line <number> <path>
- Examples
-
Open a project:
pycharm.sh ~/MyProjectOpen a specific file on line number 42:
pycharm.sh --line 42 ~/MyProject/scripts/numbers.js
When you specify the path to a file or directory in an existing project, PyCharm opens this project. If the file does not belong to a project, PyCharm creates a temporary project for it. If you open a directory that is not a part of a project, PyCharm adds the .idea directory to it, making it a project.
Last modified: 2 April 2020