I use the Windows Package Manager (winget) to automate app installs on Windows, but I’ve got a MacBook Air M3 on the way. And while I knew there were various package managers available for that platform, I wasn’t familiar with any of them and was curious if any would support the Mac App Store in the same way that winget supports the Microsoft Store.
It’s still early days (for me). And let’s get real here, it’s not like I’m going to spend as much time on this as I have on winget. But I did hope to perhaps cobble something together before the MacBook Air arrives early next week. So here’s what I’ve found out, and done, so far.
As I vaguely but correctly understood, there are indeed various package managers out there for the Mac, though none are built-in, as with winget in Windows. But one really stood out: Homebrew is routinely cited as the top package manager for macOS, but it also has two added benefits: It works with Linux, too, and it supports the Mac App Store via the mas formula (a package definition).
A quick digression: Homebrew unfortunately uses beer-based terminology well past the point of common sense, so the main command line utility is called brew and it only installs single file command line applications by default. But Homebrew is also extensible via so-called formulae, an archaic plural form of formula—what Americans would call formulas—and you use a special kind of formula, called a cask—yes, the language is tedious—to install more complex native Mac GUI apps.
The mas formula—its name stands for Mac App Store, which is retroactively obvious—has one curious limitation: You can’t use it to install a Mac App Store app until you’ve already installed that app from the Mac App Store using the same Apple ID sign-in. In other words, once you’ve installed an app from the Store on one Mac, or in some previous install on the same Mac, you can then use Homebrew and mas to later automate the install of that app.
Like winget, Homebrew/mas doesn’t really support a simple or sophisticated conditional install in which you (or a script) check for the availability of an app in the Store first and then install it from the web—via a repository—if it can’t find it there. So I ended up doing what I did with winget, which is researching which apps are available where and then building app install lists for each source. (On Windows, I very specifically want to install as many apps as possible from the Microsoft Store, and I am doing the same on the Mac though my reasons are less well-defined.)
From a prerequisites standpoint, all you really need is to know (or be able to find) is the command line that installs Homebrew: This is done via the macOS Terminal app, and you’ll be asked to supply your sign-in password as this operation requires elevated permissions. If you didn’t already install Xcode from the Mac App Store, the Homebrew installer will install the Xcode command line tools as part of the process too.
/bin/bash -c %22$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)%22
(You can download a graphical Homebrew installer from GitHub instead, but since I was going to be working in the command line for this, I wanted to get used to that.)
At the conclusion of the Homebrew install script, you’re prompted to run two further commands to add Homebrew to your PATH, so I did as instructed. Then, I installed mas with the following command line:
brew install mas
With that done, I had everything I needed to install Mac apps via the web (Homebrew casks) or the Store (mas), so the next step was to figure out what I had, search for what apps are available where, and then create a list of the apps I would like to batch install.
You can use the following commands to see which web and Mac App Store apps are already installed on the system, respectively:
brew list
mas list

Finding apps is a bit more complex. Homebrew supports several thousand native Mac apps casks, each of which is installed using a specific name, and mas supports whatever number of Mac App Store apps, each of which is installed using a—wait for it—product identifier, which is a 9- or 10-digit number. (This mirrors how winget uses names for apps from its own repository and alphanumeric strings for Store apps.)
Put simply, you just need to search. Homebrew and mas both support this in a similar fashion, but the mas results are a bit more verbose than seems necessart (and I found myself first searching the actual Mac App Store to see what was there in many cases).
For example, to see which Microsoft apps were in the Mac App Store, I tried this:
mas search “microsoft”

This generated a long list, but the first several were clearly Microsoft apps (as were a few others). So I used this command to install Microsoft Word (and immediately wished I could just install Word and not the rest of Office on Windows too).
mas install 462054704
Homebrew search works similarly but is more concise. I first tried this to find Visual Studio Code:
brew search visualstudio

Given the results, I used the following to install it:
brew install visual-studio-code
You get the idea.
Examining the current version of my winget bulk app installer script, which is newer than the version discussed in Improving My Winget Bulk App Installer Script (Premium) and incorporates some reader feedback (plus a few recent app changes), I determined which apps were available and/or necessary on the Mac and then which source to use for each, and created a list I could later turn into an install script of sorts.
One interesting thing came out of this: I had a much higher success rate with the Microsoft Store in Windows 11 than I did with the Mac App Store: Of the 20-ish apps I wanted to install on the Mac, only 6 of them were in the Mac App Store. (Compared to 11 for the Microsoft Store.)
To create the script (and figure out how to run it later), I consulted the Homebrew documentation. There, I found that the brew command line supports a bundle subcommand that creates a script—a brewfile—of all your installed packages so you can save it and then bulk install those apps later.
brew bundle dump
Then I used Finder to locate the file it created in the root of my user folder. It looked like so:
tap “homebrew/bundle”
brew “git” brew “mas”
mas “Affinity Photo 2”, id: 1616822987
mas “Greenshot”, id: 1103915944
mas “Microsoft Word”, id: 462054704
mas “Pages”, id: 409201541
mas “Slack”, id: 803453959
This gave me the formatting I wanted to turn my list of apps into a script, though I learned through trial and error that I needed to use cask and not brew for most of the non-Store app installs.

Then, on a new (or existing) Mac install, you install Homebrew and mas normally and run this script like so:
brew bundle install –file /path/to/Brewfile
I tested this on my current Mac, and it mostly worked. (The git entry separated shown above is a work in progress; that’s a formula, not a cask.) There are a few rough spots, but given how infrequently I’ll need this, I’m not going to lose too much sleep over it. That said, I may wipe out this Mac and then try it on a clean install before the MacBook Air arrives (at which point, I’ll be wiping the old Mac again for the trade-in).
And, of course, I will adapt this further for Linux. That should be easier in some ways—there’s no Mac App Store to worry about—but also less complete because some apps, including key apps like Google Drive, are not available on that platform.
More on that work soon.
With technology shaping our everyday lives, how could we not dig deeper?
Thurrott Premium delivers an honest and thorough perspective about the technologies we use and rely on everyday. Discover deeper content as a Premium member.