mas
$ mas 社区开源 中风险mas(mas-cli/mas)为 macOS 上的 Mac App Store 提供简洁的命令行接口(mas list、mas search、mas info、mas install、mas upgrade)。常与 Homebrew Brewfile 搭配,用于非交互式盘点与更新 Mac App Store 应用。
brew install mas mas 直接调用本地 macOS StoreKit 与 App Store 守护进程来清点和更新 /Applications 下的应用,没有对应的 MCP 替代方案。
Agent 友好度体检单
当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。
FCRS-1.0 六维评分拆解
子命令(list、search、outdated、install、upgrade)便于脚本调用,但仅输出纯文本且无 --json,未登录 App Store 时安装会失败。
- No
--jsonoutput flag; fixed-width or line-based stdout - Headless execution fails on
installif macOS GUI App Store is signed out
只读命令安全且 install 依赖明确数字 ID,但缺少 --dry-run 且安装/更新继承桌面会话权限。
mas list,mas search, andmas outdatedprovide safe pre-flight inspection- No
--dry-runflag oninstallorupgrade
通过 brew install mas 安装,仅限 macOS 且依赖系统 App Store 框架。
- Strictly macOS-only and tied to local App Store daemon state
与 brew bundle 深度配合,是声明式配置 macOS 工作站的标准伴侣工具。
- Integrates directly with Homebrew
Brewfile(mas "Name", id: ...)
历史悠久的 MIT 社区工具(mas-cli/mas),持续适配新版 macOS StoreKit 变化。
- Open-source MIT repository at mas-cli/mas
仓库 README 与 --help 子命令说明简洁明了。
- Clear subcommand reference in repository README
安全边界、鉴权与放权指南
依赖 macOS 图形界面 App Store.app 当前登录的 Apple 账号会话;search 与 info 无需登录即可使用。
MIT 开源 CLI 免费;通过 mas install 安装付费应用会向当前登录的 Apple 账号扣费。
# mas Agent Rules - Run `mas outdated` or `mas list` before calling `mas upgrade`. - Confirm exact numeric App Store IDs via `mas search` before running `mas install <id>`. - Note that `mas install` requires an active GUI App Store sign-in on macOS.
Agent 高频安全命令配方
只读查询(安全推荐)
mas list
输出已安装 App Store 应用的 ID、名称与版本,用于审计或生成 Brewfile。
mas search Xcode
检索匹配的应用 ID 与标题,不触发任何安装操作。
受控写入与预演
mas upgrade
将已安装的 Mac App Store 应用更新到最新版本。
核心优势
- + 配合 Homebrew 轻量审计(
mas list、mas outdated)并自动化管理 Mac App Store 软件。 - + 基于明确数字应用 ID 安装,减少脚本执行歧义。
注意事项与踩坑点
- ! 仅限 macOS 使用,且缺少
--json结构化输出。 - !
mas install要求App Store.app已在 GUI 中登录,在纯无头虚拟机中可能受限。