Mac App Store¶
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 (upstream bug). 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.
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.
Home page: https://github.com/mas-cli/mas
Version requirement:
>=7.0.0
Platforms¶
🍎 macOS
Operations¶
Operation |
Supported |
Notes |
|---|---|---|
|
✓ |
|
|
✓ |
|
|
✓ |
exact and extended search backfilled by |
|
✓ |
|
|
✓ |
|
|
✓ |
|
|
✓ |
|
|
||
|
Ecosystem¶
Accepted purl types:
pkg:masMaps to
masentries in Brewfile backups
Usage¶
$ mpm --mas installed
$ mpm --mas search "query"
$ mpm --mas upgrade --all
$ mpm install pkg:mas/hello
$ mpm --dry-run --mas upgrade --all
Every example above accepts --dry-run, which simulates the underlying manager calls without touching the system: the safe way to watch what mpm would do before trusting it.
Deselect the manager for a single run with --no-mas, disable it from your configuration, or tune its invocation attributes with per-manager overrides.
Command line¶
CLI names, in lookup order:
mas
The version is extracted from the output of mas version with:
r"(?P<version>\S+)"
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
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.
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"}