Notes

Set up a new macOS machine with Homebrew-Cask

Edit on GitHub

Workflow
2 minutes

Cask let’s you install commonly used software, stuff that you would drag and drop to install, via the Terminal or a script. For example,

1brew cask install google-chrome

will install Google Chrome. While Homebrew let’s you install command line utilities, Cask let’s you install macOS desktop (GUI) software.

If you’re a developer, you can use cask to install your preferred browsers, code editors, tools and such with a simple script.

  • search — searches all known Casks
  • info — gets details about a particular Cask
  • install — installs the given Cask
  • uninstall — uninstalls the given Cask
  • brew cask uninstall --force - uninstall all versions of a Cask

Homebrew-Cask is a part of Hombrew version 0.9.5 and higher. It implemented as a subcommand of Homebrew. All Homebrew-Cask commands begin with brew cask

Caskroom is the equivalent of Cellar. It stores all the Casks installed.

 1
 2installCLT() {
 3	# Install Command Line Tools (CLT) for Xcode
 4	echo -e "/n Installing Command Line Tools (CLT) for Xcode"
 5	sudo xcode-select --install
 6}
 7
 8installHomebrew() {
 9	echo -e "/n Installing Homebrew"
10
11	# install Homebrew
12	/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
13	# update perms on /usr/local/ to avoid: Warning: /usr/local is not writable, sudo is needed
14	sudo chown -R $USER /usr/local/
15	# add /usr/local/bin (the path where Cellar is) to your $PATH
16	export $PATH=/usr/local/bin:$PATH
17
18	brew update
19}
20
21installKegs() {
22	# List all your Kegs/Formulae/Taps here
23	# These will be installed in: /usr/local/Cellar/
24
25	echo -e "/n Installing Kegs (Command Line Utilities)"
26	# Programming
27	brew install node mongodb sqlite
28
29	# Tools
30	brew install wget tree coreutils
31
32	# Install tab-completion for brew casks
33	brew install brew-cask-completion
34}
35
36installCasks() {
37	# List all your Casks here
38	# These will be installed in: /usr/local/Caskroom/
39	# More: https://github.com/caskroom/homebrew-cask/tree/master/Casks
40
41	echo -e "/n Installing Casks (GUI Software)"
42	# Browsers
43	brew cask install google-chrome opera
44
45	# Code Editors
46	brew cask install visual-studio-code sublime-text brackets
47
48	# Graphics
49	brew cask install sketch
50
51	# Tools
52	brew cask install alfred appcleaner caffeine dash discord evernote filezilla gitkraken gitter iterm2 postman shuttle skype teamviewer the-unarchiver vlc webtorrent
53}
54
55installCLT
56installHomebrew
57installKegs
58installCasks
59
60echo -e "/n DONE!"