explaingit

mas-cli/mas

12,168SwiftAudience · developerComplexity · 1/5Setup · easy

TLDR

mas is a command-line tool for Mac that lets you install, update, and manage App Store apps from the terminal, making it easy to automate your entire Mac software setup with a single command.

Mindmap

mindmap
  root((mas))
    What it does
      Install App Store apps
      Update apps
      Uninstall apps
    Commands
      search
      install
      outdated
    Automation
      Homebrew Bundle
      Brewfile scripts
    Limits
      No new purchases
      Must be signed in
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Automate App Store app installation on a new Mac by listing all your apps in a Brewfile and running one command to install everything at once.

USE CASE 2

Check which of your App Store apps have updates available from the terminal without opening the App Store application.

USE CASE 3

Uninstall an App Store app from a shell script as part of a larger Mac configuration automation.

Tech stack

SwiftmacOS

Getting it running

Difficulty · easy Time to first run · 5min

You must already be signed in to the Mac App Store, mas can only install apps your Apple account has previously purchased, it cannot buy new paid apps.

No license information is provided in the explanation.

In plain English

mas is a small Mac utility that lets you control the Mac App Store from the terminal, the text-based command interface on your computer. Normally, installing or updating App Store apps requires you to open the App Store application and click through its interface. With mas, you can do the same things by typing short commands, which makes it practical to automate app installs as part of a larger setup process. Installing mas itself is a one-liner using Homebrew, a popular Mac package manager. Once installed, you get a set of commands: search finds apps by name, install puts them on your machine by their App Store ID number, update checks for and applies updates, outdated lists apps that have newer versions available, and uninstall removes apps. You can also look up details on any app, open its App Store page, or sign out of your Apple account from the command line. The tool was built for scripting and automation. A common use case is pairing mas with Homebrew Bundle, where a single text file called a Brewfile lists all the software you want on a Mac, and one command installs everything at once. This is popular for setting up a new Mac quickly or keeping multiple machines in sync. There are a few limits to be aware of. You cannot use mas to buy paid apps you have not already purchased through your Apple account. It can only install or reinstall apps that your account has previously obtained. Some commands also require you to be signed in to the App Store, and certain operations need administrator-level access on the computer. mas runs on macOS 13 and later. It works on both Intel and Apple Silicon Macs.

Copy-paste prompts

Prompt 1
Help me create a Brewfile that installs both Homebrew packages and my App Store apps using mas, so I can set up any new Mac in one command.
Prompt 2
Show me how to use mas in a shell script to install specific App Store apps by their numeric ID, and how to find an app's ID when I only know its name.
Prompt 3
My mas install command is failing with a sign-in or permissions error. What are the common causes and how do I fix each one?
Prompt 4
Write a weekly cron job that runs mas outdated and mas upgrade to keep all my App Store apps updated automatically.
Open on GitHub → Explain another repo

← mas-cli on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.