Mac App Store

ID

mas

Home page

https://github.com/mas-cli/mas

Version requirement

>= 7

Platforms

🍎 macOS

Operations

installed · outdated · search · install · upgrade · upgrade_all · remove

purl types

pkg:mas

Brewfile entry

mas, in Brewfile backups

CLI name

mas

Issues and PRs

📦 manager: mas

Source

meta_package_manager/managers/mas.py

mas drives the Mac App Store from the command line.

Packages are Mac App Store applications, keyed by the numeric adamID Apple assigns each title (the id in an App Store link). mpm reads and writes that ID; the display name rides along only as a label.

Every query reads --json output, the supported programmatic interface since the >=7.0.0 floor added --json to list, outdated and search. It sidesteps the column-alignment ambiguities of the tabular listing, where an app name carrying parentheses or padding whitespace would derail a positional parser.

Note

mas prints one JSON object per app, concatenated rather than wrapped in an array, and leaves control characters (embedded newlines, U+2028) unescaped inside name and description strings (mas-cli/mas#1248). mpm decodes the buffer one object at a time with strict=False so each object ends at its own closing brace instead of splitting on those bytes. The bug is fixed upstream for the (still unreleased) 7.1.0, so this workaround can be retired once the requirement floor rises to >=7.1.0.

Note

mas self-escalates: it asks for root itself when a store mutation needs it, so mpm never wraps install, upgrade or uninstall in its own sudo.

What mpm adds to mas

Through mpm, mas gains --exact and --extended search, to narrow to exact names or match descriptions.

Bigger still, mpm reaches across every manager at once: mpm installed and mpm outdated cover mas alongside every other manager you run in one table, mpm upgrade --all updates them together, and mpm sbom exports the whole machine as one bill of materials.

Every mpm command also gains --dry-run and --plan previews, cross-scheme version comparison and purl identifiers. See manager augmentations for how each one is built.

Your mas commands, in mpm

You already know mas: each operation maps one-to-one onto mpm, in an interface shared by every manager.

To…

With mas

With mpm

List what’s installed

mas list --json

mpm --mas installed

List outdated packages

mas outdated --json

mpm --mas outdated

Search for a package

mas search python --json

mpm --mas search python

Install a package

mas install 945397020

mpm install pkg:mas/945397020

Upgrade one package

mas upgrade 945397020

mpm --mas upgrade 945397020

Upgrade everything

mas upgrade

mpm --mas upgrade --all

Remove a package

mas uninstall 1494051017

mpm remove pkg:mas/1494051017

Prefix any command above with --dry-run to simulate the underlying manager calls without touching the system: the safe way to watch what mpm would do before trusting it.

Operations

Operation

Supported

Notes

installed

outdated

orphans

search

exact and extended search backfilled by mpm

install

upgrade

upgrade_all

remove

sync

cleanup

doctor

Selecting and configuring mas

Deselect mas for a single run with --no-mas, or persist the choice in your configuration:

[mpm]
mas = false

Keep it enabled but tune how mpm drives it with a per-manager override:

[mpm.managers.mas]
timeout = 900

mpm config-template mas prints every overridable attribute as a ready-to-paste block.

Recipes

A few jobs you would otherwise script around mas, one mpm command each:

  • Snapshot and clone a machine: mpm --mas dump mas.toml, then mpm restore mas.toml on the next one.

  • Export a Brewfile entry instead: mpm --mas dump --brewfile Brewfile.

  • Export a compliance SBOM: mpm --mas sbom (CycloneDX by default, --spdx for SPDX).

Privilege escalation

mpm runs this manager as the current user and never prepends sudo by default. Flip the policy for its privileged operations with --sudo or the per-manager sudo override.

See privilege escalation for the full policy.

Cooldown

State of Mac App Store’s release-age gating, from the cooldown support table:

Status: ❌ None

A cooldown only pays off where a compromised release can be withdrawn while the clock runs, and can only be emulated where the registry dates its releases. From the retraction table:

Registry: Curated app stores and archives

With --cooldown set, mpm skips this manager’s install and upgrade operations rather than run them unguarded (fail-closed); --allow-unsupported-managers opts back in.

Version probe

The version is extracted from the output of mas version with:

r"(?P<version>\S+)"

Reference traces

Raw native outputs captured in the manager source: the reference mpm’s parsers were written against. If you know Mac App Store well and a transcript below looks wrong, or a newer release changed its output format, report it.

$ mas list --json
{"adamID":1569813296,"bundleID":"com.1password.1password-safari","name":"1Password for Safari","version":"2.3.5"}
{"adamID":1295203466,"bundleID":"com.microsoft.rdc.macos","name":"Microsoft Remote Desktop","version":"10.7.6"}
{"adamID":409183694,"bundleID":"com.apple.iWork.Keynote","name":"Keynote","version":"12.0"}
$ mas outdated --json
{"adamID":409183694,"name":"Keynote","newVersion":"12.0","version":"11.0"}
{"adamID":1176895641,"name":"Spark","newVersion":"2.11.21","version":"2.11.20"}

Feed any of these through mpm and the raw output becomes one uniform table, the same shape for every manager: filter it, project columns, or export it (mpm --mas installed --output json, or csv, toml, yaml), each package carrying a purl and a version comparable across managers.

Changelog

  • 6.5.0 (2026-05-25)

    • Bump minimum required mas version from 1.8.7 to 7.0.0, switch installed, outdated, and search to parse --json output, update homepage_url to https://github.com/mas-cli/mas, and drop the explicit sudo wrapper around mas uninstall.

  • 5.19.0 (2024-11-14)

    • Implement remove operation.

    • Bump minimal requirement to 1.8.7.

    • Reactivate mas tests.

  • 5.3.0 (2022-06-25)

    • Fix parsing of variable-length output in installed and outdated operations.

  • 3.1.0 (2020-04-02)

    • Retrieve version in search results.

    • Bump minimal version to 1.6.1.

  • 2.4.0 (2017-01-28)

    • Fix upgrade of mas packages. Closes #32.

  • 1.10.0 (2016-10-04)

    • Let mas report its own version.

    • Bump minimal requirement of mas to 1.3.1.

    • Fetch currently installed version from mas. Closes #4.

    • Fix parsing of mas package versions after the 1.3.1 release.

  • 1.5.0 (2016-07-25)

    • Add support for mas.