macOS
brew install bearlocal Homebrew formula metadata
sudo port install BearMacPorts ports tree · devel/Bear/Portfile · 来源: api.github.com
安装
brew install bearlocal Homebrew formula metadata
sudo port install BearMacPorts ports tree · devel/Bear/Portfile · 来源: api.github.com
sudo apk add bearAlpine Linux edge package indexes · bear · 来源: dl-cdn.alpinelinux.org
sudo dnf install bearFedora Rawhide package metadata · bear · 来源: dl.fedoraproject.org
nix profile install nixpkgs#bearnixpkgs package indexes · pkgs/by-name/be/bear/package.nix · 来源: api.github.com
sudo pacman -S bearArch Linux sync databases · bear · 来源: geo.mirror.pkgbuild.com
sudo zypper install BearopenSUSE Tumbleweed package metadata · Bear · 来源: download.opensuse.org
winget install --id the-sz.Bear -eWindows Package Manager source index · the-sz.Bear · 来源: cdn.winget.microsoft.com
概览
Generate compilation database for clang tooling
历史
Bear generates compile_commands.json compilation databases for Clang tooling by capturing compiler invocations during a build.
The official repository describes Bear as a tool for producing the JSON compilation database used by Clang-based tools to understand compiler flags, include paths, and other translation-unit settings.
Bear exists for build systems that cannot emit a compilation database directly. Its README now advises users to prefer native compilation-database export from CMake, Meson, or Bazel when available, and to use Bear as the compatibility bridge for other builds.
The install documentation notes that Bear has been around for a while, is packaged by many distributions, and is now implemented in Rust, with a preload library still involved in compiler-call interception.
Bear's adoption followed the spread of clang tooling, clangd, clang-tidy, and editor integrations that expect compile_commands.json. The supplied package metadata shows broad packaging across Homebrew, Debian, Ubuntu, Fedora, Alpine, Arch, MacPorts, Nix, Winget, and openSUSE.
The README warns that some package managers still ship the 2.4.x command-line behavior, which is a useful package-history detail: Bear is widely packaged, but users can encounter different major-version interfaces depending on distribution lag.
Modern Bear usage is `bear -- <build-command>`. It writes compile_commands.json to the current working directory after observing the build.
The README calls out platform-specific limitations around interception, including macOS System Integrity Protection and sandboxed builds such as Nix and Flatpak; users are directed to the wiki for workarounds.
Bear is important because compile_commands.json became the lingua franca for C and C++ tooling. Installing Bear can make old Makefile or custom builds visible to clangd and static-analysis tools without rewriting the build system.
For package nerds it is also a reminder that developer tools can be infrastructure glue: a small CLI whose whole job is to translate messy local build behavior into a stable JSON artifact other tools understand.
安全态势
broad file, network, media, or database tool signal.
blue 风险 · 中 置信度 · tool
在无人值守的代理使用前,请检查该工具是否读取明文凭据、写入远程状态、发布制品或调用插件。
可执行文件
| 命令 | 类型 | 暴露范围 | 备注 |
|---|---|---|---|
bear | cli | 全局可执行文件 | |
bear-driver | cli | 全局可执行文件 | |
bear-wrapper | cli | 全局可执行文件 |
新鲜度
这些信号区分页生成时间、软件包管理器活动和上游发布比较。只有存在证据 URL 和可比较版本时,才会提示版本落后。
https://github.com/rizsotto/Bear
安装元数据
| 软件包键 | brew:bear |
|---|---|
| 版本 | 4.1.5 |
| 软件包管理器 | Homebrew |
| 软件包管理器页面 | https://formulae.brew.sh/formula/bear |
| 主页 | https://github.com/rizsotto/Bear |
| 仓库 | https://github.com/rizsotto/Bear |
| 上游文档 | https://github.com/rizsotto/Bear#readme |
| 许可证 | GPL-3.0-or-later |
| 源码归档 | https://github.com/rizsotto/Bear/archive/refs/tags/4.1.5.tar.gz |
| 最后更新 | 2026-07-03T17:56:33Z |
| Pulse | updated |
| 构建依赖 | pkgconf, rust |
| Bottle | 可用 (于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux) |
| Homebrew post-install | 未定义 |
| 服务 | 未声明 |
注册表事实
| Source Database | Homebrew formula API |
|---|---|
| Tap | homebrew/core |
| Full Name | bear |
| Version Scheme | 0 |
| Revision | 0 |
| Head Version | HEAD |
| Bottle Stable Root URL | https://ghcr.io/v2/homebrew/core |
| Deprecated | no |
| Disabled | no |
| Keg Only | no |
| URL Keys |
|
源数据库匹配
匹配项来自外部软件包管理器索引,并与本地 Automic Vault 软件包链接分开显示。
bear 3.1.6-1
generate compilation database for Clang tooling
https://github.com/rizsotto/Bear
sudo apt install bearlibear 3.1.6-1
generate compilation database for Clang tooling (wrapper library)
https://github.com/rizsotto/Bear
sudo apt install libearbear
nix profile install nixpkgs#bearbear 3.1.3-1build4
generate compilation database for Clang tooling
https://github.com/rizsotto/Bear
sudo apt install bearlibear 3.1.3-1build4
generate compilation database for Clang tooling (wrapper library)
https://github.com/rizsotto/Bear
sudo apt install libearbear 4.1.4-r0
Tool that generates a compilation database for clang tooling
https://github.com/rizsotto/Bear
sudo apk add bearbear-doc 4.1.4-r0
Tool that generates a compilation database for clang tooling (documentation)
https://github.com/rizsotto/Bear
sudo apk add bear-docbear 4.1.4-1.fc45
Tool that generates a compilation database for clang tooling
https://github.com/rizsotto/bear
sudo dnf install bearbear 4.1.4-1
A tool to generate compilation database for clang tooling
https://github.com/rizsotto/Bear
sudo pacman -S bearBear 3.1.6-1.20
Tool to generate compilation database for clang tooling
https://github.com/rizsotto/Bear
sudo zypper install BearBear
sudo port install Bearthe-sz.Bear
winget install --id the-sz.Bear -e来源线索
此页面由 av-web 从 scripts/generate-pkg-sqlite.py 生成的私有软件包 SQLite 工件提供。
View the package source record on GitHub.