cut v0.52.1
[Homebrew/homebrew-cask-versions.git] / USAGE.md
bloba457e5201159570b0e2809e52117b9a0a62cbf9f
1 # How to Use Homebrew-cask
3 ## Getting Started
5 First ensure you have Homebrew version '0.9.5' or higher:
7 ```bash
8 $ brew --version
9 0.9.5
10 ```
12 Install the homebrew-cask tool:
14 ```bash
15 $ brew install caskroom/cask/brew-cask
16 ```
18 ## Frequently Used Commands
20 Homebrew-cask is implemented as a subcommand of Homebrew.  All homebrew-cask
21 commands begin with `brew cask`.  Homebrew-cask has its own set of command
22 verbs many of which are similar to Homebrew's.  The most frequently-used
23 commands are:
25 * `search` -- searches all known Casks
26 * `install` -- installs the given Cask
27 * `uninstall` -- uninstalls the given Cask
29 ## Searching for Casks
31 The `brew cask search` command accepts a series of substring arguments,
32 and returns tokens representing matching Casks.  Let's see if there's a
33 Cask for Google Chrome:
35 ```bash
36 $ brew cask search chrome
37 google-chrome
38 ```
40 A `search` command with no search term will list all available Casks:
42 ```bash
43 $ brew cask search
44 # <list of all available Casks>
45 ```
47 ## Installing Casks
49 The command `brew cask install` accepts a Cask token as returned by `brew cask search`.
50 Let's try to install Google Chrome:
52 ```bash
53 $ brew cask install google-chrome
54 ==> Downloading https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg
55 ==> Success! google-chrome installed to /opt/homebrew-cask/Caskroom/google-chrome/stable-channel
56 ==> Linking Google Chrome.app to /Users/paulh/Applications/Google Chrome.app
57 ```
59 ## Uninstalling Casks
61 Easy peasy:
63 ```bash
64 $ brew cask uninstall google-chrome
65 ```
67 This will both uninstall the Cask and remove symlinks which were created in
68 `~/Applications`.
70 To uninstall all versions of a Cask, use `--force`:
72 ```bash
73 $ brew cask uninstall --force google-chrome
74 ```
76 Note that `uninstall --force` is currently imperfect.  See the man page for
77 more information.
79 ## Other Commands
81 * `info` -- displays information about the given Cask
82 * `list` -- with no args, lists installed Casks; given installed Casks, lists staged files
83 * `fetch` -- downloads Cask resources to local cache (with `--force`, re-download even if already cached)
84 * `doctor` -- checks for configuration issues
85 * `cleanup` -- cleans up cached downloads (with `--outdated`, only cleans old downloads)
86 * `home` -- opens the homepage of the given Cask; or with no arguments, the homebrew-cask project page
87 * `alfred` -- modifies Alfred's search scope to include installed Casks
88 * `update` -- a synonym for `brew update`
89 * `zap` -- try to remove *all* files associated with a Cask (including resources which may be shared with other applications)
91 The following commands are for Cask authors:
93 * `audit` -- verifies installability of Casks
94 * `cat` -- dumps the given Cask to the standard output
95 * `create` -- creates a Cask and opens it in an editor
96 * `edit` -- edits the given Cask
98 The following aliases and abbreviations are provided for convenience:
100 * `ls` -- `list`
101 * `-S` -- `search`
102 * `rm`, `remove` -- `uninstall`
103 * `up` -- `update`
104 * `dr` -- `doctor`
106 ## Inspecting Installed Casks
108 List all installed Casks
110 ```bash
111 $ brew cask list
112 adium          google-chrome     onepassword
115 Show details about a specific Cask:
117 ```bash
118 $ brew cask info caffeine
119 caffeine: 1.1.1
120 http://lightheadsw.com/caffeine/
121 Not installed
122 https://github.com/caskroom/homebrew-cask/blob/master/Casks/caffeine.rb
125 ## Updating/Upgrading Casks
127 Since the homebrew-cask repository is a Homebrew Tap, you'll pull down the latest
128 Casks every time you issue the regular Homebrew command `brew update`. Currently,
129 homebrew-cask cannot always detect if an Application has been updated. You
130 can force an update via the command `brew cask install --force`. We are working
131 on improving this.
133 It is generally safe to run updates from within an Application.
135 ## Updating/Upgrading the Homebrew-cask Tool
137 When a new version homebrew-cask is released, it will appear in the output of
138 `brew outdated` after running `brew update`.  You can upgrade it via the normal
139 Homebrew `brew upgrade` workflow:
140 ```bash
141 $ brew update && brew upgrade brew-cask && brew cleanup && brew cask cleanup
144 ## Additional Taps (optional)
146 The primary homebrew-cask Tap includes most of the Casks that a typical user will
147 be interested in. There are a few additional Taps where we store different kinds
148 of Casks.
150 | Tap name | description |
151 | -------- | ----------- |
152 | [caskroom/versions](https://github.com/caskroom/homebrew-versions)     | contains alternate versions of Casks (e.g. betas, nightly releases, old versions)
153 | [caskroom/fonts](https://github.com/caskroom/homebrew-fonts)           | contains Casks that install fonts, which are kept separate so we can educate users about the different licensing landscape around font installation/usage
154 | [caskroom/unofficial](https://github.com/caskroom/homebrew-unofficial) | contains Casks that install unofficial builds or forks
156 There are also [alternate Cask Taps](doc/alternate_cask_taps.md#alternate-cask-taps-maintained-by-users) maintained by users.
158 You can tap any of the above with a `brew tap` command:
160 ```bash
161 $ brew tap <tap_name>
164 after which, Casks from the new Tap will be available to `search` or `install` just like Casks from the main Tap.
165 `brew update` will automatically keep your new Tap up to date.
167 You may also specify a fully-qualified Cask token (which includes the Tap) for any `brew cask` command.  This will implicitly add the Tap if you have not previously added it with `brew tap`:
169 ```bash
170 $ brew cask install caskroom/fonts/font-symbola
173 ## Options
175 `brew cask` accepts a number of options:
177 * `--version`: print version and exit
178 * `--debug`: output debug information
179 * `--no-binaries`: skip symlinking executable binaries into `/usr/local/bin`
181 You can also modify the default installation locations used when issuing `brew cask install`:
183 * `--caskroom=/my/path` determines where the actual applications will be located.
184 Default is `/opt/homebrew-cask/Caskroom`
185 * `--appdir=/my/path` changes the path where the symlinks to the applications (above)
186 will be generated. This is commonly used to create the links in the _root_ Applications directory
187 instead of the _home_ Applications directory by specifying `--appdir=/Applications`. Default is `~/Applications`.
188 * `--prefpanedir=/my/path` changes the path for PreferencePane symlinks.
189 Default is `~/Library/PreferencePanes`
190 * `--qlplugindir=/my/path` changes the path for Quicklook Plugin symlinks.
191 Default is `~/Library/QuickLook`
192 * `--widgetdir=/my/path` changes the path for Dashboard Widget symlinks.
193 Default is `~/Library/Widgets`
194 * `--fontdir=/my/path` changes the path for Fonts symlinks.
195 Default is `~/Library/Fonts`
196 * `--binarydir=/my/path` changes the path for binary symlinks.
197 Default is `/usr/local/bin`
198 * `--input_methoddir=/my/path` changes the path for Input Methods symlinks.
199 Default is `~/Library/Input Methods`
200 * `--screen_saverdir=/my/path` changes the path for Screen Saver symlinks.
201 Default is `~/Library/Screen Savers`
204 To make these settings persistent, you might want to add the following line to your `.bash_profile` or `.zshenv`:
206 ```bash
207 # Specify your defaults in this environment variable
208 export HOMEBREW_CASK_OPTS="--appdir=/Applications --caskroom=/etc/Caskroom"
211 Note that you still can override the environment variable `HOMEBREW_CASK_OPTS` by _explicitly_ providing
212 options in the command line:
214 ```bash
215 # Will force the Chrome app to be linked to ~/Applications
216 # even though HOMEBREW_CASK_OPTS specified /Applications
217 $ brew cask install --appdir="~/Applications" google-chrome
220 ## Advanced searching
222 The default search algorithm is a lax substring approach, which does not
223 use the command-line arguments exactly as given.  If you need to specify
224 a search more precisely, a single search argument enclosed in `/` characters
225 will be taken as a Ruby regular expression:
227 ```bash
228 $ brew cask search '/^google.c[a-z]rome$/'
229 google-chrome
232 ## Other Ways to Specify a Cask
234 Most `brew cask` commands can accept a Cask token as an argument. As described
235 above, the token on the command line can take the form of:
237  * a token as returned by `brew cask search`, _eg_: `google-chrome`
238  * a fully-qualified token which includes the Tap, _eg_: `caskroom/fonts/font-symbola`
240 `brew cask` also accepts three other forms as arguments
242  * a path to a Cask file, _eg_: `/usr/local/Cellar/brew-cask/0.25.0/Casks/google-chrome.rb`
243  * a `curl`-retrievable URI to a Cask file, _eg_: `https://raw.github.com/caskroom/homebrew-cask/f54bbfaae0f2fa7210484f46313a459cb8a14d2f/Casks/google-chrome.rb`
244  * a file in the current working directory, _eg_: `my-modfied-google-chrome.rb`.  Note
245    that matching Tapped Cask tokens will be preferred over this form when there is a
246    conflict.  To force the use of a Cask file in the current directory, specify a
247    pathname with slashes, _eg_: `./google-chrome.rb`.
249 The last three forms are intended for users who wish to maintain private Casks.
251 ## Taps
253 You can add Casks to your existing (or new) Taps: just create a directory named
254 `Casks` inside your Tap, put your Cask files there, and everything will just work.
256 ## Alfred Integration
258 Many users combine Homebrew-cask with [Alfred 2](http://www.alfredapp.com/) to great effect. Just add
259 the Cask staging area to Alfred's "search scope" by either
261  * running `brew cask alfred link`, or
262  * manually adding `/opt/homebrew-cask/Caskroom` via Alfred's preferences GUI
264 Applications will then become available in Alfred immediately after a `brew
265 cask install`. Your fingertips will thank you.
267 Oh, and you can `brew cask install alfred` too! Not bad, eh?