rizsotto/Bear

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

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 42 minutes ago
Added to GitGenius on September 10th, 2026
Created on October 30th, 2012
Open Issues & Pull Requests: 0 (+0)
GitHub issues: Enabled
Number of forks: 369
Total Stargazers: 6,477 (+0)
Total Subscribers: 56 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 10.1 hours
Mean response time: 17.4 days
90th percentile: 4.5 days
Tracked items: 493

How this project is maintained

Around half of the issues opened in the past year never receive a reply. Work labelled "question" is answered fastest, typically in about 8 hours, while "tracking" waits about 5 days. Only 3% of issues opened in the past year have been closed. Three people close 83% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 0
New in 7 days: 0
Closed in 7 days: 0
Avg open age: N/A days
Stale 30+ days: 0
Stale 90+ days: 0

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • bug (164)
  • area:interception (150)
  • invalid (133)
  • area:build (112)
  • area:semantic (92)
  • enhancement (89)
  • wontfix (77)
  • question (51)

Detailed Description

Bear is a build tool that generates compile_commands.json for any C or C++ project, enabling code navigation and diagnostics with Clang tooling regardless of build system.

Bear solves the problem of integrating C and C++ projects with Clang-based tools like clangd and clang-tidy when the build system cannot produce a compilation database natively. It works by intercepting compiler invocations as the build runs, capturing the exact flags and arguments used, then writing this information to a compile_commands.json file. The tool can also parse build system dry-run output or saved build logs when the build cannot be executed directly, reconstructing the compilation database from that text.

Bear is the right choice for projects using Make, autotools, or custom build scripts—the majority of C codebases—as well as for third-party projects you cannot modify, unusual toolchains like embedded systems or HPC compilers, and situations where you only have access to build logs. It handles compiler wrappers like ccache and distcc, cross-compilers, and CUDA builds. If your project uses CMake, Meson, or Bazel, those tools can export a compilation database directly, which should be preferred when available. The tool requires no changes to your build system; you simply prefix your build command with bear --.

Bear runs on Linux, macOS, and multiple BSD variants as well as Windows, though each platform and build system imposes constraints on which interception methods are available. The project maintains documentation covering platform-specific usage, known limitations, and workarounds. Development is sustained by regular sponsorship and community contributions, with the maintainers actively addressing problem reports and usage questions through issues and chat channels.