kleaf: Add doc for compile_commands.json

Add instructions for building compile_commands.json to the
root of the repository.

Test: none
Bug: 201801372
Change-Id: I9883094549ccb97ffab6a1a07574d221895b2224
diff --git a/kleaf/docs/compile_commands.md b/kleaf/docs/compile_commands.md
new file mode 100644
index 0000000..a9ed3ae
--- /dev/null
+++ b/kleaf/docs/compile_commands.md
@@ -0,0 +1,19 @@
+# Build `compile_commands.json`
+
+## GKI
+
+Run the following to place `compile_commands.json` at the root of your
+repository:
+
+```shell
+$ tools/bazel run //common:kernel_aarch64_compile_commands
+```
+
+## Device kernel
+
+If you want to build `compile_commands.json` for in-tree modules, create a
+`kernel_compile_commands` target with `kernel_build` set accordingly,
+then `tools/bazel run` the target.
+
+See `kernel_compile_commands` in
+[documentation for all rules](api_reference.md) for details.