Pull in changes from https://github.com/Homebrew/homebrew-services/pull/174 and some missing changes from https://github.com/Homebrew/brew/pull/5089.
54 KiB
brew(1) -- The missing package manager for macOS
SYNOPSIS
brew --version
brew command [--verbose|-v] [options] [formula] ...
DESCRIPTION
Homebrew is the easiest and most flexible way to install the UNIX tools Apple didn't include with macOS.
ESSENTIAL COMMANDS
For the full command list, see the COMMANDS section.
With --verbose or -v, many commands print extra debugging information. Note that these flags should only appear after a command.
-
installformula: Installformula. -
uninstallformula: Uninstallformula. -
update: Fetch the newest version of Homebrew from GitHub usinggit(1). -
list: List all installed formulae. -
search(text|/text/): Perform a substring search of formula names fortext. Iftextis surrounded with slashes, then it is interpreted as a regular expression. The search fortextis extended online to some popular taps. If no search term is given, all locally available formulae are listed.
COMMANDS
-
analytics[state]: Display anonymous user behaviour analytics state. Read more at https://docs.brew.sh/Analytics. -
analytics(on|off): Turn on/off Homebrew's analytics. -
analyticsregenerate-uuid: Regenerate UUID used in Homebrew's analytics. -
catformula: Display the source toformula. -
cleanup[--prune=days] [--dry-run] [-s] [formulae|casks]: Remove stale lock files and outdated downloads for formulae and casks, and remove old versions of installed formulae. If arguments are specified, only do this for the specified formulae and casks.If
--prune=daysis specified, remove all cache files older thandays.If
--dry-runor-nis passed, show what would be removed, but do not actually remove anything.If
-sis passed, scrub the cache, including downloads for even the latest versions. Note downloads for any installed formula or cask will still not be deleted. If you want to delete those too:rm -rf "$(brew --cache)" -
commandcmd: Display the path to the file which is used when invokingbrewcmd. -
commands[--quiet[--include-aliases]]: Show a list of built-in and external commands.If
--quietis passed, list only the names of commands without the header. With--include-aliases, the aliases of internal commands will be included. -
config: Show Homebrew and system configuration useful for debugging. If you file a bug report, you will likely be asked for this information if you do not provide it. -
deps[--1] [-n] [--union] [--full-name] [--installed] [--include-build] [--include-optional] [--skip-recommended] [--include-requirements]formulae: Show dependencies forformulae. When given multiple formula arguments, show the intersection of dependencies forformulae.If
--1is passed, only show dependencies one level down, instead of recursing.If
-nis passed, show dependencies in topological order.If
--unionis passed, show the union of dependencies forformulae, instead of the intersection.If
--full-nameis passed, list dependencies by their full name.If
--installedis passed, only list those dependencies that are currently installed.By default,
depsshows required and recommended dependencies forformulae. To include the:buildtype dependencies, pass--include-build. Similarly, pass--include-optionalto include:optionaldependencies or--include-testto include (non-recursive):testdependencies. To skip:recommendedtype dependencies, pass--skip-recommended. To include requirements in addition to dependencies, pass--include-requirements. -
deps--tree[--1] [filters] [--annotate] (formulae|--installed): Show dependencies as a tree. When given multiple formula arguments, output individual trees for every formula.If
--1is passed, only one level of children is displayed.If
--installedis passed, output a tree for every installed formula.The
filtersplaceholder is any combination of options--include-build,--include-optional,--include-test,--skip-recommended, and--include-requirementsas documented above.If
--annotateis passed, the build, optional, and recommended dependencies are marked as such in the output. -
deps[filters] (--installed|--all): Show dependencies for installed or all available formulae. Every line of output starts with the formula name, followed by a colon and all direct dependencies of that formula.The
filtersplaceholder is any combination of options--include-build,--include-optional,--include-test, and--skip-recommendedas documented above. -
descformula: Displayformula's name and one-line description. -
desc[--search|--name|--description] (text|/text/): Search both name and description (--searchor-s), just the names (--nameor-n), or just the descriptions (--descriptionor-d) fortext. Iftextis flanked by slashes, it is interpreted as a regular expression. Formula descriptions are cached; the cache is created on the first search, making that search slower than subsequent ones. -
diy[--name=name] [--version=version]: Automatically determine the installation prefix for non-Homebrew software.Using the output from this command, you can install your own software into the Cellar and then link it into Homebrew's prefix with
brew link.The options
--name=nameand--version=versioneach take an argument and allow you to explicitly set the name and version of the package you are installing. -
doctor: Check your system for potential problems. Doctor exits with a non-zero status if any potential problems are found. Please note that these warnings are just used to help the Homebrew maintainers with debugging if you file an issue. If everything you use Homebrew for is working fine: please don't worry or file an issue; just ignore this. -
fetch[--force] [--retry] [-v] [--devel|--HEAD] [--deps] [--build-from-source|--force-bottle]formulae: Download the source packages for the givenformulae. For tarballs, also print SHA-256 checksums.If
--HEADor--develis passed, fetch that version instead of the stable version.If
-vis passed, do a verbose VCS checkout, if the URL represents a VCS. This is useful for seeing if an existing VCS cache has been updated.If
--force(or-f) is passed, remove a previously cached version and re-fetch.If
--retryis passed, retry if a download fails or re-download if the checksum of a previously cached version no longer matches.If
--depsis passed, also download dependencies for any listedformulae.If
--build-from-source(or-s) is passed, download the source rather than a bottle.If
--force-bottleis passed, download a bottle if it exists for the current or newest version of macOS, even if it would not be used during installation. -
gist-logs[--new-issue|-n] [--private|-p]formula: Upload logs for a failed build offormulato a new Gist.formulais usually the name of the formula to install, but it can be specified in several different ways. See SPECIFYING FORMULAE.If
--with-hostnameis passed, include the hostname in the Gist.If
--new-issueis passed, automatically create a new issue in the appropriate GitHub repository as well as creating the Gist.If
--privateis passed, the Gist will be marked private and will not appear in listings but will be accessible with the link.If no logs are found, an error message is presented.
-
home: Open Homebrew's own homepage in a browser. -
homeformula: Openformula's homepage in a browser. -
info: Display brief statistics for your Homebrew installation. -
info--analytics[--days=days] [--category=category]: Display Homebrew analytics data (provided neitherHOMEBREW_NO_ANALYTICSorHOMEBREW_NO_GITHUB_APIare set)The value for
daysmust be30,90or365. The default is30.The value for
categorymust beinstall,install-on-request,build-errororos-version. The default isinstall. -
infoformula[--analytics]: Display information aboutformulaand analytics data (provided neitherHOMEBREW_NO_ANALYTICSorHOMEBREW_NO_GITHUB_APIare set)Pass
--verboseto see more verbose analytics data.Pass
--analyticsto see only more verbose analytics data instead of formula information. -
info--githubformula: Open a browser to the GitHub History page forformula.To view formula history locally:
brew log -pformula -
info--json=version(--all|--installed|formulae): Print a JSON representation offormulae. Currently the only accepted value forversionisv1.Pass
--allto get information on all formulae, or--installedto get information on all installed formulae.See the docs for examples of using the JSON output: https://docs.brew.sh/Querying-Brew
-
install[--debug] [--env=(std|super)] [--ignore-dependencies|--only-dependencies] [--cc=compiler] [--build-from-source|--force-bottle] [--include-test] [--devel|--HEAD] [--keep-tmp] [--build-bottle] [--force] [--verbose] [--display-times]formula[options...]: Installformula.formulais usually the name of the formula to install, but it can be specified in several different ways. See SPECIFYING FORMULAE.If
--debug(or-d) is passed and brewing fails, open an interactive debugging session with access to IRB or a shell inside the temporary build directory.If
--env=stdis passed, use the standard build environment instead of superenv.If
--env=superis passed, use superenv even if the formula specifies the standard build environment.If
--ignore-dependenciesis passed, skip installing any dependencies of any kind. If they are not already present, the formula will probably fail to install.If
--only-dependenciesis passed, install the dependencies with specified options but do not install the specified formula.If
--cc=compileris passed, attempt to compile usingcompiler.compilershould be the name of the compiler's executable, for instancegcc-8for gcc 8,gcc-4.2for Apple's GCC 4.2, orgcc-4.9for a Homebrew-provided GCC 4.9. In order to use LLVM's clang, usellvm_clang. To specify the Apple-provided clang, useclang. This parameter will only accept compilers that are provided by Homebrew or bundled with macOS. Please do not file issues if you encounter errors while using this flag.If
--build-from-source(or-s) is passed, compile the specifiedformulafrom source even if a bottle is provided. Dependencies will still be installed from bottles if they are available.If
HOMEBREW_BUILD_FROM_SOURCEis set, regardless of whether--build-from-sourcewas passed, then bothformulaand the dependencies installed as part of this process are built from source even if bottles are available.If
--force-bottleis passed, install from a bottle if it exists for the current or newest version of macOS, even if it would not normally be used for installation.If
--include-testis passed, install testing dependencies. These are only needed by formulae maintainers to runbrew test.If
--develis passed, andformuladefines it, install the development version.If
--HEADis passed, andformuladefines it, install the HEAD version, aka master, trunk, unstable.If
--keep-tmpis passed, the temporary files created during installation are not deleted.If
--build-bottleis passed, prepare the formula for eventual bottling during installation.If
--force(or-f) is passed, install without checking for previously installed keg-only or non-migrated versionsIf
--verbose(or-v) is passed, print the verification and postinstall steps.If
--display-timesis passed, install times for each formula are printed at the end of the run.Installation options specific to
formulamay be appended to the command, and can be listed withbrew optionsformula. -
install--interactive[--git]formula: If--interactive(or-i) is passed, download and patchformula, then open a shell. This allows the user to run./configure --helpand otherwise determine how to turn the software package into a Homebrew formula.If
--git(or-g) is passed, Homebrew will create a Git repository, useful for creating patches to the software. -
leaves: Show installed formulae that are not dependencies of another installed formula. -
ln,link[--overwrite] [--dry-run] [--force]formula: Symlink all offormula's installed files into the Homebrew prefix. This is done automatically when you install formulae but can be useful for DIY installations.If
--overwriteis passed, Homebrew will delete files which already exist in the prefix while linking.If
--dry-runor-nis passed, Homebrew will list all files which would be linked or which would be deleted bybrew link --overwrite, but will not actually link or delete any files.If
--force(or-f) is passed, Homebrew will allow keg-only formulae to be linked. -
list,ls[--full-name] [-1] [-l] [-t] [-r]: List all installed formulae. If--full-nameis passed, print formulae with fully-qualified names. If--full-nameis not passed, other options (i.e.-1,-l,-tand-r) are passed tolswhich produces the actual output. -
list,ls--unbrewed: List all files in the Homebrew prefix not installed by Homebrew. -
list,ls[--verbose] [--versions[--multiple]] [--pinned] [formulae]: List the installed files forformulae. Combined with--verbose, recursively list the contents of all subdirectories in eachformula's keg.If
--versionsis passed, show the version number for installed formulae, or only the specified formulae ifformulaeare given. With--multiple, only show formulae with multiple versions installed.If
--pinnedis passed, show the versions of pinned formulae, or only the specified (pinned) formulae ifformulaeare given. See alsopin,unpin. -
log[git-log-options]formula...: Show the git log for the given formulae. Options thatgit-log(1) recognizes can be passed before the formula list. -
migrate[--force]formulae: Migrate renamed packages to new name, whereformulaeare old names of packages.If
--force(or-f) is passed, then treat installedformulaeand passedformulaelike if they are from same taps and migrate them anyway. -
missing[--hide=hidden] [formulae]: Check the givenformulaefor missing dependencies. If noformulaeare given, check all installed brews.If
--hide=hiddenis passed, act as if none ofhiddenare installed.hiddenshould be a comma-separated list of formulae.missingexits with a non-zero status if any formulae are missing dependencies. -
options[--compact] (--all|--installed|formulae): Display install options specific toformulae.If
--compactis passed, show all options on a single line separated by spaces.If
--allis passed, show options for all formulae.If
--installedis passed, show options for all installed formulae. -
outdated[--quiet|--verbose|--json=version] [--fetch-HEAD]: Show formulae that have an updated version available.By default, version information is displayed in interactive shells, and suppressed otherwise.
If
--quietis passed, list only the names of outdated brews (takes precedence over--verbose).If
--verbose(or-v) is passed, display detailed version information.If
--json=versionis passed, the output will be in JSON format. Currently the only accepted value forversionisv1.If
--fetch-HEADis passed, fetch the upstream repository to detect if the HEAD installation of the formula is outdated. Otherwise, the repository's HEAD will be checked for updates when a new stable or devel version has been released. -
pinformulae: Pin the specifiedformulae, preventing them from being upgraded when issuing thebrew upgradeformulaecommand. See alsounpin. -
postinstallformula: Rerun the post-install steps forformula. -
prune[--dry-run]: Remove dead symlinks from the Homebrew prefix. This is generally not needed, but can be useful when doing DIY installations.If
--dry-runor-nis passed, show what would be removed, but do not actually remove anything. -
readall[--aliases] [--syntax] [taps]: Import all formulae from specifiedtaps(defaults to all installed taps).This can be useful for debugging issues across all formulae when making significant changes to
formula.rb, testing the performance of loading all formulae or to determine if any current formulae have Ruby issues.If
--aliasesis passed, also verify any alias symlinks in each tap.If
--syntaxis passed, also syntax-check all of Homebrew's Ruby files. -
reinstall[--display-times]formula: Uninstall and then installformula(with existing install options).If
--display-timesis passed, install times for each formula are printed at the end of the run. -
search,-S: Display all locally available formulae (including tapped ones). No online search is performed. -
search--casks: Display all locally available casks (including tapped ones). No online search is performed. -
search[--desc] (text|/text/): Perform a substring search of cask tokens and formula names fortext. Iftextis surrounded with slashes, then it is interpreted as a regular expression. The search fortextis extended online to official taps.If
--descis passed, search formulae with a description matchingtextand casks with a name matchingtext. -
search(--debian|--fedora|--fink|--macports|--opensuse|--ubuntu)text: Search fortextin the given package manager's list. -
sh[--env=std]: Start a Homebrew build environment shell. Uses our years-battle-hardened Homebrew build logic to help your./configure && make && make installor even yourgem installsucceed. Especially handy if you run Homebrew in an Xcode-only configuration since it adds tools likemaketo yourPATHwhich otherwise build systems would not find.If
--env=stdis passed, use the standardPATHinstead of superenv's. -
shellenv: Prints export statements - run them in a shell and this installation of Homebrew will be included into your PATH, MANPATH, and INFOPATH.HOMEBREW_PREFIX, HOMEBREW_CELLAR and HOMEBREW_REPOSITORY are also exported to save multiple queries of those variables.
Consider adding evaluating the output in your dotfiles (e.g.
~/.profile) witheval $(brew shellenv) -
style[--fix] [--display-cop-names] [--only-cops=cops|--except-cops=cops] [files|taps|formulae]: Check formulae or files for conformance to Homebrew style guidelines.Lists of
files,tapsandformulaemay not be combined. If none are provided,stylewill run style checks on the whole Homebrew library, including core code and all formulae.If
--fixis passed, automatically fix style violations using RuboCop's auto-correct feature.If
--display-cop-namesis passed, include the RuboCop cop name for each violation in the output.Passing
--only-cops=copswill check for violations of only the listed RuboCopcops, while--except-cops=copswill skip checking the listedcops. For either optioncopsshould be a comma-separated list of cop names.Exits with a non-zero status if any style violations are found.
-
switchformulaversion: Symlink all of the specificversionofformula's install to Homebrew prefix. -
tap: List all installed taps. -
tap[--full] [--force-auto-update]user/repo[URL]: Tap a formula repository.With
URLunspecified, taps a formula repository from GitHub using HTTPS. Since so many taps are hosted on GitHub, this command is a shortcut forbrew tapuser/repohttps://github.com/user/homebrew-repo.With
URLspecified, taps a formula repository from anywhere, using any transport protocol thatgithandles. The one-argument form oftapsimplifies but also limits. This two-argument command makes no assumptions, so taps can be cloned from places other than GitHub and using protocols other than HTTPS, e.g., SSH, GIT, HTTP, FTP(S), RSYNC.By default, the repository is cloned as a shallow copy (
--depth=1), but if--fullis passed, a full clone will be used. To convert a shallow copy to a full copy, you can retap passing--fullwithout first untapping.By default, only taps hosted on GitHub are auto-updated (for performance reasons). If
--force-auto-updateis passed, this tap will be auto-updated even if it is not hosted on GitHub.tapis re-runnable and exits successfully if there's nothing to do. However, retapping with a differentURLwill cause an exception, so firstuntapif you need to modify theURL. -
tap--repair: Migrate tapped formulae from symlink-based to directory-based structure. -
tap--list-pinned: List all pinned taps. -
tap-info: Display a brief summary of all installed taps. -
tap-info(--installed|taps): Display detailed information about one or moretaps.Pass
--installedto display information on all installed taps. -
tap-info--json=version(--installed|taps): Print a JSON representation oftaps. Currently the only accepted value forversionisv1.Pass
--installedto get information on installed taps.See the docs for examples of using the JSON output: https://docs.brew.sh/Querying-Brew
-
tap-pintap: Pintap, prioritizing its formulae over core when formula names are supplied by the user. See alsotap-unpin. -
tap-unpintap: Unpintapso its formulae are no longer prioritized. See alsotap-pin. -
uninstall,rm,remove[--force] [--ignore-dependencies]formula: Uninstallformula.If
--force(or-f) is passed, and there are multiple versions offormulainstalled, delete all installed versions.If
--ignore-dependenciesis passed, uninstalling won't fail, even if formulae depending onformulawould still be installed. -
unlink[--dry-run]formula: Remove symlinks forformulafrom the Homebrew prefix. This can be useful for temporarily disabling a formula:brew unlinkformula&&commands&& brew linkformulaIf
--dry-runor-nis passed, Homebrew will list all files which would be unlinked, but will not actually unlink or delete any files. -
unpack[--git|--patch] [--destdir=path]formulae: Unpack the source files forformulaeinto subdirectories of the current working directory. If--destdir=pathis given, the subdirectories will be created in the directory named bypathinstead.If
--patchis passed, patches forformulaewill be applied to the unpacked source.If
--git(or-g) is passed, a Git repository will be initialized in the unpacked source. This is useful for creating patches for the software. -
unpinformulae: Unpinformulae, allowing them to be upgraded bybrew upgradeformulae. See alsopin. -
untaptap: Remove a tapped repository. -
update[--merge] [--force]: Fetch the newest version of Homebrew and all formulae from GitHub usinggit(1) and perform any necessary migrations.If
--mergeis specified thengit mergeis used to include updates (rather thangit rebase).If
--force(or-f) is specified then always do a slower, full update check even if unnecessary. -
update-reset[repositories]: Fetches and resets Homebrew and all tap repositories (or the specifiedrepositories) usinggit(1) to their latestorigin/master. Note this will destroy all your uncommitted or committed changes. -
upgrade[install-options] [--cleanup] [--fetch-HEAD] [--ignore-pinned] [--display-times] [formulae]: Upgrade outdated, unpinned brews (with existing install options).Options for the
installcommand are also valid here.If
--cleanupis specified orHOMEBREW_UPGRADE_CLEANUPis set then remove previously installed version(s) of upgradedformulae.If
--fetch-HEADis passed, fetch the upstream repository to detect if the HEAD installation of the formula is outdated. Otherwise, the repository's HEAD will be checked for updates when a new stable or devel version has been released.If
--ignore-pinnedis passed, set a 0 exit code even if pinned formulae are not upgraded.If
--display-timesis passed, install times for each formula are printed at the end of the run.If
formulaeare given, upgrade only the specified brews (unless they are pinned; seepin,unpin). -
uses[--installed] [--recursive] [--include-build] [--include-test] [--include-optional] [--skip-recommended] [--devel|--HEAD]formulae: Show the formulae that specifyformulaeas a dependency. When given multiple formula arguments, show the intersection of formulae that useformulae.Use
--recursiveto resolve more than one level of dependencies.If
--installedis passed, only list installed formulae.By default,
usesshows all formulae that specifyformulaeas a required or recommended dependency. To include the:buildtype dependencies, pass--include-build, to include the:testtype dependencies, pass--include-testand to include:optionaldependencies pass--include-optional. To skip:recommendedtype dependencies, pass--skip-recommended.By default,
usesshows usage offormulaeby stable builds. To find cases whereformulaeis used by development or HEAD build, pass--develor--HEAD. -
--cache: Display Homebrew's download cache. See alsoHOMEBREW_CACHE. -
--cache[--build-from-source|-s] [--force-bottle]formula: Display the file or directory used to cacheformula. -
--cellar: Display Homebrew's Cellar path. Default:$(brew --prefix)/Cellar, or if that directory doesn't exist,$(brew --repository)/Cellar. -
--cellarformula: Display the location in the cellar whereformulawould be installed, without any sort of versioned directory as the last path. -
--env[--shell=(shell|auto)|--plain]: Show a summary of the Homebrew build environment as a plain list.Pass
--shell=shellto generate a list of environment variables for the specified shell, or--shell=autoto detect the current shell.If the command's output is sent through a pipe and no shell is specified, the list is formatted for export to
bash(1) unless--plainis passed. -
--prefix: Display Homebrew's install path. Default:/usr/localon macOS and/home/linuxbrew/.linuxbrewon Linux -
--prefixformula: Display the location in the cellar whereformulais or would be installed. -
--repository: Display where Homebrew's.gitdirectory is located. -
--repositoryuser/repo: Display where tapuser/repo's directory is located. -
--version: Print the version number of Homebrew to standard output and exit.
DEVELOPER COMMANDS
audit [options] formulae
Check formulae for Homebrew coding style violations. This should be run before
submitting a new formula. Will exit with a non-zero status if any errors are
found, which can be useful for implementing pre-commit hooks.
If no formulae are provided, all of them are checked.
--strict: Run additional style checks, including RuboCop style checks.--online: Run additional slower style checks that require a network connection.--new-formula: Run various additional style checks to determine if a new formula is eligible for Homebrew. This should be used when creating new formula and implies--strictand--online.--fix: Fix style violations automatically using RuboCop's auto-correct feature.--display-cop-names: Include the RuboCop cop name for each violation in the output.--display-filename: Prefix every line of output with name of the file or formula being audited, to make output easy to grep.-D,--audit-debug: Enable debugging and profiling of audit methods.--only: Specify a comma-separatedmethodlist to only run the methods namedaudit_method.--except: Specify a comma-separatedmethodlist to skip running the methods namedaudit_method.--only-cops: Specify a comma-separatedcopslist to check for violations of only the listed RuboCop cops.--except-cops: Specify a comma-separatedcopslist to skip checking for violations of the listed RuboCop cops.
bottle [options] formulae
Generate a bottle (binary package) from a formula that was installed with
--build-bottle.
If the formula specifies a rebuild version, it will be incremented in the
generated DSL. Passing --keep-old will attempt to keep it at its original
value, while --no-rebuild will remove it.
--skip-relocation: Do not check if the bottle can be marked as relocatable.--or-later: Append_or_laterto the bottle tag.--force-core-tap: Build a bottle even ifformulais not in homebrew/core or any installed taps.--no-rebuild: If the formula specifies a rebuild version, remove it from the generated DSL.--keep-old: If the formula specifies a rebuild version, attempt to preserve its value in the generated DSL.--json: Write bottle information to a JSON file, which can be used as the argument for--merge.--merge: Generate an updated bottle block for a formula and optionally merge it into the formula file. Instead of a formula name, requires a JSON file generated withbrew bottle --jsonformula.--write: Write the changes to the formula file. A new commit will be generated unless--no-commitis passed.--no-commit: When passed with--write, a new commit will not generated after writing changes to the formula file.--root-url: Use the specifiedURLas the root of the bottle's URL instead of Homebrew's default.
bump-formula-pr [options] [formula]
Create a pull request to update a formula with a new URL or a new tag.
If a URL is specified, the SHA-256 checksum of the new download should also
be specified. A best effort to determine the SHA-256 and formula name will
be made if either or both values are not supplied by the user.
If a tag is specified, the Git commit revision corresponding to that tag
must also be specified.
Note: this command cannot be used to transition a formula from a URL-and-SHA-256 style specification into a tag-and-revision style specification, nor vice versa. It must use whichever style specification the preexisting formula already uses.
--devel: Bump the development rather than stable version. The development spec must already exist.-n,--dry-run: Print what would be done rather than doing it.--write: When passed along with--dry-run, perform a not-so-dry run by making the expected file modifications but not taking any Git actions.--audit: Runbrew auditbefore opening the PR.--strict: Runbrew audit --strictbefore opening the PR.--no-browse: Print the pull request URL instead of opening in a browser.--mirror: Use the providedURLas a mirror URL.--version: Use the providedversionto override the value parsed from the URL or tag. Note that--version=0can be used to delete an existing version override from a formula if it has become redundant.--message: Append the providedmessageto the default PR message.--url: Specify theURLfor the new download. If aURLis specified, theSHA-256checksum of the new download should also be specified.--sha256: Specify theSHA-256checksum of the new download.--tag: Specify the new git committagfor the formula.--revision: Specify the new git commitrevisioncorresponding to a specifiedtag.
create [options] URL
Generate a formula for the downloadable file at URL and open it in the editor.
Homebrew will attempt to automatically derive the formula name and version, but
if it fails, you'll have to make your own template. The wget formula serves as
a simple example. For the complete API, see:
http://www.rubydoc.info/github/Homebrew/brew/master/Formula
--autotools: Create a basic template for an Autotools-style build.--cmake: Create a basic template for a CMake-style build.--meson: Create a basic template for a Meson-style build.--no-fetch: Homebrew will not downloadURLto the cache and will thus not add the SHA-256 to the formula for you, nor will it check the GitHub API for GitHub projects (to fill out its description and homepage).--HEAD: Indicate thatURLpoints to the package's repository rather than a file.--set-name: Set the name of the new formula to the providedname.--set-version: Set the version of the new formula to the providedversion.--tap: Generate the new formula in the provided tap, specified asuser/repo.
edit [formulae]
Open a formula in the editor set by EDITOR or HOMEBREW_EDITOR, or open the
Homebrew repository for editing if no formula is provided.
extract [options] formula tap
Look through repository history to find the most recent version of formula and
create a copy in tap/Formula/formula@version.rb. If the tap is not
installed yet, attempt to install/clone the tap before continuing.
--version: Extract the providedversionofformulainstead of the most recent.
formula formulae
Display the path where a formula is located.
irb [options]
Enter the interactive Homebrew Ruby shell.
--examples: Show several examples.--pry: Use Pry instead of IRB. Implied ifHOMEBREW_PRYis set.
linkage [options] [formulae]
Check the library links for kegs of installed formulae. Raises an error if run on uninstalled formulae.
--test: Display only missing libraries and exit with a non-zero status if any missing libraries are found.--reverse: For every library that a keg references, print its dylib path followed by the binaries that link to it.--cached: Print the cached linkage values stored inHOMEBREW_CACHE, set by a previousbrew linkagerun.
man [options]
Generate Homebrew's manpages.
--fail-if-changed: Return a failing status code if changes are detected in the manpage outputs. This can be used for CI to be notified when the manpages are out of date. Additionally, the date used in new manpages will match those in the existing manpages (to allow comparison without factoring in the date).--link: This is now done automatically bybrew update.
mirror formulae
Reuploads the stable URL for a formula to Bintray to use it as a mirror.
prof [ruby options]
Run Homebrew with the Ruby profiler.
Example: brew prof readall
pull [options] patch sources
Get a patch from a GitHub commit or pull request and apply it to Homebrew. Optionally, publish updated bottles for the formulae changed by the patch.
Each patch source may be one of:
~ The ID number of a PR (pull request) in the homebrew/core GitHub repository
~ The URL of a PR on GitHub, using either the web page or API URL formats. In this form, the PR may be on Homebrew/brew, Homebrew/homebrew-core or any tap.
~ The URL of a commit on GitHub
~ A "https://jenkins.brew.sh/job/..." string specifying a testing job ID
--bottle: Handle bottles, pulling the bottle-update commit and publishing files on Bintray.--bump: For one-formula PRs, automatically reword commit message to our preferred format.--clean: Do not rewrite or otherwise modify the commits found in the pulled PR.--ignore-whitespace: Silently ignore whitespace discrepancies when applying diffs.--resolve: When a patch fails to apply, leave in progress and allow user to resolve, instead of aborting.--branch-okay: Do not warn if pulling to a branch besides master (useful for testing).--no-pbcopy: Do not copy anything to the system clipboard.--no-publish: Do not publish bottles to Bintray.--warn-on-publish-failure: Do not exit if there's a failure publishing bottles on Bintray.--bintray-org: Publish bottles at the provided Bintrayorganisation.--test-bot-user: Pull the bottle block commit from the provideduseron GitHub.
release-notes [options] [previous_tag] [end_ref]
Print the merged pull requests on Homebrew/brew between two Git refs.
If no previous_tag is provided it defaults to the latest tag.
If no end_ref is provided it defaults to origin/master.
--markdown: Print as a Markdown list.
ruby [ruby options]
Run a Ruby instance with Homebrew's libraries loaded.
Example: brew ruby -e "puts :gcc.f.deps" or brew ruby script.rb
-e: Execute the provided string argument as a script.
tap-new user/repo
Generate the template files for a new tap.
test [options] formulae
Run the test method provided by an installed formula. There is no standard output or return code, but generally it should notify the user if something is wrong with the installed formula.
Example: brew install jruby && brew test jruby
--devel: Test the development version of a formula.--HEAD: Test the head version of a formula.--keep-tmp: Keep the temporary files created for the test.
tests [options]
Run Homebrew's unit and integration tests.
--coverage: Generate code coverage reports.--generic: Run only OS-agnostic tests.--no-compat: Do not load the compatibility layer when running tests.--online: Include tests that use the GitHub API and tests that use any of the taps for official external commands.--only: Run onlytest_script_spec.rb. Appending:line_numberwill start at a specific line.--seed: Randomize tests with the providedvalueinstead of a random seed.
update-test [options]
Run a test of brew update with a new repository clone.
If no arguments are passed, use origin/master as the start commit.
--to-tag: SetHOMEBREW_UPDATE_TO_TAGto test updating between tags.--keep-tmp: Retain the temporary directory containing the new repository clone.--commit: Use providedcommitas the start commit.--before: Use the commit at provideddateas the start commit.
GLOBAL OPTIONS
These options are applicable across all sub-commands.
-
-q,--quiet: Suppress any warnings. -
-v,--verbose: Make some output more verbose. -
-d,--debug: Display any debugging information. -
-f,--force: Override warnings and enable potentially unsafe operations.
OFFICIAL EXTERNAL COMMANDS
-
bundlecommand: Bundler for non-Ruby dependencies from Homebrew.brew bundle[install] [-v|--verbose] [--no-upgrade] [--file=path|--global]: Install or upgrade all dependencies in a Brewfile.brew bundle dump[--force] [--describe] [--file=path|--global]: Write all installed casks/formulae/taps into a Brewfile.brew bundle cleanup[--force] [--zap] [--file=path|--global]: Uninstall all dependencies not listed in a Brewfile.brew bundle check[--no-upgrade] [--file=path|--global] [--verbose]: Check if all dependencies are installed in a Brewfile. Missing dependencies are listed in verbose mode.checkwill exit on the first category missing a dependency unless in verbose mode.brew bundle execcommand: Run an external command in an isolated build environment.brew bundle list[--all|--brews|--casks|--taps|--mas] [--file=path|--global]: List all dependencies present in a Brewfile, optionally limiting by types. By default, only brew dependencies are output.If
-vor--verboseare passed, print verbose output.If
--no-upgradeis passed, don't runbrew upgradeon outdated dependencies. Note they may still be upgraded bybrew installif needed.If
--forceis passed, uninstall dependencies or overwrite an existing Brewfile.If
--zapis passed, casks will be removed using thezapcommand instead ofuninstall.If
--file=pathis passed, the Brewfile path is set accordingly. Use--file=-to output to console.If
--globalis passed, set the Brewfile path to~/.Brewfile.If
--describeis passed, output a description comment above each line. This comment will not be output if the dependency does not have a description.If
-hor--helpare passed, print this help message and exit.Homebrew/homebrew-bundle: https://github.com/Homebrew/homebrew-bundle
-
cask[--version|audit|cat|cleanup|create|doctor|edit|fetch|home|info]: Install macOS applications distributed as binaries.Homebrew/homebrew-cask: https://github.com/Homebrew/homebrew-cask
-
servicescommand: Integrates Homebrew formulae with macOS'launchctlmanager.[
sudo]brew services list: List all running services for the current user (or root).[
sudo]brew services run(formula|--all): Run the serviceformulawithout registering to launch at login (or boot).[
sudo]brew services start(formula|--all): Start the serviceformulaimmediately and register it to launch at login (or boot).[
sudo]brew services stop(formula|--all): Stop the serviceformulaimmediately and unregister it from launching at login (or boot).[
sudo]brew services restart(formula|--all): Stop (if necessary) and start the serviceformulaimmediately and register it to launch at login (or boot).[
sudo]brew services cleanup: Remove all unused services.If
sudois passed, operate on/Library/LaunchDaemons(started at boot). Otherwise, operate on~/Library/LaunchAgents(started at login).Homebrew/homebrew-services: https://github.com/Homebrew/homebrew-services
CUSTOM EXTERNAL COMMANDS
Homebrew, like git(1), supports external commands. These are executable
scripts that reside somewhere in the PATH, named brew-cmdname or
brew-cmdname.rb, which can be invoked like brew cmdname. This allows you
to create your own commands without modifying Homebrew's internals.
Instructions for creating your own commands can be found in the docs: https://docs.brew.sh/External-Commands
SPECIFYING FORMULAE
Many Homebrew commands accept one or more formula arguments. These arguments
can take several different forms:
-
The name of a formula: e.g.
git,node,wget. -
The fully-qualified name of a tapped formula: Sometimes a formula from a tapped repository may conflict with one in
homebrew/core. You can still access these formulae by using a special syntax, e.g.homebrew/dupes/vimorhomebrew/versions/node4. -
An arbitrary URL: Homebrew can install formulae via URL, e.g.
https://raw.github.com/Homebrew/homebrew-core/master/Formula/git.rb. The formula file will be cached for later use.
ENVIRONMENT
Note that environment variables must have a value set to be detected. For example, export HOMEBREW_NO_INSECURE_REDIRECT=1 rather than just export HOMEBREW_NO_INSECURE_REDIRECT.
-
HOMEBREW_ARTIFACT_DOMAIN: If set, instructs Homebrew to prefix all download URLs, including those for bottles, with this variable. For example, a formula with a URL ofhttps://example.com/foo.tar.gzbutHOMEBREW_ARTIFACT_DOMAIN=http://localhost:8080would instead download fromhttp://localhost:8080/example.com/foo.tar.gz. -
HOMEBREW_AUTO_UPDATE_SECS: If set, Homebrew will only check for autoupdates once per this seconds interval.Default:
60. -
HOMEBREW_AWS_ACCESS_KEY_ID,HOMEBREW_AWS_SECRET_ACCESS_KEY: When using theS3download strategy, Homebrew will look in these variables for access credentials (see https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#cli-environment to retrieve these access credentials from AWS). If they are not set, theS3download strategy will download with a public (unsigned) URL. -
HOMEBREW_BOTTLE_DOMAIN: By default, Homebrew useshttps://homebrew.bintray.com/as its download mirror for bottles. If set, instructs Homebrew to instead use the given URL. For example,HOMEBREW_BOTTLE_DOMAIN=http://localhost:8080will cause all bottles to download from the prefixhttp://localhost:8080/. -
HOMEBREW_BROWSER: If set, uses this setting as the browser when opening project homepages, instead of the OS default browser. -
HOMEBREW_BUILD_FROM_SOURCE: If set, instructs Homebrew to compile from source even when a formula provides a bottle. This environment variable is intended for use by Homebrew developers. Please do not file issues if you encounter errors when using this environment variable. -
HOMEBREW_CACHE: If set, instructs Homebrew to use the given directory as the download cache.Default:
~/Library/Caches/Homebrew. -
HOMEBREW_CURLRC: If set, Homebrew will not pass-qwhen invokingcurl(1) (which disables the use ofcurlrc). -
HOMEBREW_CURL_VERBOSE: If set, Homebrew will pass--verbosewhen invokingcurl(1). -
HOMEBREW_DEBUG: If set, any commands that can emit debugging information will do so. -
HOMEBREW_DEBUG_INSTALL: Whenbrew install -dorbrew install -idrops into a shell,HOMEBREW_DEBUG_INSTALLwill be set to the name of the formula being brewed. -
HOMEBREW_DEBUG_PREFIX: Whenbrew install -dorbrew install -idrops into a shell,HOMEBREW_DEBUG_PREFIXwill be set to the target prefix in the Cellar of the formula being brewed. -
HOMEBREW_DEVELOPER: If set, Homebrew will tweak behaviour to be more relevant for Homebrew developers (active or budding) e.g. turning warnings into errors. -
HOMEBREW_EDITOR: If set, Homebrew will use this editor when editing a single formula, or several formulae in the same directory.Note:
brew editwill open all of Homebrew as discontinuous files and directories. TextMate can handle this correctly in project mode, but many editors will do strange things in this case. -
HOMEBREW_FORCE_BREWED_CURL: If set, Homebrew will use a Homebrew-installedcurlrather than the system version. -
HOMEBREW_FORCE_VENDOR_RUBY: If set, Homebrew will always use its vendored, relocatable Ruby version even if the system version of Ruby is new enough. -
HOMEBREW_GIT: When using Git, Homebrew will useGITif set, a Homebrew-built Git if installed, or the system-provided binary.Set this to force Homebrew to use a particular git binary.
-
HOMEBREW_FORCE_BREWED_GIT: If set, Homebrew will use a Homebrew-installedgitrather than the system version. -
HOMEBREW_GITHUB_API_TOKEN: A personal access token for the GitHub API, which you can create at https://github.com/settings/tokens. If set, GitHub will allow you a greater number of API requests. See https://developer.github.com/v3/#rate-limiting for more information. Homebrew uses the GitHub API for features such asbrew search.Note: Homebrew doesn't require permissions for any of the scopes.
-
HOMEBREW_INSTALL_BADGE: Text printed before the installation summary of each successful build. Defaults to the beer emoji. -
HOMEBREW_LOGS: If set, Homebrew will use the given directory to store log files. -
HOMEBREW_MAKE_JOBS: If set, instructs Homebrew to use the value ofHOMEBREW_MAKE_JOBSas the number of parallel jobs to run when building withmake(1).Default: the number of available CPU cores.
-
HOMEBREW_NO_ANALYTICS: If set, Homebrew will not send analytics. See: https://docs.brew.sh/Analytics -
HOMEBREW_NO_AUTO_UPDATE: If set, Homebrew will not auto-update before runningbrew install,brew upgradeorbrew tap. -
HOMEBREW_NO_COLOR: If set, Homebrew will not print text with color added. -
HOMEBREW_NO_EMOJI: If set, Homebrew will not print theHOMEBREW_INSTALL_BADGEon a successful build.Note: Homebrew will only try to print emoji on Lion or newer.
-
HOMEBREW_NO_INSECURE_REDIRECT: If set, Homebrew will not permit redirects from secure HTTPS to insecure HTTP.While ensuring your downloads are fully secure, this is likely to cause from-source SourceForge, some GNU & GNOME based formulae to fail to download.
-
HOMEBREW_NO_GITHUB_API: If set, Homebrew will not use the GitHub API for e.g searches or fetching relevant issues on a failed install. -
HOMEBREW_PRY: If set, Homebrew will usepryfor thebrew irbcommand. -
HOMEBREW_SVN: When exporting from Subversion, Homebrew will useHOMEBREW_SVNif set, a Homebrew-built Subversion if installed, or the system-provided binary.Set this to force Homebrew to use a particular
svnbinary. -
HOMEBREW_TEMP: If set, instructs Homebrew to useHOMEBREW_TEMPas the temporary directory for building packages. This may be needed if your system temp directory and Homebrew Prefix are on different volumes, as macOS has trouble moving symlinks across volumes when the target does not yet exist.This issue typically occurs when using FileVault or custom SSD configurations.
-
HOMEBREW_UPGRADE_CLEANUP: If set,brew upgradealways assumes--cleanuphas been passed. -
HOMEBREW_VERBOSE: If set, Homebrew always assumes--verbosewhen running commands. -
http_proxy: Sets the HTTP proxy to be used bycurl,gitandsvnwhen downloading through Homebrew. -
https_proxy: Sets the HTTPS proxy to be used bycurl,gitandsvnwhen downloading through Homebrew. -
all_proxy: Sets the SOCKS5 proxy to be used bycurl,gitandsvnwhen downloading through Homebrew. -
ftp_proxy: Sets the FTP proxy to be used bycurl,gitandsvnwhen downloading through Homebrew. -
no_proxy: Sets the comma-separated list of hostnames and domain names that should be excluded from proxying bycurl,gitandsvnwhen downloading through Homebrew.
USING HOMEBREW BEHIND A PROXY
Use the http_proxy, https_proxy, all_proxy, no_proxy and/or ftp_proxy documented above.
For example, for an unauthenticated HTTP or SOCKS5 proxy:
export http_proxy=http://$HOST:$PORT
export all_proxy=socks5://$HOST:$PORT
And for an authenticated HTTP proxy:
export http_proxy=http://$USER:$PASSWORD@$HOST:$PORT
SEE ALSO
Homebrew Documentation: https://docs.brew.sh
brew-cask(1), git(1), git-log(1)
AUTHORS
Homebrew's lead maintainer is Mike McQuaid.
Homebrew's project leadership committee is Mike McQuaid, JCount, Misty De Meo and Markus Reiter.
Homebrew/brew's other current maintainers are Claudia, Michka Popoff, Shaun Jackman, Chongyu Zhu, commitay, Vitor Galvao, JCount, Misty De Meo, Gautham Goli, Markus Reiter, Steven Peters, Jonathan Chang and William Woodruff.
Homebrew/brew's Linux support (and Linuxbrew) maintainers are Michka Popoff and Shaun Jackman.
Homebrew/homebrew-core's other current maintainers are Claudia, Michka Popoff, Shaun Jackman, Chongyu Zhu, commitay, Izaak Beekman, Sean Molenaar, Jan Viljanen, Viktor Szakats, FX Coudert, Thierry Moisan, Steven Peters, JCount, Misty De Meo and Tom Schoonjans.
Former maintainers with significant contributions include Dominyk Tiller, Tim Smith, Baptiste Fontaine, Xu Cheng, Martin Afanasjew, Brett Koonce, Charlie Sharpsteen, Jack Nagel, Adam Vandenberg, Andrew Janke, Alex Dunn, neutric, Tomasz Pajor, Uladzislau Shablinski, Alyssa Ross, ilovezfs and Homebrew's creator: Max Howell.
BUGS
See our issues on GitHub:
-
Homebrew/brew: https://github.com/Homebrew/brew/issues
-
Homebrew/homebrew-core: https://github.com/Homebrew/homebrew-core/issues