brew/Library/Homebrew/manpages/brew.1.md.erb

244 lines
6.5 KiB
Plaintext
Raw Normal View History

<%
# To make changes to this man page:
#
# - For changes to a command under `COMMANDS` or `DEVELOPER COMMANDS` sections):
# - Find the source file in `Library/Homebrew/[dev-]cmd/<command>.{rb,sh}`.
# - For `.rb` files, edit the `<command>_args` method.
# - For `.sh` files, edit the top comment, being sure to use the line prefix
# `#:` for the comments to be recognized as documentation. If in doubt,
# compare with already documented commands.
# - For global options: Edit `Library/Homebrew/cli/parser.rb`.
# - For environment variables: Edit `Library/Homebrew/env_config.rb`.
# - For other changes: Edit this file.
#
# When done, regenerate the man page and its HTML version by running
# `brew generate-man-completions`.
%>
brew(1) -- The Missing Package Manager for macOS (or Linux)
===========================================================
2016-04-08 16:28:35 +02:00
## SYNOPSIS
`brew` `--version`<br>
2024-03-10 03:22:53 +00:00
`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. It can also install software not packaged for your
Linux distribution without requiring `sudo`.
## TERMINOLOGY
2024-03-10 03:22:53 +00:00
**formula**
2024-03-10 03:22:53 +00:00
: Homebrew package definition that builds from upstream sources
2024-03-10 03:22:53 +00:00
**cask**
2024-03-10 03:22:53 +00:00
: Homebrew package definition that installs macOS native applications
2024-03-10 03:22:53 +00:00
**prefix**
2024-03-10 03:22:53 +00:00
: path in which Homebrew is installed, e.g. `/usr/local`
2024-03-10 03:22:53 +00:00
**keg**
2024-03-10 03:22:53 +00:00
: installation destination directory of a given **formula** version, e.g. `/usr/local/Cellar/foo/0.1`
2024-03-10 03:22:53 +00:00
**rack**
2024-03-10 03:22:53 +00:00
: directory containing one or more versioned **kegs**, e.g. `/usr/local/Cellar/foo`
2024-03-10 03:22:53 +00:00
**keg-only**
2024-03-10 03:22:53 +00:00
: a **formula** is *keg-only* if it is not symlinked into Homebrew's prefix
**opt prefix**
: a symlink to the active version of a **keg**, e.g. `/usr/local/opt/foo`
**Cellar**
: directory containing one or more named **racks**, e.g. `/usr/local/Cellar`
**Caskroom**
: directory containing one or more named **casks**, e.g. `/usr/local/Caskroom`
**external command**
: `brew` subcommand defined outside of the Homebrew/brew GitHub repository
**tap**
: directory (and usually Git repository) of **formulae**, **casks** and/or **external commands**
**bottle**
: pre-built **keg** poured into a **rack** of the **Cellar** instead of building from upstream sources
## ESSENTIAL COMMANDS
For the full command list, see the [COMMANDS](#commands) section.
With `--verbose` or `--debug`, many commands print extra debugging information.
Note that these options should only appear after a command.
Some command behaviour can be customised with environment variables; see the [ENVIRONMENT](#environment) section.
2020-11-12 10:40:41 -05:00
### `install` <formula>
Install <formula>.
<formula> is usually the name of the formula to install, but it has other
syntaxes which are listed in the [SPECIFYING FORMULAE](#specifying-formulae)
section.
2020-11-12 10:40:41 -05:00
### `uninstall` <formula>
Uninstall <formula>.
2020-11-12 10:40:41 -05:00
### `list`
List all installed formulae.
2024-03-10 03:22:53 +00:00
### `search` \[<text>\|`/`<text>`/`\]
2019-08-06 13:23:19 -04:00
Perform a substring search of cask tokens and formula names for <text>. If
2024-03-10 03:22:53 +00:00
<text> is flanked by slashes, it is interpreted as a regular expression. The
search for <text> is extended online to `homebrew/core` and `homebrew/cask`.
If no search term is provided, all locally available formulae are listed.
## COMMANDS
<%= commands %>
2016-04-08 16:28:35 +02:00
2016-09-05 21:46:40 +01:00
## DEVELOPER COMMANDS
<%= developer_commands %>
2016-09-05 21:46:40 +01:00
## GLOBAL CASK OPTIONS
<%= global_cask_options %>
## GLOBAL OPTIONS
<%= global_options %>
## OFFICIAL EXTERNAL COMMANDS
<%= official_external_commands %>
## CUSTOM EXTERNAL COMMANDS
2016-04-08 16:28:35 +02:00
Homebrew, like `git`(1), supports external commands. These are executable
scripts that reside somewhere in the `PATH`, named `brew-`<cmdname> or
2024-03-10 03:22:53 +00:00
`brew-`<cmdname>`.rb`, which can be invoked like `brew` <cmdname>. This
allows you to create your own commands without modifying Homebrew's internals.
2016-04-08 16:28:35 +02:00
Instructions for creating your own commands can be found in the docs:
<https://docs.brew.sh/External-Commands>
2016-04-08 16:28:35 +02:00
## 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`.
2016-04-08 16:28:35 +02:00
You can still access these formulae by using a special syntax, e.g.
`homebrew/dupes/vim` or `homebrew/versions/node4`.
* An arbitrary file:
Homebrew can install formulae from a local path. It can point to either a
formula file or a bottle.
2021-01-26 15:21:24 -05:00
Prefix relative paths with `./` to prevent them from being interpreted as a
formula or tap name.
2016-04-08 16:28:35 +02:00
2020-08-01 02:30:46 +02:00
## SPECIFYING CASKS
Many Homebrew Cask commands accept one or more <cask> arguments. These can be
specified the same way as the <formula> arguments described in
`SPECIFYING FORMULAE` above.
2016-04-08 16:28:35 +02:00
## ENVIRONMENT
Note that environment variables must have a value set to be detected. For
example, run `export HOMEBREW_NO_INSECURE_REDIRECT=1` rather than just
2018-12-03 21:23:06 -05:00
`export HOMEBREW_NO_INSECURE_REDIRECT`.
Allow configuring Homebrew with `.env` files For a long time people have requested some sort of configuration files for Homebrew. Now: here's the first version of that. Similarly to how you can configure Git for a system, a repository or a user: you can configure Homebrew for a system, a prefix or a user. The system-wide configuration file is `/etc/homebrew/brew.env`, the prefix-specific configuration file is `$HOMEBREW_PREFIX/etc/homebrew/brew.env` and the user-specific configuration file is `~/.homebrew/brew.env`. As we need to read these files from Bash in `bin/brew` (so they can) influence functionality ASAP: they are in a simple format that Bash can read. It may be that we have more complex array or hash data in future that's configured through JSON or YAML (most likely JSON as we use it more) and stored in a `brew.json`/`brew.yaml` file in the same directory. As this is relying on `eval` in Bash which is fairly dangerous: we filter the lines with a regex to ensure we're only permitting setting `HOMEBREW_*` variables and nothing more. To give a bit of power to system administrators, the `HOMEBREW_SYSTEM_ENV_TAKES_PRIORITY` variable can be set in `/etc/homebrew/brew.env` to ensure that the system-wide configuration file is loaded last and overrides any prefix or user settings. Now that we have an actual location for configuration files, let's also change the `brew livecheck` watchlist configuration file to be in this directory and deprecate the existing location. As this is a developer command and the mitigation is to just move the file: we don't need to follow the normal deprecation process here.
2023-07-28 17:17:14 +01:00
`HOMEBREW_*` environment variables can also be set in Homebrew's environment
files:
* `/etc/homebrew/brew.env` (system-wide)
* `${HOMEBREW_PREFIX}/etc/homebrew/brew.env` (prefix-specific)
Allow configuring Homebrew with `.env` files For a long time people have requested some sort of configuration files for Homebrew. Now: here's the first version of that. Similarly to how you can configure Git for a system, a repository or a user: you can configure Homebrew for a system, a prefix or a user. The system-wide configuration file is `/etc/homebrew/brew.env`, the prefix-specific configuration file is `$HOMEBREW_PREFIX/etc/homebrew/brew.env` and the user-specific configuration file is `~/.homebrew/brew.env`. As we need to read these files from Bash in `bin/brew` (so they can) influence functionality ASAP: they are in a simple format that Bash can read. It may be that we have more complex array or hash data in future that's configured through JSON or YAML (most likely JSON as we use it more) and stored in a `brew.json`/`brew.yaml` file in the same directory. As this is relying on `eval` in Bash which is fairly dangerous: we filter the lines with a regex to ensure we're only permitting setting `HOMEBREW_*` variables and nothing more. To give a bit of power to system administrators, the `HOMEBREW_SYSTEM_ENV_TAKES_PRIORITY` variable can be set in `/etc/homebrew/brew.env` to ensure that the system-wide configuration file is loaded last and overrides any prefix or user settings. Now that we have an actual location for configuration files, let's also change the `brew livecheck` watchlist configuration file to be in this directory and deprecate the existing location. As this is a developer command and the mitigation is to just move the file: we don't need to follow the normal deprecation process here.
2023-07-28 17:17:14 +01:00
* `$XDG_CONFIG_HOME/homebrew/brew.env` if `$XDG_CONFIG_HOME` is set or
`~/.homebrew/brew.env` otherwise (user-specific)
Allow configuring Homebrew with `.env` files For a long time people have requested some sort of configuration files for Homebrew. Now: here's the first version of that. Similarly to how you can configure Git for a system, a repository or a user: you can configure Homebrew for a system, a prefix or a user. The system-wide configuration file is `/etc/homebrew/brew.env`, the prefix-specific configuration file is `$HOMEBREW_PREFIX/etc/homebrew/brew.env` and the user-specific configuration file is `~/.homebrew/brew.env`. As we need to read these files from Bash in `bin/brew` (so they can) influence functionality ASAP: they are in a simple format that Bash can read. It may be that we have more complex array or hash data in future that's configured through JSON or YAML (most likely JSON as we use it more) and stored in a `brew.json`/`brew.yaml` file in the same directory. As this is relying on `eval` in Bash which is fairly dangerous: we filter the lines with a regex to ensure we're only permitting setting `HOMEBREW_*` variables and nothing more. To give a bit of power to system administrators, the `HOMEBREW_SYSTEM_ENV_TAKES_PRIORITY` variable can be set in `/etc/homebrew/brew.env` to ensure that the system-wide configuration file is loaded last and overrides any prefix or user settings. Now that we have an actual location for configuration files, let's also change the `brew livecheck` watchlist configuration file to be in this directory and deprecate the existing location. As this is a developer command and the mitigation is to just move the file: we don't need to follow the normal deprecation process here.
2023-07-28 17:17:14 +01:00
User-specific environment files take precedence over prefix-specific files and
prefix-specific files take precedence over system-wide files (unless
`HOMEBREW_SYSTEM_ENV_TAKES_PRIORITY` is set, see below).
Note that these files do not support shell variable expansion e.g. `$HOME` or
command execution e.g. `$(cat file)`.
<%= environment_variables %>
2017-12-19 10:59:04 +02:00
## USING HOMEBREW BEHIND A PROXY
2017-12-19 10:59:04 +02:00
2018-12-03 21:23:06 -05:00
Set the `http_proxy`, `https_proxy`, `all_proxy`, `ftp_proxy` and/or `no_proxy`
environment variables documented above.
For example, to use an unauthenticated HTTP or SOCKS5 proxy:
2016-04-08 16:28:35 +02:00
export http_proxy=http://$HOST:$PORT
2016-04-08 16:28:35 +02:00
export all_proxy=socks5://$HOST:$PORT
2018-02-01 18:11:29 +08:00
And for an authenticated HTTP proxy:
2016-04-08 16:28:35 +02:00
export http_proxy=http://$USER:$PASSWORD@$HOST:$PORT
2016-04-08 16:28:35 +02:00
## SEE ALSO
Homebrew Documentation: <https://docs.brew.sh>
2016-04-08 16:28:35 +02:00
2019-08-20 02:14:09 -04:00
Homebrew API: <https://rubydoc.brew.sh>
`git`(1), `git-log`(1)
2016-04-08 16:28:35 +02:00
## AUTHORS
<%= lead.concat("\n") %>
<%= plc.concat("\n") %>
<%= tsc.concat("\n") %>
2018-01-18 15:45:51 +00:00
<%= maintainers.concat("\n") %>
2016-04-08 16:28:35 +02:00
<%= alumni.concat("\n") %>
2016-04-08 16:28:35 +02:00
## BUGS
See our issues on GitHub:
2024-03-10 03:22:53 +00:00
**Homebrew/brew**
: <https://github.com/Homebrew/brew/issues>
**Homebrew/homebrew-core**
: <https://github.com/Homebrew/homebrew-core/issues>
2016-04-08 16:28:35 +02:00
2024-03-10 03:22:53 +00:00
**Homebrew/homebrew-cask**
2020-08-01 02:30:46 +02:00
2024-03-10 03:22:53 +00:00
: <https://github.com/Homebrew/homebrew-cask/issues>