Format files from the command line
Last modified: 27 October 2021
You can find the executable for running CLion in the installation directory under bin. To use this executable as the command-line launcher, add it to your system PATH
as described in Command-line interface.
- Syntax
clion64.exe format [<options>] <path ...>
- Examples
Format two specific files from the C:
\Data directory using the default code style settings:\src >clion64.exe format C:\Data\src\hello.cpp C:\Data\src\world.cpp
Recursively format all files in the C:
\Data directory including all subdirectories using the default code style settings:\src >clion64.exe format -r C:\Data\src
Non-recursively format all the .cpp and .h files in the C:
\Data directory using code style settings from C:\src \Data :\settings.xml >clion64.exe format -s C:\Data\settings.xml -m *.cpp,*.h C:\Data\src