New Mac? Clean macOS install? Run Setup and automate it all!
Get most of the tedious configurations, application installs, and other settings automatically configured on your Mac.
- Installs Homebrew
- Installs Xcode Developer Tools
- Installs necessary applications and tools
- Sets up environment (executables/tools (git, npm, etc), shells (defaults, prompts, etc), CLIs, and more)
- Additional environment configurations
- Updates macOS
Start with a Customizable Setup run.
Note
Cancel the auto run with Ctrl-C if you want to modify apps.txt, formulae.txt, casks.txt, and/or Brewfile.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/bretonics/Setup/HEAD/setup.sh)" "" -M -D -P -m devTip
See Customizable Setup for a better way to utilize a custom Setup and not use the exact configurations set as default (above command)
This install includes the entire app, formulae, and cask collection, including those in the essentials install type and all modes. This is more for something like a Mac mini.
See the default Brewfile.
This install includes a smaller subset of what I deem essential, must haves. It's intended more for a Macbook Pro where you don't need everything under the sun.
See the default Brewfile.
Secondary setup modifies personalized Mac settings, and is run after the initial install. It requires more attention as it may ask for credential or information input. It runs by default if running 'main' type. You must pass the -s option otherwise, or you can always run it directly bash ./secondary.sh.
Directories in ./src/mode separate other installation modes that can be run in addition to the 'main' or 'essentials' install chosen.
Each directory keeps track of individual programs (Apps, Formulae, and Casks) to install for the specific mode, via their own Brewfile, and includes an install.sh for all logic pertaining to the mode.
Available modes:
- dev
- fun
$ ./install.sh -h
Usage: install.sh [Options] Brewfile
Running install without any options below will run a MAIN setup by default.
Options:
-B Sync backups from latest Time Machine backup
-D Use defaults (skip confirmation when applying secondary settings)
-E Essentials only installations
-F Run full main install with defaults (Sets -B, -D, -P, and -s)
-M Main install type (-s=true)
-P Set Mac setting system preference defaults (Default: false)
-i [main|essentials] Explicit install type declaration, i.e. -M or -E)
-m <mode> Run additional specified mode installation (in ./src/mode)
-s Run secondary installation (Default: false)
-h Prints this usage message
Arguments:
Brewfile Path to Brew bundle file (Default: './src/Brewfile')Automatically download the setup scripts (this repo) and NOT start any setup process, allowing you to customize the setup before running it:
/bin/bash -c "DOWNLOAD_ONLY_SETUP=true $(curl -fsSL https://raw.githubusercontent.com/bretonics/Setup/HEAD/setup.sh)"Like everything you see? YOLO! Simply run:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/bretonics/Setup/HEAD/setup.sh)"You can also pass any of the available options:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/bretonics/Setup/HEAD/setup.sh)" "" -EI suggest using your own Brewfile instead. If you don't have one, see Useful Commands to create one before running Setup, and pass this to the program as followed (along with any other set of options):
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/bretonics/Setup/HEAD/setup.sh)" "" ~/absolute/path/to/Brewfile -MYou probably want to do this --unless you really like everything configured as I do (we both know you don't)--and don't have a Brewfile to run a customized setup.
You can automatically download the setup scripts (this repo) and NOT start any setup process, allowing you to customize the setup before running it:
/bin/bash -c "DOWNLOAD_ONLY_SETUP=true $(curl -fsSL https://raw.githubusercontent.com/bretonics/Setup/HEAD/setup.sh)"Otherwise, download the repo or fork it to do a custom install and modify the following:
-
Brewfile
- Modify the main
./src/Brewfileand runbash install, or pass your own:bash install /absolute/path/to/my/Brewfile. - Update any
modeBrewfilesif executing an additional-m <mode>
- Modify the main
-
Personalizations
-
Modify files containing list of apps and their respective Mac App Store product identifiers, formulae, and/or casks that you want installed in the src directory.
-
Run
bash install.sh -E -
Optional:
bash secondary.sh
-
# List all installed Mac apps
mas list | sort -fk 2
# Create Brewfile
brew bundle dump --describe
# List & Copy VS Code Extensions
code --list-extensions | pbcopyHave a particular set of configurations to add? Feel free to create a PR!
If there's a particular set of commands, applications, or utilities you find useful, add an additional install mode (-m myMode).
- Create a directory with the mode's name under
src, i.e.src/mymode(lowercase) - The entrypoint is set to
$MODE_INSTALL_FILE - A mode's entrypoint should be named
install.sh - A mode's logic should be called from this entrypoint
install.shshould be located in the named mode's directory, e.g.src/mymode- Any and all files related to a mode are to be contained in the mode's root directory, i.e.
src/mymode - You can use a
Brewfileto organize and handle all resource installations (called from a mode'sinstall.sh)[!NOTE] You can add individual text files for each set of
apps,formulae, and/orcasks(1 entry per line) and pass the file reference to these functions:installApps ${AppsFile}installFormulae ${FormulaeFile}installCasks ${CasksFile}
- It's encourage to mimic the root directory's structure, but it's not required
├── src/mymode
├── Brewfile
├── apps.txt # optional
├── casks.txt # optional
├── formulae.txt # optional
├── install.sh
├── npm.txt
└── vscode.txt