# 使用 Homebrew, apt, Nix, scoop, winget 安装 chroma

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

## 安装

```sh
sudo av install brew:chroma
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install chroma
```

  证据: local Homebrew formula metadata

### Linux

- Debian apt (92%):

```sh
sudo apt install chroma
```

  证据: Debian stable package indexes: chroma from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- Nix (92%):

```sh
nix profile install nixpkgs#chroma
```

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

### Windows

- Scoop (92%):

```sh
scoop install main/chroma
```

  证据: Scoop official bucket manifest trees: bucket/chroma.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

- winget (92%):

```sh
winget install --id Ubisoft.Chroma -e
```

  证据: Windows Package Manager source index: Ubisoft.Chroma from https://cdn.winget.microsoft.com/cache/source.msix

## 软件包事实

- **软件包键:** brew:chroma
- **软件包管理器:** Homebrew
- **版本:** 2.27.0
- **来源摘要:** General purpose syntax highlighter in pure Go
- **主页:** <https://github.com/alecthomas/chroma>
- **仓库:** <https://github.com/alecthomas/chroma>
- **最后更新:** 2026-07-25T14:20:49-04:00
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- chroma (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

Chroma is a pure-Go general-purpose syntax highlighter, usable both as a Go library and as the `chroma` command-line tool.

### 项目历史

The GitHub repository was created in June 2017. The README describes Chroma as converting source code and structured text into highlighted HTML, ANSI-colored text, and other output, with lexers, formatters, and styles modeled heavily on Pygments.

The project published v0.1.0 in September 2017, v2.0.0 in May 2022, and continued a fast v2 release line through 2026, with v3 alpha releases introducing Go iterator changes and a new module path.

### 采用历史

Chroma's adoption is partly library-driven: it has Go package documentation, a playground, and a CLI, while static-site and documentation tooling can embed it to avoid a Python/Pygments runtime. Homebrew packages the CLI and reports stable version 2.27.0.

The supplied package-manager facts list Homebrew, Debian, Ubuntu, Nix, and Scoop packages, showing distribution beyond the Go module ecosystem.

### 使用方式

Library users select a lexer, formatter, and style, or use the `quick.Highlight` helper. CLI users can run `chroma` directly and inspect available lexers with `chroma --list`.

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

Chroma is package-nerd interesting because it made Pygments-style highlighting available as a native Go dependency and standalone binary. That matters for self-contained Go programs, static-site generators, and container images that want syntax highlighting without a Python toolchain.

### 时间线

- 2017: Repository created and v0.1.0 release published.
- 2022: v2.0.0 release published.
- 2025: v2 line continues with frequent releases through v2.20.0.
- 2026: v2.27.0 and v3.0.0-alpha releases published.

### Related projects

- Pygments is the explicit design ancestor; the README says Chroma is based heavily on it and includes translators for Pygments lexers and styles. Related surfaces include Go package documentation, the Chroma playground, and the `pygments2chroma_xml.py` conversion script.

### 来源

- <https://github.com/alecthomas/chroma#readme>
- <https://github.com/alecthomas/chroma/releases>
- <https://pkg.go.dev/github.com/alecthomas/chroma/v3>
- <https://formulae.brew.sh/api/formula/chroma.json>


## 安全说明

narrow executable package without higher-risk signals.

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

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

- Debian apt - chroma - 1.19-2: normalized package name match | Debian stable package indexes: chroma from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Abstract puzzle game - graphical version | http://level7.org.uk/chroma/
- Debian apt - chroma-curses - 1.19-2: normalized package name match | Debian stable package indexes: chroma-curses from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Abstract puzzle game - terminal version | http://level7.org.uk/chroma/
- Debian apt - chroma-data - 1.19-2: normalized package name match | Debian stable package indexes: chroma-data from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Abstract puzzle game - data files | http://level7.org.uk/chroma/
- Nix - chroma: normalized package name match | nixpkgs package indexes: pkgs/by-name/ch/chroma/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - chroma - 1.19-1ubuntu1: normalized package name match | Ubuntu 24.04 LTS package indexes: chroma from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Abstract puzzle game - graphical version | http://level7.org.uk/chroma/
- Ubuntu apt - chroma-curses - 1.19-1ubuntu1: normalized package name match | Ubuntu 24.04 LTS package indexes: chroma-curses from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Abstract puzzle game - terminal version | http://level7.org.uk/chroma/
- Ubuntu apt - chroma-data - 1.19-1ubuntu1: normalized package name match | Ubuntu 24.04 LTS package indexes: chroma-data from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Abstract puzzle game - data files | http://level7.org.uk/chroma/
- Scoop - main/chroma: normalized package name match | Scoop official bucket manifest trees: bucket/chroma.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1
- winget - Ubisoft.Chroma: normalized package name match | Windows Package Manager source index: Ubisoft.Chroma from https://cdn.winget.microsoft.com/cache/source.msix


## Combined YAML source

View the package source record on GitHub. [combined/chroma.yml](https://github.com/mxcl/pkgdb/blob/main/combined/chroma.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
