# Homebrew

## Installation

Most recent instructions on [brew.sh ](https://www.techwithtyler.dev/coding-and-cli-tooling/cli-tools/www.brew.sh)

{% code overflow="wrap" %}

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

{% endcode %}

***

## Commands

### Find app

{% code overflow="wrap" %}

```bash
brew search visual-studio-code

==> Casks
visual-studio                     visual-studio-code ✔              visual-studio-code@insiders
```

{% endcode %}

### Get app info

{% code overflow="wrap" %}

```bash
brew info awscli       
      
==> awscli: stable 2.17.27 (bottled), HEAD
Official Amazon AWS command-line interface
https://aws.amazon.com/cli/
```

{% endcode %}

### Install app

{% code overflow="wrap" %}

```bash
brew install awscli
```

{% endcode %}

### List installed apps

{% code overflow="wrap" %}

```bash
brew list     
                
==> Formulae
awscli			icu4c			mpfr			python@3.12
```

{% endcode %}

***

## macOS apps

Homebrew can manage macOS apps from the App Store! You just need to install `mas` first.

Refer to the [mas documentation](https://github.com/mas-cli/mas) for more info.

{% code overflow="wrap" %}

```bash
brew install mas
```

{% endcode %}

### Find app

```
mas search upnote

1398373917  UpNote: notes, diary, journal  (9.5.2)
1312926037  stoic. journal & mental health (2024.27)
1566998257  UpNote Web Clipper             (1.2.1)
```

### Get app info&#x20;

{% code overflow="wrap" %}

```bash
mas info 1398373917

UpNote: notes, diary, journal 9.5.2 [0.0]
By: UpNote Company Limited
```

{% endcode %}

### Install app

```
mas install 1398373917
```

### List installed apps

{% code overflow="wrap" %}

```bash
mas list

1352778147  Bitwarden  (2024.6.4)
1398373917  UpNote     (9.5.2)
```

{% endcode %}

***

## Brew Bundles & Brewfiles

A Brew Bundle is a Brewfile containing all of the apps you wish to install — including apps installed via the Mac App Store (if `mas` was used) and even VS Code extensions!&#x20;

This is super useful when reimaging or moving to another system.&#x20;

### Generate Brewfile

This creates the `Brewfile` within the current directory.

{% code overflow="wrap" %}

```bash
brew bundle dump
```

{% endcode %}

### Install Bundle

This installs apps from `Brewfile`&#x20;

{% code overflow="wrap" %}

```bash
# uses Brewfile in the current directory
brew bundle install

# uses Brewfile stored elsewhere
brew bundle install --file /path/to/Brewfile
```

{% endcode %}


---

# 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.techwithtyler.dev/coding-and-cli-tooling/cli-tools/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.
