mas: Finally, a CLI for the Mac App Store
If you’ve ever tried to automate Mac App Store updates, installs, or searches from your terminal, you know the pain. There’s no official Apple command-line tool for it. The Store is a GUI-first world, which is frustrating for anyone managing multiple machines, writing setup scripts, or just preferring the keyboard.
Enter mas. It’s a simple, open-source command-line tool that wraps the Mac App Store’s private API. It lets you do exactly what you’d expect: search, install, update, and list apps, all from a terminal.
What It Does
mas (short for "Mac App Store") is a single binary you install via Homebrew or build from source. Once set up, you can run commands like:
mas search slack
mas install 803453959
mas upgrade
mas list
It handles authentication with your Apple ID through the system’s StoreKit framework, so you don’t need to pass any credentials around. It’s basically the apt or brew equivalent for the App Store.
Why It’s Cool
The real power of mas isn’t just convenience. It’s scriptability.
- Setup scripts for new machines: You can keep a
Brewfileor a plain shell script that installs all your Mac-only apps (Xcode, Pixelmator, etc.) in one go. - CI/CD workflows: Need to ensure a build machine has a specific version of a Mas app?
mascan pin versions. - No more poking around the GUI: You can upgrade everything with
mas upgradeand never see the red notification badge again.
It’s also surprisingly fast. The underlying Store API can be flaky, but mas handles retries and error messages cleanly. And because it’s open source (MIT license), you can even dig into how it talks to Apple’s backend.
One clever detail: mas uses the app’s numeric product identifier, not the name, for operations like install. That makes it deterministic. You can find an app’s ID via mas search or by checking its URL in the App Store (the number is in the URL).
How to Try It
If you have Homebrew, it’s one line:
brew install mas
Alternatively, grab a release binary from the GitHub releases page.
Once installed, sign into the Mac App Store (if you aren’t already), and you’re ready to go:
mas search "1Password"
mas list
mas upgrade
That’s it. No config files, no API keys.
Final Thoughts
mas is one of those tools that feels like it should already exist. It’s not flashy, it doesn’t try to do too much, and it solves a real, boring problem for developers and power users. If you ever touch the Mac App Store from a terminal script, or if you just hate clicking through update popups, give it a try. It’ll quietly become part of your toolkit.
Found this useful? Follow @githubprojects for more developer tools and open source discoveries.