diff --git a/completions/bash/brew b/completions/bash/brew index 4db025a7a1..d4bdc48e4b 100644 --- a/completions/bash/brew +++ b/completions/bash/brew @@ -2897,6 +2897,29 @@ _brew_vendor_install() { esac } +_brew_verify() { + local cur="${COMP_WORDS[COMP_CWORD]}" + case "${cur}" in + -*) + __brewcomp " + --arch + --bottle-tag + --debug + --deps + --force + --help + --json + --os + --quiet + --verbose + " + return + ;; + *) ;; + esac + __brew_complete_formulae +} + _brew() { local i=1 cmd @@ -3049,6 +3072,7 @@ _brew() { uses) _brew_uses ;; vendor-gems) _brew_vendor_gems ;; vendor-install) _brew_vendor_install ;; + verify) _brew_verify ;; *) ;; esac } diff --git a/completions/fish/brew.fish b/completions/fish/brew.fish index d6ddc4fc7b..6a59be4ac5 100644 --- a/completions/fish/brew.fish +++ b/completions/fish/brew.fish @@ -1845,6 +1845,20 @@ __fish_brew_complete_arg 'vendor-install' -l quiet -d 'Make some output more qui __fish_brew_complete_arg 'vendor-install' -l verbose -d 'Make some output more verbose' +__fish_brew_complete_cmd 'verify' 'Verify the build provenance of bottles using GitHub\'s attestation tools' +__fish_brew_complete_arg 'verify' -l arch -d 'Download for the given CPU architecture.(Pass `all` to download for all architectures.)' +__fish_brew_complete_arg 'verify' -l bottle-tag -d 'Download a bottle for given tag' +__fish_brew_complete_arg 'verify' -l debug -d 'Display any debugging information' +__fish_brew_complete_arg 'verify' -l deps -d 'Also download dependencies for any listed formula' +__fish_brew_complete_arg 'verify' -l force -d 'Remove a previously cached version and re-fetch' +__fish_brew_complete_arg 'verify' -l help -d 'Show this message' +__fish_brew_complete_arg 'verify' -l json -d 'Return JSON for the attestation data for each bottle' +__fish_brew_complete_arg 'verify' -l os -d 'Download for the given operating system.(Pass `all` to download for all operating systems.)' +__fish_brew_complete_arg 'verify' -l quiet -d 'Make some output more quiet' +__fish_brew_complete_arg 'verify' -l verbose -d 'Make some output more verbose' +__fish_brew_complete_arg 'verify' -a '(__fish_brew_suggest_formulae_all)' + + ################################ ## OFFICIAL EXTERNAL COMMANDS ## diff --git a/completions/internal_commands_list.txt b/completions/internal_commands_list.txt index 4132d0cc3c..a4836ba0fe 100644 --- a/completions/internal_commands_list.txt +++ b/completions/internal_commands_list.txt @@ -118,3 +118,4 @@ upgrade uses vendor-gems vendor-install +verify diff --git a/completions/zsh/_brew b/completions/zsh/_brew index 95997969f4..b2e81f6986 100644 --- a/completions/zsh/_brew +++ b/completions/zsh/_brew @@ -237,6 +237,7 @@ __brew_internal_commands() { 'uses:Show formulae and casks that specify formula as a dependency; that is, show dependents of formula' 'vendor-gems:Install and commit Homebrew'\''s vendored gems' 'vendor-install:Install Homebrew'\''s portable Ruby' + 'verify:Verify the build provenance of bottles using GitHub'\''s attestation tools' ) _describe -t internal-commands 'internal commands' commands } @@ -2283,6 +2284,23 @@ _brew_vendor_install() { '--verbose[Make some output more verbose]' } +# brew verify +_brew_verify() { + _arguments \ + '(--bottle-tag)--arch[Download for the given CPU architecture.(Pass `all` to download for all architectures.)]' \ + '(--os --arch)--bottle-tag[Download a bottle for given tag]' \ + '--debug[Display any debugging information]' \ + '--deps[Also download dependencies for any listed formula]' \ + '--force[Remove a previously cached version and re-fetch]' \ + '--help[Show this message]' \ + '--json[Return JSON for the attestation data for each bottle]' \ + '(--bottle-tag)--os[Download for the given operating system.(Pass `all` to download for all operating systems.)]' \ + '--quiet[Make some output more quiet]' \ + '--verbose[Make some output more verbose]' \ + - formula \ + '*::formula:__brew_formulae' +} + # The main completion function _brew() { local curcontext="$curcontext" state state_descr line expl diff --git a/docs/Manpage.md b/docs/Manpage.md index ccae064d6c..6e9bb5a481 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -2969,6 +2969,39 @@ Install and commit Homebrew's vendored gems. : Do not generate a new commit upon completion. +### `verify` \[*`options`*\] *`formula`* \[...\] + +Verify the build provenance of bottles using GitHub's attestation tools. This is +done by first fetching the given bottles and then verifying their provenance. + +Note that this command depends on the GitHub CLI. Run `brew install gh`. + +`--os` + +: Download for the given operating system.(Pass `all` to download for all + operating systems.) + +`--arch` + +: Download for the given CPU architecture.(Pass `all` to download for all + architectures.) + +`--bottle-tag` + +: Download a bottle for given tag. + +`--deps` + +: Also download dependencies for any listed *`formula`*. + +`-f`, `--force` + +: Remove a previously cached version and re-fetch. + +`-j`, `--json` + +: Return JSON for the attestation data for each bottle. + ## GLOBAL CASK OPTIONS These options are applicable to the `install`, `reinstall` and `upgrade` diff --git a/manpages/brew.1 b/manpages/brew.1 index e20988d544..f833b4fcd5 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -1899,6 +1899,28 @@ Update the specified list of vendored gems to the latest version\. .TP \fB\-\-no\-commit\fP Do not generate a new commit upon completion\. +.SS "\fBverify\fP \fR[\fIoptions\fP] \fIformula\fP \fR[\.\.\.]" +Verify the build provenance of bottles using GitHub\[u2019]s attestation tools\. This is done by first fetching the given bottles and then verifying their provenance\. +.P +Note that this command depends on the GitHub CLI\. Run \fBbrew install gh\fP\&\. +.TP +\fB\-\-os\fP +Download for the given operating system\.(Pass \fBall\fP to download for all operating systems\.) +.TP +\fB\-\-arch\fP +Download for the given CPU architecture\.(Pass \fBall\fP to download for all architectures\.) +.TP +\fB\-\-bottle\-tag\fP +Download a bottle for given tag\. +.TP +\fB\-\-deps\fP +Also download dependencies for any listed \fIformula\fP\&\. +.TP +\fB\-f\fP, \fB\-\-force\fP +Remove a previously cached version and re\-fetch\. +.TP +\fB\-j\fP, \fB\-\-json\fP +Return JSON for the attestation data for each bottle\. .SH "GLOBAL CASK OPTIONS" These options are applicable to the \fBinstall\fP, \fBreinstall\fP and \fBupgrade\fP subcommands with the \fB\-\-cask\fP switch\. .TP