# 使用 Homebrew, Nix 安装 buildozer

查看 buildozer 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:buildozer
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install buildozer
```

  证据: local Homebrew formula metadata

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#buildozer
```

  证据: nixpkgs package indexes: buildozer from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix

## 软件包事实

- **软件包键:** brew:buildozer
- **软件包管理器:** Homebrew
- **版本:** 8.5.1
- **来源摘要:** Rewrite bazel BUILD files using standard commands
- **主页:** <https://github.com/bazelbuild/buildtools>
- **仓库:** <https://github.com/bazelbuild/buildtools>
- **最后更新:** 2026-07-25T14:19:45-04:00
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- buildozer (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 8.5.1
## 项目历史与用法

Buildozer is the command-line rewrite tool from Bazel's `buildtools` repository. It applies scripted edits to Bazel BUILD-like files, complementing Buildifier's formatting role with bulk, machine-checkable structural changes.

### 项目历史

The `bazelbuild/buildtools` repository was created on 2016-06-09 as a home for developer tools around Bazel BUILD files. Its top-level README groups Buildifier, Buildozer, and unused_deps together: formatter, editor, and Java dependency cleanup tool.

Buildozer's README defines it as a command-line tool for rewriting multiple Bazel BUILD files with standard commands. Its command language grew around labels, rule kinds, loads, attributes, comments, and later MODULE.bazel operations, reflecting the needs of large Bazel codebases where hand-editing BUILD files is slow and error-prone.

### 采用历史

Buildozer's adoption is tied to Bazel adoption. Teams with large monorepos use it for mechanical BUILD-file migrations: adding dependencies, changing rule kinds, rewriting loads, deleting attributes, or applying edits across entire package trees.

Its availability through Homebrew and Nix makes it easy to install outside a Bazel source checkout, while Go module installation gives Bazel users a direct upstream-supported path.

### 使用方式

Typical usage is `buildozer 'command args' //pkg:target`, often repeated across many labels or fed from a command file. Buildozer can print modified files, format through Buildifier, run multiple commands in order, and process files in parallel.

The tool is most useful when a repository-wide BUILD migration should be expressed as a small, repeatable command instead of a one-off script that parses Starlark poorly.

### 为什么软件包爱好者会关心

Buildozer is a package nerd tool because it encodes Bazel's BUILD-file editing semantics into a small CLI. It is the kind of utility that package managers carry so build-system maintainers can do tedious monorepo migrations without checking out a larger toolchain.

Its relationship with Buildifier is the key: one tool changes the syntax tree, the other normalizes the result. That pair became part of the everyday hygiene toolkit for serious Bazel repositories.

### 时间线

- 2016: `bazelbuild/buildtools` repository is created.
- 2016: Buildozer is distributed as one of the core tools in the Buildtools repository.
- 2020s: Buildozer gains support for modern Bazel file shapes such as MODULE.bazel operations.
- 2026: The Buildtools repository remains active as Bazel's formatter/editor tool collection.

### Related projects

- Buildozer is closely related to Bazel, Buildifier, unused_deps, Starlark BUILD files, MODULE.bazel, and monorepo migration tooling.

### 来源

- <https://api.github.com/repos/bazelbuild/buildtools>
- <https://github.com/bazelbuild/buildtools>
- <https://github.com/bazelbuild/buildtools/blob/master/buildozer/README.md>


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals

## 其他软件包管理器记录

- Nix - buildozer: normalized package name match | nixpkgs package indexes: buildozer from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix


## Combined YAML source

View the package source record on GitHub. [combined/buildozer.yml](https://github.com/mxcl/pkgdb/blob/main/combined/buildozer.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
