Skip to content

Guide · Open source

How to use mas: install and manage Mac App Store apps from Terminal

Updated · written with AI from the project's own documentation and checked against our catalogue data

mas is an open-source command-line interface for the Mac App Store, designed for scripting and automation. This guide shows you how to install it, which commands cover the common tasks, and where its limits are. By the end you will be able to search the store, list installed apps, and check or update App Store apps from the Terminal.

masmas-cli/mas · ★ 12.4k · MIT

Quick start

  1. 1Install Homebrew. If you do not already have Homebrew, install it first. mas is installed through Homebrew in the simplest route.
  2. 2Install mas. Run brew install mas in Terminal. Use the Tap or MacPorts route if your macOS version or setup requires it.
  3. 3Check the install. Run mas version to confirm the command works.
  4. 4Find an app ID. Use mas search with a term to find the app and its numeric ID.
  5. 5List installed apps. Run mas list to see the apps already on the Mac.
  6. 6Check for updates. Run mas outdated to see which apps have updates available.
  7. 7Install or update. Use mas install with an ID, or mas update to update outdated apps.

Install mas on macOS

The simplest route is Homebrew Core. If you already have Homebrew installed, run the command below in Terminal. The README marks macOS 14 or newer as recommended for this route; the Homebrew Tap route supports macOS 13 and newer.

MacPorts is another option if you use it instead of Homebrew. Nix is also listed in the README with macOS 14 or newer. You can also download installers or source archives from the GitHub Releases page.

  • Homebrew Core: brew install mas (macOS 14+ recommended)
  • Homebrew Tap: brew install mas-cli/tap/mas (macOS 13+)
  • MacPorts: sudo port install mas (macOS 13+)
  • Nix: nix-shell -p mas (macOS 14+)
brew install mas

See the commands mas supports

mas has a set of subcommands. Run man mas or mas --help for the full documentation. The most common ones are listed below with what they do.

  • search <term>: search for App Store apps
  • lookup <id>: output App Store app details (alias: info)
  • list: output installed apps
  • outdated: output outdated apps
  • install <id>: install gotten or purchased apps
  • update: update outdated apps (alias: upgrade)
  • uninstall <id> or --all: uninstall apps
  • config: output config
  • version: output version
mas --help

Search, list and check for updates

Use search to find an app by name and list to see what is already installed. The outdated command shows which installed apps have updates waiting. Output from several commands can be produced as JSON, which is useful when a script needs to read it.

The README notes that outdated --accurate uses an App Store account requirement, so check the account notes in the README before relying on that flag.

mas search "photo editor" mas list mas outdated

Install and update apps

Install apps with get or install, using the numeric app ID. The lucky command installs the first app that matches a search term. update installs available updates for App Store apps. Some commands need root privileges or an App Store account, as the command table in the README indicates.

Find an app's ID with search or lookup first. Then pass that ID to the install command.

  • get <id>: get free apps and install any apps
  • install <id>: install apps you already got or purchased
  • lucky <term>: install the first matching app
  • update [<id>]: update outdated apps
mas lookup <id> mas install <id>

Use mas in scripts for repeatable setups

mas is built for automation. A setup script can install the same list of apps on each new Mac, which is the main use the README describes. Keep your list of app IDs in a file under version control so every Mac gets the same apps.

Because mas is a Terminal tool, it is best combined with other command-line workflows, such as Homebrew, rather than replacing the App Store window.

  • Store app IDs in a text file and loop over it in your script
  • Run mas outdated in a scheduled check before updating
  • Combine with Homebrew for a single setup workflow

What people use it for

  • Scripting a new Mac setup with a fixed list of App Store apps
  • Keeping several Macs in sync with the same set of apps
  • Checking which App Store apps need updates from the Terminal
  • Installing apps as part of a Homebrew-based workflow

Frequently asked questions

How do I install mas?

The README gives brew install mas for Homebrew Core, and sudo port install mas for MacPorts. Installers and source archives are on the GitHub Releases page. Homebrew Core recommends macOS 14 or newer.

What macOS version does mas need?

The README lists support for macOS 13 and newer. The Homebrew Core route is marked as macOS 14+ recommended, so check the table in the README for the route you choose.

Is mas free?

mas is released under the MIT licence, according to the project's licence information. The README's notes on paid apps are only partly covered in the source used for this guide, so check the README for details on buying apps.

Can mas install paid apps?

The command table lists get as the way to get free apps, and install for gotten or purchased apps. The README's paid-app and account notes are not fully covered here, so read the linked sections in the README before relying on it for purchases.

Do I need an Apple Account to use mas?

Several commands, such as get, install, update and outdated --accurate, link to App Store account requirements in the README. Read those sections to see what each command needs.

What are alternatives to mas?

The project lists Homebrew Cask as a comparable tool. Homebrew Cask manages many non-App Store apps from the Terminal, so it can complement mas rather than replace it.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

mas suits developers and people who manage several Macs and want App Store apps installed, listed and updated from scripts or the Terminal. If you only want a graphical App Store experience, or you need to buy paid apps from the command line and have not checked the README's account notes, pick another approach.

Install options & downloads