a13n
AI 에이전트를 만들고 클라우드에서 실행합니다
C·C++ 빌드에 필요한 compile_commands.json 파일을 생성합니다
Generate compile_commands.json for any C or C++ build
개발 도구Rust · ShellGitHub @rizsotto직접 설치운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
메이커가 쓴 소개는 위의 한 줄이 전부입니다. 더 자세한 내용은 저장소 README에서 읽을 수 있습니다. 저장소 README ↗
README 전체를 불러오는 중입니다.
README 전문 보기 ↗Bear gives you working code navigation, autocomplete, and diagnostics on
any C/C++ project, whatever the build system. Prefix your build command
with bear -- and it produces the compile_commands.json file that
Clang tooling (clangd, clang-tidy, and friends) needs to understand your
code.
The JSON compilation database describes how each translation unit is compiled. Bear captures the compiler invocations while your build runs and writes the database for you - no changes to your build system required.
Bear is the tool of choice when the build system cannot produce a compilation database for you:
make -n dry-run output or a
saved build log instead.Bear can intercept the build as it runs, recording what the compiler was actually invoked with, including flags injected by wrappers and entries for generated sources. Bear can also interpret the commands a build system plans to run, formatting those into a compilation database as if they had executed.
If your project uses CMake, Meson, or Bazel, those tools can export a compilation database directly; use that when it is available.
Bear is packaged for many distributions. Check your distribution's package manager first. Alternatively, you can build it from source.
After installation, run:
bear -- <your-build-command>
Bear writes compile_commands.json to the current working directory. Pass
Bear's own options before --; everything after that is treated as part of
the build command.
If you cannot run the build - all you have is a CI log or the build system's dry-run output - Bear can reconstruct the database from that text instead:
make -n | bear parse-sh
For more, run bear --help or read the man page. The
documentation site covers limitations, known issues, and
platform- and toolchain-specific usage.
Bear works on Linux, Android, macOS, FreeBSD, OpenBSD, NetBSD, DragonFly BSD, and Windows.
Each operating system and build system imposes constraints on how Bear can run and which interception method is available, and those affect the final output. The documentation site describes the available options and each option's limitations.
Bear is kept going by people who chip in. Thank you.
Before opening a new problem report, please check the documentation to see if your problem is a known issue with a documented workaround. It's also helpful to look at older (possibly closed) issues before opening a new one.
If you decide to report a problem, please provide as much context as possible to help reproduce the error. If you just have a question about usage, please don't be shy; ask your question in an issue or in our chat.
If you've found a bug and have a fix for it, please share it by opening a pull request.
Please follow the contribution guide when you do.