mas — Mac App Store Apps from the Command Line
Practical guide to mas: search, install, and update Mac App Store apps from the terminal — ideal for reproducible macOS setups alongside Homebrew.
mas is an unofficial command-line tool for the Mac App Store: it lets you search, install, and update App Store apps straight from the terminal, addressing each app by its numeric ID. That makes mas an ideal building block for reproducible macOS setups, for example alongside Homebrew in a provisioning script. Instead of clicking through each app by hand, you write them into a list once and install everything in a single run.
Search & Info
mas search '<query>' — Search the Mac App Store.
mas search 'Xcode'mas info <app-id> — Show detailed info about an app.
mas info 497799835mas home <app-id> — Open the app's App Store page in a browser.
mas home 497799835Install & Purchase
mas install <app-id> — Install an app by its ID.
mas install 497799835mas install <id1> <id2> <id3> — Install multiple apps at once.
mas install 497799835 409183694 1295203466mas purchase <app-id> — Purchase and install a free app (adds to your account).
mas purchase 409183694Update
mas outdated — List all apps with available updates.
mas outdatedmas upgrade — Update all outdated apps.
mas upgrademas upgrade <app-id> — Update a specific app.
mas upgrade 497799835List & Account
mas list — List all installed App Store apps with their IDs.
mas listmas account — Show the currently signed-in Apple ID.
mas accountmas version — Show the mas version.
mas versionCommon Patterns
mas list | grep -i '<name>' — Find the App ID of an installed app.
mas list | grep -i xcodemas search '<query>' | head -5 — Quick search showing top 5 results.
mas search 'text editor' | head -5mas install 497799835 && mas install 409183694 — Scripted install of multiple apps (e.g., Xcode + Keynote).
mas install 497799835 && mas install 409183694mas outdated | wc -l — Count how many apps need updates.
mas outdated | wc -l Conclusion
mas closes the gap Homebrew leaves on macOS: apps available only through the Mac App Store can be scripted just like Homebrew formulae and casks. Keep one thing in mind: mas install reliably downloads only apps that have already been "purchased" or downloaded once with your Apple ID — new apps therefore need to be associated with your account in the App Store first. Signing in itself can no longer be done reliably from the command line on recent macOS versions (mas signin is restricted); if in doubt, sign in manually in the App Store app, after which mas install and mas upgrade work as expected. This lets you combine a reproducible Brewfile with a mas app list into a nearly fully automated machine setup.
Further Reading
- mas-cli – GitHub project – source code, releases, and installation via Homebrew
- Mac App Store – Apple's official App Store page