# 使用 Homebrew, MacPorts, Nix 安装 sloth-cli

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

## 安装

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

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install sloth-cli
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install sloth
```

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

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#sloth
```

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

## 软件包事实

- **软件包键:** brew:sloth-cli
- **软件包管理器:** Homebrew
- **版本:** 0.16.0
- **来源摘要:** Prometheus SLO generator
- **主页:** <https://sloth.dev/>
- **仓库:** <https://github.com/slok/sloth>
- **最后更新:** 2026-07-26T04:03:41+02:00
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- sloth (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

Sloth is a Prometheus SLO generator distributed as the `sloth` CLI by the Homebrew `sloth-cli` formula. It turns service-level-objective specifications into Prometheus recording and alerting rules, including multi-window, multi-burn-rate alerting.

### 项目历史

The official repository describes Sloth as an easy way to generate Prometheus SLOs from a simple SLO spec. The GitHub repository was created in 2021, and the first GitHub release listed by the official API is v0.1.0 published on 2021-05-05.

The changelog shows the project growing from a focused CLI into a broader SLO toolchain: v0.10.0 added directory discovery for generated SLO files, v0.13.0 migrated rule generation to plugins, v0.15.0 exposed SLO generation as a Go library, and v0.16.0 added a server command and UI work.

### 采用历史

Sloth fits the GitOps and Kubernetes observability audience: the official CLI docs say the generate mode only needs the CLI, making it useful for CI, scripts, and toolboxes.

Homebrew, MacPorts, and Nix package mappings in the input facts show adoption across common developer package managers, and the Homebrew formula API reported 545 installs-on-request over 365 days for the batch's lookup window.

### 使用方式

The documented quick start is `sloth generate -i ./examples/getting-started.yml`, producing Prometheus rules from an SLO specification.

The official CLI usage page says `generate` supports multiple spec types, including the default Prometheus rules output and Kubernetes Prometheus-operator rules output.

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

Sloth matters to package-manager users because it packages SRE practice into a single CLI binary: SLO definitions can live in repositories and CI systems rather than only inside dashboards or vendor SaaS.

It is also a modern example of observability tooling being shipped through developer package managers so teams can pin, upgrade, and run it in local and automated workflows.

### 时间线

- 2021: GitHub repository created.
- 2021: v0.1.0 released on GitHub.
- 2022: v0.10.0 added directory discovery for CLI generation.
- 2025: v0.15.0 exposed Sloth SLO generation as a Go library.
- 2026: v0.16.0 added server/UI work and Kubernetes transformer plugins.

### Related projects

- Sloth is built around Prometheus, Prometheus Operator, Kubernetes, OpenSLO, and Google's SRE multi-window multi-burn-rate alerting guidance.
- The project also points users to `slok/sloth-common-sli-plugins` for common SLI plugins.

### 来源

- <https://formulae.brew.sh/api/formula/sloth-cli.json>
- <https://github.com/slok/sloth>
- <https://raw.githubusercontent.com/slok/sloth/main/CHANGELOG.md>
- <https://raw.githubusercontent.com/slok/sloth/main/README.md>
- <https://sloth.dev/introduction>
- <https://sloth.dev/usage/cli>
- source_facts.repo


## 安全说明

narrow executable package without higher-risk signals.

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

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

- MacPorts - sloth: installed executable or alias match | MacPorts ports tree: aqua/sloth/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Nix - sloth: installed executable or alias match | nixpkgs package indexes: pkgs/by-name/sl/sloth/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/sloth-cli.yml](https://github.com/mxcl/pkgdb/blob/main/combined/sloth-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
