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 497799835

mas home <app-id> — Open the app's App Store page in a browser.

mas home 497799835

Install & Purchase

mas install <app-id> — Install an app by its ID.

mas install 497799835

mas install <id1> <id2> <id3> — Install multiple apps at once.

mas install 497799835 409183694 1295203466

mas purchase <app-id> — Purchase and install a free app (adds to your account).

mas purchase 409183694

Update

mas outdated — List all apps with available updates.

mas outdated

mas upgrade — Update all outdated apps.

mas upgrade

mas upgrade <app-id> — Update a specific app.

mas upgrade 497799835

List & Account

mas list — List all installed App Store apps with their IDs.

mas list

mas account — Show the currently signed-in Apple ID.

mas account

mas version — Show the mas version.

mas version

Common Patterns

mas list | grep -i '<name>' — Find the App ID of an installed app.

mas list | grep -i xcode

mas search '<query>' | head -5 — Quick search showing top 5 results.

mas search 'text editor' | head -5

mas install 497799835 && mas install 409183694 — Scripted install of multiple apps (e.g., Xcode + Keynote).

mas install 497799835 && mas install 409183694

mas 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

  • brew – package manager for macOS and Linux (CLI tools and graphical apps as casks)
  • winget – Microsoft's Windows package manager
  • apt – manage packages on Debian and Ubuntu