OS Manuals

/usr/bin/buildozer

Command-line tool to manipulate Bazel BUILD files

From buildtools-buildozer 10.2.0-r0 (enterprise-packages), captured 2026-11-08 by running buildozer --help (exit 0). permalink

Usage of /usr/bin/buildozer:
  -P int
    	number of cores to use for concurrent actions
  -add_tables string
    	path to JSON file with custom table definitions which will be merged with the built-in tables
  -buildifier string
    	format output using a specific buildifier binary. If empty, use built-in formatter
  -delete_with_comments
    	If a list attribute should be deleted even if there is a comment attached to it (default true)
  -disable_symlink_safety
    	per default Buildozer will not write to symlinks pointing outside of the Bazel workspace. Setting this to true will disable this behavior
  -edit-variables
    	For attributes that simply assign a variable (e.g. hdrs = LIB_HDRS), edit the build variable instead of appending to the attribute.
  -eol-comments
    	when adding a new comment, put it on the same line if possible (default true)
  -f value
    	file name(s) to read commands from, use '-' for stdin (format:|-separated command line arguments to buildozer, excluding flags)
  -k	apply all commands, even if there are failures
  -numio int
    	number of concurrent actions (default 200)
  -output_json
    	output serialized devtools.buildozer.Output json instead of human-readable strings.
  -output_proto
    	output serialized devtools.buildozer.Output protos instead of human-readable strings.
  -quiet
    	suppress informational messages
  -respect_bazelignore
    	use .bazelignore file for ignoring paths (default true)
  -root_dir string
    	If present, use this folder rather than $PWD to find the root directory.
  -shorten_labels
    	convert added labels to short form, e.g. //foo:bar => :bar (default true)
  -stdout
    	write changed BUILD file to stdout
  -tables string
    	path to JSON file with custom table definitions which will replace the built-in tables
  -types string
    	comma-separated list of rule types to change, the default empty list means all rules
  -version
    	Print the version of buildozer
Options (20)
OptionDescriptionSource
-P intnumber of cores to use for concurrent actionshelp
-add_tables stringpath to JSON file with custom table definitions which will be merged with the built-in tableshelp
-buildifier stringformat output using a specific buildifier binary.help
-delete_with_commentsIf a list attribute should be deleted even if there is a comment attached to it (default true)help
-disable_symlink_safetyper default Buildozer will not write to symlinks pointing outside of the Bazel workspace.help
-edit-variablesFor attributes that simply assign a variable (e.g. hdrs = LIB_HDRS), edit the build variable instead of appending to the attribute.help
-eol-commentswhen adding a new comment, put it on the same line if possible (default true)help
-f valuefile name(s) to read commands from, use '-' for stdin (format:|-separated command line arguments to buildozer, excluding flags)help
-kapply all commands, even if there are failureshelp
-numio intnumber of concurrent actions (default 200)help
-output_jsonoutput serialized devtools.buildozer.Output json instead of human-readable strings.help
-output_protooutput serialized devtools.buildozer.Output protos instead of human-readable strings.help
-quietsuppress informational messageshelp
-respect_bazelignoreuse .bazelignore file for ignoring paths (default true)help
-root_dir stringIf present, use this folder rather than $PWD to find the root directory.help
-shorten_labelsconvert added labels to short form, e.g. //foo:bar => :bar (default true)help
-stdoutwrite changed BUILD file to stdouthelp
-tables stringpath to JSON file with custom table definitions which will replace the built-in tableshelp
-types stringcomma-separated list of rule types to change, the default empty list means all ruleshelp
-versionPrint the version of buildozerhelp

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.