# Homebrew

<figure><img src="/files/GB3CBjVbpUjOdMS9q7y8" alt="" width="375"><figcaption></figcaption></figure>

> A package manager is a tool that installs, updates, and manages software for you automatically.

[Homebrew](chatgpt://generic-entity?number=0) is the most popular **package** manager for macOS — think of it a command-line App Store for developers and power users. This is where we’ll be installing **packages** for **CLI tools** like Git, Node, or Python (aka "formula"). We can also install packages for **apps** like Figma, ChatGPT or Cursor. (Aka "cask")

{% hint style="warning" %}
**Why do you need this?**\
While you can use it to to install/manage software easily, Homebrew isn’t about installing apps — it’s about controlling your environment.
{% endhint %}

## Installation

To install Homebrew, paste the following command into your Terminal, press **Enter**, and follow the on-screen instructions:

```zsh
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```

You will also need to add Homebrew to your **PATH**. Follow the instructions on screen:

```zsh
echo >> ~/.zprofile
```

{% code overflow="wrap" %}

```zsh
echo 'eval "$(/opt/homebrew/bin/brew shellenv zsh)"' >> ~/.zprofile
```

{% endcode %}

```zsh
eval "$(/opt/homebrew/bin/brew shellenv zsh)"
```

{% hint style="info" %}
**What is PATH?**

PATH is a system variable that tells your Mac:

> “Where should I look for commands when you type something in Terminal?”
> {% endhint %}

To start using Homebrew, you’ll need to open a new Terminal session. Do this by opening a new Terminal tab with `cmd + t` (be sure to close the old one). Then run the following command to ensure everything is working correctly:

```zsh
brew doctor
```

<figure><img src="/files/hADiJ3txDb4OmIH6hofI" alt="" width="375"><figcaption></figcaption></figure>

After that, let's customize your terminal in the next section!


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.macsetup.xyz/dev-environment/homebrew.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
