bazel-compile-commands
May 2, 2026 ยท View on GitHub
A tool that generates a compile_commands.json file from Bazel build
configurations, enabling IDE support for C/C++ projects built with Bazel.
Installation
pipx install git+https://github.com/robinlinden/bazel-compile-commands.git@master
Usage
Navigate to your Bazel workspace root and run:
bccommand
The script will:
- Query your Bazel workspace for C/C++ compilation actions.
- Extract and normalize compilation commands.
- Generate a
compile_commands.jsonfile in your workspace root.
Custom Arguments
You can pass additional arguments to bazel aquery, such as configuration
options:
bccommand --config=myconfig