# Homebrew

## Installation

Most recent instructions on [brew.sh ](https://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 %}
