OS Manuals

/usr/bin/buck2

Build system, successor to Buck

From buck2 20260601-r1 (os), captured 2026-11-05 by running buck2 --help (exit 0). permalink

Also provided by 1 other package version
A build system

Documentation: https://buck2.build/docs/


Usage: buck2 [OPTIONS] <COMMAND>

Commands:
  audit                 Perform lower level queries
  aquery                Perform queries on the action graph (experimental)
  build                 Build the specified targets
  bxl                   Run BXL scripts
  help-env              Print help for environment variables used by buck2
  test                  Build and test the specified targets
  cquery                Perform queries on the configured target graph
  init                  Initialize a buck2 project
  explain               Generates web browser view that shows actions that ran in the last build mapped to the target graph
  expand-external-cell  Expand the contents of an external cell into the repo
  install               Build and install an application
  kill                  Kill the buck daemon
  killall               Kill all buck2 processes on the machine
  root                  Find buck cell, project or package root
  query                 Alias for `uquery`
  run                   Build and run the selected target
  server                Start, query, and control the http server
  status                Buckd status
  starlark              Run Starlark operations
  targets               Alias for `utargets`
  utargets              Show details about the specified targets
  ctargets              Resolve target patterns to configured targets
  uquery                Perform queries on the unconfigured target graph
  completion            Print completion configuration for shell
  docs                  Print documentation of specified symbols
  profile               Run starlark profiler
  clean                 Delete generated files and caches
  log                   Commands for interacting with buck2 logs
  lsp                   Start an LSP server for starlark files
  subscribe             Subscribe to updates from the Buck2 daemon
  help                  Print this message or the help of the given subcommand(s)

Options:
  -h, --help
          Print help (see a summary with '-h')

  -V, --version
          Print version

Universal Options:
      --isolation-dir <ISOLATION_DIR>
          The name of the directory that Buck2 creates within buck-out for writing outputs and daemon information. If one is not provided, Buck2 creates a directory with the default name.

          Instances of Buck2 share a daemon if and only if their isolation directory is identical. The isolation directory also influences the output paths provided by Buck2, and as a result using a non-default isolation dir will cause cache misses (and slower builds).

          [env: BUCK_ISOLATION_DIR=]
          [default: v2]

  -v, --verbose <VERBOSITY>
          How verbose buck should be while logging.

          Values: 0 = Quiet, errors only; 1 = Show status. Default; 2 = more info about errors; 3 = more info about everything; 4 = more info about everything + stderr;

          It can be combined with specific log items (stderr, full_failed_command, commands, actions, status, stats, success) to fine-tune the verbosity of the log. Example usage "-v=1,stderr"

          [env: BUCK_VERBOSE=]
          [default: 1]

      --oncall <ONCALL>
          The oncall executing this command

      --client-metadata <CLIENT_METADATA>
          Metadata key-value pairs to inject into Buck2's logging. Client metadata must be of the form `key=value`, where `key` is a snake_case identifier, and will be sent to backend datasets

      --agent-context <AGENT_CONTEXT>
          Agent context key=value pairs for telemetry. Used by AI agents to pass structured metadata. Schema is defined via buckconfig. Entries can be comma-separated or passed as separate flags. Examples: --agent-context intent=fix,attempt=2,prior_error=missing_target --agent-context intent=build --agent-context attempt=1
Options (7)
OptionDescriptionSource
-h, --helpPrint help (see a summary with '-h')help
-V, --versionPrint versionhelp
--isolation-dir ISOLATION_DIRThe name of the directory that Buck2 creates within buck-out for writing outputs and daemon information.help
-v, --verbose VERBOSITYHow verbose buck should be while logging.help
--oncall ONCALLThe oncall executing this commandhelp
--client-metadata CLIENT_METADATAMetadata key-value pairs to inject into Buck2's logging.help
--agent-context AGENT_CONTEXTAgent context key=value pairs for telemetry.help

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