# 使用 Homebrew, MacPorts, Nix 安装 mas

查看 mas 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:mas
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install mas
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install mas
```

  证据: MacPorts ports tree: sysutils/mas/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#mas
```

  证据: nixpkgs package indexes: pkgs/by-name/ma/mas/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## 软件包事实

- **软件包键:** brew:mas
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/mas>
- **版本:** 7.0.0
- **来源摘要:** Mac App Store command-line interface
- **主页:** <https://github.com/mas-cli/mas>
- **仓库:** <https://github.com/mas-cli/mas>
- **许可证:** MIT
- **源码归档:** <https://github.com/mas-cli/mas.git>
- **最后更新:** 2026-06-09T11:09:24+02:00
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- mas (cli)
- mas (别名)

## macOS 提供的库

- jq

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 7.0.0
- 管理器更新时间: 2026-06-09
- 本地数据: OK
- 上游仓库: https://github.com/mas-cli/mas
- 信息: No cached GitHub release or tag data was available.
## 项目历史与用法

mas is a macOS command-line interface for the Mac App Store, designed for scripting and automation. It gives package-manager users a way to search, list, install, update, and inspect App Store apps from shell scripts and Brewfiles.

### 项目历史

The mas repository was created in August 2015, and v1.0.0 was released in September 2015 as the initial public release. Early releases quickly added app upgrade and App Store sign-in/sign-out commands, establishing the project's role as a bridge between command-line workflows and Apple's GUI-oriented app distribution system.

The project matured into a Swift-based macOS utility with a man page, `mas --help`, GitHub wiki documentation, and a command table in the README. Recent releases continue to track App Store behavior and macOS compatibility changes; the v6 series improved minimum-OS handling for outdated checks, and GitHub listed v7.0.0 as the latest release in May 2026 with optional JSON output and tabular output improvements.

### 采用历史

mas became especially prominent in the Homebrew ecosystem because Homebrew Bundle can include Mac App Store applications in a Brewfile. The official README lists Homebrew Core, the mas tap, MacPorts, and GitHub Releases as installation routes, while the supplied package metadata also records Nix packaging.

With more than twelve thousand GitHub stars, mas is one of the better-known macOS-specific CLI tools. Its adoption reflects a common need among dotfile, laptop-bootstrap, and managed-Mac users: keeping App Store software in the same declarative or scripted workflow as Homebrew packages.

### 使用方式

Common commands include `search`, `lookup`, `list`, `outdated`, `get`, `install`, `lucky`, `update`, `uninstall`, `open`, and `home`. The README notes that detailed command documentation is available through `man mas` and `mas --help`.

The CLI depends on macOS and App Store behavior rather than a portable service API. Its README documents practical constraints such as App Store eventual consistency, Spotlight indexing requirements, free-app installation behavior, and the need to purchase paid apps directly in the App Store.

### 为什么软件包爱好者会关心

mas is package-nerd glue: it does not replace Homebrew, but it fills the Mac App Store gap that Homebrew intentionally leaves alone. In Brewfiles, it lets a machine rebuild include both Unix packages and GUI App Store apps.

It is also a useful reminder that package management on macOS is plural. Homebrew, MacPorts, Apple's App Store, and system update mechanisms all own different slices, and mas gives one of those slices a scriptable face.

### 时间线

- 2015: GitHub repository created.
- 2015: v1.0.0 initial release.
- 2016: v1.1.0 adds sign-in and sign-out commands.
- 2026: v7.0.0 released with optional JSON output and improved tabular spacing.

### Related projects

- mas is commonly paired with Homebrew Bundle for Brewfile-based Mac provisioning.
- It is related to macOS automation tools and update orchestrators such as Topgrade, both of which can call into system package managers.

### 来源

- <https://api.github.com/repos/mas-cli/mas>
- <https://github.com/mas-cli/mas>
- <https://github.com/mas-cli/mas/releases?page=6>
- <https://github.com/mas-cli/mas/wiki>
- source_facts.package-manager-url


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals

## 源数据库详情

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** mas
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Requirements:** macos, xcode
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## 其他软件包管理器记录

- Nix - mas: normalized package name match | nixpkgs package indexes: pkgs/by-name/ma/mas/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- MacPorts - mas: normalized package name match | MacPorts ports tree: sysutils/mas/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## 相关链接

- [Source-control packages](https://pkg.so/zh-hans/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://pkg.so/zh-hans/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Networking and protocol packages](https://pkg.so/zh-hans/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [Package ecosystem packages](https://pkg.so/zh-hans/package-ecosystem-tools/) - Matched package manager, installer, dependency, registry, or publishing metadata.
- [mole](https://pkg.so/zh-hans/brew/mole/) - Shares pkgdb curated category or tags: cli, macos, system.
- [osx-cpu-temp](https://pkg.so/zh-hans/brew/osx-cpu-temp/) - Shares pkgdb curated category or tags: cli, macos, system.
- [sleepwatcher](https://pkg.so/zh-hans/brew/sleepwatcher/) - Shares pkgdb curated category or tags: cli, macos, system.
- [fileicon](https://pkg.so/zh-hans/brew/fileicon/) - Shares pkgdb curated category or tags: cli, macos, system.
- [m-cli](https://pkg.so/zh-hans/brew/m-cli/) - Shares pkgdb curated category or tags: cli, macos, system.
- [reattach-to-user-namespace](https://pkg.so/zh-hans/brew/reattach-to-user-namespace/) - Shares pkgdb curated category or tags: cli, macos, system.
- [mist-cli](https://pkg.so/zh-hans/brew/mist-cli/) - Shares pkgdb curated category or tags: cli, macos, system.
- [defaultbrowser](https://pkg.so/zh-hans/brew/defaultbrowser/) - Shares pkgdb curated category or tags: cli, macos, system.
- [dark-mode](https://pkg.so/zh-hans/brew/dark-mode/) - Local package facts share a topical domain. Shared terms: cli, command-line, line, macos, system.

## Combined YAML source

View the package source record on GitHub. [combined/mas.yml](https://github.com/mxcl/pkgdb/blob/main/combined/mas.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- pkgdb category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
