# rizsotto/Bear

Generate compile_commands.json for any C or C++ build

Repository: https://github.com/rizsotto/Bear
Canonical: https://ross.abutalabs.com/products/bear
Language: Rust
License: GPL-3.0
License Family: copyleft
Topics: compilation-database, clang, build-tool, build-systems, compile-commands-json
Last push: 2026-08-20T12:10:51+00:00

## Health v2 (maintenance only)
Score: 98/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 98, release rhythm 98, longevity 100
- inputs: {"age_days": 5055, "days_push": 13, "days_rel": 17, "gap_med": 21.5, "n_releases_24m": 15}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 6452, forks 369 (observed 2026-08-28T04:09:43.505938+00:00)

## What it is
Bear is a command-line tool that generates a JSON compilation database (compile_commands.) for C and C++ projects by intercepting compiler invocations during a build. It works with any build system, including ones that cannot export the database themselves, and can also parse dry-run output or build logs.

## Use cases
- generate compile_commands. for a make or autotools project
- get clangd autocomplete and diagnostics working on a C++ codebase
- create a compilation database without modifying the build system
- capture compiler flags for embedded or cross-compiled toolchains
- build a compilation database from a CI build log or make -n dry-run output
- index a third-party C project I am just exploring

## When to choose
- your build system (Make, autotools, custom scripts) cannot emit compile_commands.
- you cannot or do not want to modify the build
- you use unusual toolchains like cross-compilers, ccache, distcc, CUDA, or MPI wrappers
- you only have a build log or dry-run output instead of a runnable build

## When to avoid
- your project uses CMake, Meson, or Bazel, which can export the database natively
- you are not working with C or C++ code
- you need a GUI or IDE-integrated indexing solution rather than a CLI tool

## Facets
- artifact type: cli-tool
- maturity: active
- function: developer-tools, build-tool, compiler, parser
- domain: developer-tools, compilers
- platform: cli, cross-platform
- tags: compilation-database, compile-commands-, clang, clangd, c-cpp, build-interception, command-line, linux, macos

## Member repositories
- rizsotto/Bear (main) score 98

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:43.505938+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:44:39.406709+00:00, confidence not recorded.
  - readme: https://github.com/rizsotto/Bear (fetched 2026-08-28T04:09:43.505938+00:00, sha 88cb262e3350)
- Data as of 2026-08-30T08:39:29.467469+00:00.
