# 使用 Homebrew, Nix 安装 m-cli

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

## 安装

```sh
sudo av install brew:m-cli
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install m-cli
```

  证据: local Homebrew formula metadata

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#m-cli
```

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

## 软件包事实

- **软件包键:** brew:m-cli
- **软件包管理器:** Homebrew
- **版本:** 2.0.9
- **来源摘要:** Swiss Army Knife for macOS
- **主页:** <https://github.com/rgcr/m-cli>
- **仓库:** <https://github.com/rgcr/m-cli>
- **最后更新:** 2026-06-02T20:02:01Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- m (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 2.0.9
## 项目历史与用法

m-cli is a shell-based macOS command-line utility that describes itself as a Swiss Army Knife for macOS in the terminal. It wraps many common system administration and preference tasks behind a single `m` command.

### 项目历史

The public GitHub repository was created in July 2016 and is maintained as a small Unix-style command suite. Its README emphasizes macOS-only system control, no third-party dependencies, a simple manual install path, and Homebrew installation.

The project underwent a notable 2.0 syntax change: the changelog records a move from positional plugin subcommands such as `m bluetooth on` to option-based forms such as `m bluetooth --enable`, alongside generated shell completions.

### 采用历史

m-cli has become a recognizable macOS package-manager utility: the repository shows thousands of GitHub stars and hundreds of forks, while the input package facts list both Homebrew and Nix packaging.

Its appeal is strongest among macOS users who prefer scriptable terminal access to system settings that are otherwise spread across System Settings, Apple tools, and small command-line utilities.

### 使用方式

Users install it with Homebrew as `brew install m-cli` or manually with the upstream install script, then run `m` to list commands or `m <command> --help` for command-specific usage.

The command set covers macOS areas such as AirDrop, Bluetooth, display, DNS, Dock, Finder, firewall, Gatekeeper, network, power, printers, services, users, VPN, volume, wallpaper, and Wi-Fi. Some commands need sudo privileges or macOS privacy permissions.

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

For package-maintainer audiences, m-cli is an example of a Homebrew-friendly macOS wrapper that packages many native system toggles as small shell plugins rather than as a daemon or GUI app.

The 2.x syntax shift matters because it changed scripting compatibility while making completions easier to keep in sync with plugin help output.

### 时间线

- 2016: Public GitHub repository created
- 2026: v2.0.9 released with restart and completion fixes
- 2026: GitHub repository metadata shows roughly 9.9k stars and 318 forks

### Related projects

- Homebrew packages m-cli for macOS users who want the stable packaged command.
- Nix also packages m-cli according to the supplied package-manager facts.
- The upstream README points users to related macOS command-line projects such as iproute-mac.

### 来源

- <https://api.github.com/repos/rgcr/m-cli>
- <https://github.com/rgcr/m-cli>
- <https://github.com/rgcr/m-cli/blob/main/CHANGELOG.md>
- source_facts.package-manager


## 安全说明

narrow executable package without higher-risk signals.

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

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

- Nix - m-cli: normalized package name match | nixpkgs package indexes: pkgs/by-name/m-/m-cli/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1


## Combined YAML source

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


## 来源

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