# clang-format CLI Usage [← Back to Index](index.md) | [Quick Reference](quick-reference.md) | [Full CLI Reference](complete/clang-format-cli.md) Command-line usage, tools, and integrations for clang-format. **Documentation Version:** Updated for Clang v22.0.0 ## Command-Line Options ### Basic Usage ```bash # Format from stdin, output to stdout cat file.cpp | clang-format # Format file(s) and output to stdout clang-format file.cpp # Format file(s) in-place clang-format -i file.cpp file.h # Format multiple files clang-format -i src/*.cpp include/*.h ``` ### Common Flags #### `-i` - In-Place Editing Modify files directly instead of outputting to stdout: ```bash clang-format -i file.cpp ``` #### `--style=