PageSourceSearch

https://www.buildbuddy.io/assets/js/22895414.adc9355f.js

js buildbuddy.io collected 2026-10-01 09:19:43 UTC 6,610 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkbuildbuddy_docs_website=self.webpackChunkbuildbuddy_docs_website||[]).push([[1930],{17119(e,n,i){i.r(n),i.d(n,{assets:()=>d,contentTitle:()=>l,default:()=>b,frontMatter:()=>o,metadata:()=>c,toc:()=>t});const c=JSON.parse('{"id":"cli-config","title":"Configuring the BuildBuddy CLI","description":"You can save BuildBuddy CLI options in a .bbrc file. It uses the same section and named-config syntax as a .bazelrc,","source":"@site/../docs/cli-config.md","sourceDirName":".","slug":"/cli-config","permalink":"/docs/cli-config","draft":false,"unlisted":false,"editUrl":"https://github.com/buildbuddy-io/buildbuddy/edit/master/docs/../docs/cli-config.md","tags":[],"version":"current","lastUpdatedBy":"jim hollenbach","lastUpdatedAt":1790632550000,"frontMatter":{"id":"cli-config","title":"Configuring the BuildBuddy CLI","sidebar_label":"CLI configuration (.bbrc)"},"sidebar":"someSidebar","previous":{"title":"CLI Overview","permalink":"/docs/cli"},"next":{"title":"CLI Commands","permalink":"/docs/cli-commands"}}');var s=i(86070),r=i(35676);const o={id:"cli-config",title:"Configuring the BuildBuddy CLI",sidebar_label:"CLI configuration (.bbrc)"},l=void 0,d={},t=[{value:"File locations",id:"file-locations",level:2},{value:"Named configs",id:"named-configs",level:2},{value:"Selecting rc files",id:"selecting-rc-files",level:2}];function a(e){const n={code:"code",h2:"h2",li:"li",ol:"ol",p:"p",pre:"pre",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:["You can save BuildBuddy CLI options in a ",(0,s.jsx)(n.code,{children:".bbrc"})," file. It uses the same section and named-config syntax as a ",(0,s.jsx)(n.code,{children:".bazelrc"}),",\nbut it configures ",(0,s.jsx)(n.code,{children:"bb"})," rather than Bazel."]}),"\n",(0,s.jsxs)(n.p,{children:["For example, this ",(0,s.jsx)(n.code,{children:".bbrc"})," enables streamed logs for every ",(0,s.jsx)(n.code,{children:"bb run"}),"\nand uses Linux runners for ",(0,s.jsx)(n.code,{children:"bb remote"}),":"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",metastring:'title=".bbrc"',children:"run --stream_run_logs\nremote --os=linux\n"})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"# Runs: bb run --stream_run_logs //app\nbb run //app\n\n# Runs: bb remote --os=linux test //...\nbb remote test //...\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Only BuildBuddy CLI flags are allowed in ",(0,s.jsx)(n.code,{children:".bbrc"}),". Keep\nregular Bazel options in ",(0,s.jsx)(n.code,{children:".bazelrc"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"startup"})," section applies before any command.\nFor example, this ",(0,s.jsx)(n.code,{children:".bbrc"})," enables verbose logging for all ",(0,s.jsx)(n.code,{children:"bb"})," commands:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",metastring:'title=".bbrc"',children:"startup --verbose\n"})}),"\n",(0,s.jsx)(n.h2,{id:"file-locations",children:"File locations"}),"\n",(0,s.jsxs)(n.p,{children:["The CLI reads ",(0,s.jsx)(n.code,{children:".bbrc"})," files in this order:"]}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:".bbrc"})," in the workspace root"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:".bbrc"})," in your home directory (",(0,s.jsx)(n.code,{children:"~/.bbrc"}),")"]}),"\n",(0,s.jsxs)(n.li,{children:["Files passed using ",(0,s.jsx)(n.code,{children:"--bbrc"}),", in command-line order"]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"Later settings take precedence when an option can only have one value."}),"\n",(0,s.jsxs)(n.p,{children:["You can load another file using the same ",(0,s.jsx)(n.code,{children:"import"})," and ",(0,s.jsx)(n.code,{children:"try-import"})," directives\nsupported by ",(0,s.jsx)(n.code,{children:".bazelrc"})," files. For example, a checked-in workspace ",(0,s.jsx)(n.code,{children:".bbrc"})," can\noptionally load a workspace-local ",(0,s.jsx)(n.code,{children:"user.bbrc"}),":"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",metastring:'title=".bbrc"',children:"try-import %workspace%/user.bbrc\n"})}),"\n",(0,s.jsx)(n.h2,{id:"named-configs",children:"Named configs"}),"\n",(0,s.jsxs)(n.p,{children:["Mirroring .bazelrc syntax, add ",(0,s.jsx)(n.code,{children:":<name>"})," to a section to define a named config. Select it with\n",(0,s.jsx)(n.code,{children:"--bb_config=<name>"}),":"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",metastring:'title=".bbrc"',children:"remote:linux --os=linux\nremote:linux --arch=amd64\nremote:ci --bb_config=linux\nremote:ci --skip_auto_checkout=true\
1nremote:custom-image --container_image=docker://ubuntu:latest\n"})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"bb remote --bb_config=linux test //...\nbb remote --bb_config=ci test //...\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Multiple named configs are expanded in the order they appear. Mirroring bazelrc policy,\nnamed configs are not supported for the ",(0,s.jsx)(n.code,{children:"startup"})," section."]}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.code,{children:"--bb_config"})," is separate from Bazel's ",(0,s.jsx)(n.code,{children:"--config"}),": use ",(0,s.jsx)(n.code,{children:"--bb_config"})," for\n",(0,s.jsx)(n.code,{children:".bbrc"})," settings and ",(0,s.jsx)(n.code,{children:"--config"})," for ",(0,s.jsx)(n.code,{children:".bazelrc"})," settings."]}),"\n",(0,s.jsx)(n.h2,{id:"selecting-rc-files",children:"Selecting rc files"}),"\n",(0,s.jsxs)(n.p,{children:["Pass one or more ",(0,s.jsx)(n.code,{children:"--bbrc"})," startup options to load additional files:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"bb --bbrc=/path/to/team.bbrc remote test //...\n"})}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.code,{children:"--ignore_all_bb_rc_files"})," ignores all ",(0,s.jsx)(n.code,{children:".bbrc"})," files."]})]})}function b(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}},35676(e,n,i){i.d(n,{R:()=>o,x:()=>l});var c=i(30758);const s={},r=c.createContext(s);function o(e){const n=c.useContext(r);return c.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),c.createElement(r.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.