# 使用 Homebrew, apk, apt, dnf, MacPorts, Nix, pacman, zypper, scoop, winget 安装 tokei

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

## 安装

```sh
sudo av install brew:tokei
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install tokei
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install tokei
```

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

### Linux

- apk (92%):

```sh
sudo apk add tokei
```

  证据: Alpine Linux edge package indexes: tokei from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- Debian apt (92%):

```sh
sudo apt install tokei
```

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

- dnf (92%):

```sh
sudo dnf install tokei
```

  证据: Fedora Rawhide package metadata: tokei from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#tokei
```

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

- pacman (92%):

```sh
sudo pacman -S tokei
```

  证据: Arch Linux sync databases: tokei from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- zypper (92%):

```sh
sudo zypper install tokei
```

  证据: openSUSE Tumbleweed package metadata: tokei from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

### Windows

- Scoop (92%):

```sh
scoop install main/tokei
```

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

- winget (92%):

```sh
winget install --id XAMPPRocky.Tokei -e
```

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

## 软件包事实

- **软件包键:** brew:tokei
- **软件包管理器:** Homebrew
- **版本:** 14.0.0
- **来源摘要:** Program that allows you to count code, quickly
- **主页:** <https://github.com/XAMPPRocky/tokei>
- **仓库:** <https://github.com/XAMPPRocky/tokei>
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- tokei (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

Tokei is a Rust code-statistics tool that counts files, total lines, code, comments, and blanks by language, with both CLI and library use cases.

### 项目历史

The README positions Tokei as a fast and accurate counter for source trees, emphasizing multi-line and nested-comment handling, more than 150 supported languages, multiple machine-readable output formats, and use as a library.

Tokei's changelog follows Keep a Changelog and Semantic Versioning. Recent entries show continued maintenance through the 13.0.0 alpha series in 2024 and 2025, and a 14.0.0 release dated 2025-12-26 with additional language support such as C++20 modules, Ark TypeScript, and Koka.

### 采用历史

The upstream README lists package-manager installs across Unix, macOS, and Windows: apk, pacman, Cargo, conda-forge, dnf, FreeBSD pkg, NetBSD pkgin, Nix, zypper, Void, Homebrew, MacPorts, winget, and Scoop. The input facts independently list Homebrew, Debian, Fedora/DNF, MacPorts, Nix, Arch, Scoop, winget, and openSUSE.

The README also advertises crates.io, GitHub, Homebrew, Chocolatey, and Repology badges, reflecting the project's package-manager-centered distribution culture.

### 使用方式

Typical use is pointing tokei at one or more source directories to get a language-by-language table. It respects .gitignore, .ignore, and .tokeignore by default, can exclude paths, sort by statistics columns, print per-file counts, and emit JSON, YAML, or CBOR for downstream tools.

Because tokei can read prior output back in, it also supports workflows that snapshot code statistics and combine them with later runs.

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

Tokei is significant in the package-nerd niche because it is both a benchmarkable Rust CLI and a widely packaged developer utility. It is small enough to install casually, but broad enough to become a standard smoke-test tool for language detection, ignore-file behavior, terminal output, and package metadata across many ecosystems.

Its long package-manager list and machine-readable output make it useful for maintainers comparing source trees, release artifacts, vendored code, or language mix without bringing in a full analytics stack.

### 时间线

- Current: README documents support for Mac, Linux, and Windows, more than 150 languages, JSON/YAML/CBOR output, and library use.
- 2024-03-04: 13.0.0-alpha.1 changelog entry added maintenance and language-data updates.
- 2025-07-21: 13.0.0-alpha.9 changelog entry included Markdown CRLF and mixed-line-ending fixes.
- 2025-12-26: 14.0.0 changelog entry added C++20 modules and Ark TypeScript support.

### Related projects

- Tokei belongs to the same utility family as cloc and scc, though the cited upstream material emphasizes Tokei's own speed, accuracy, language coverage, and Rust library interface.
- Repology, Homebrew, Cargo, winget, Scoop, and distribution package managers are part of the adoption surface documented by the README and input facts.

### 来源

- <https://github.com/XAMPPRocky/tokei#readme>
- <https://github.com/XAMPPRocky/tokei/blob/master/CHANGELOG.md>
- source_facts.package-manager


## 安全说明

narrow executable package without higher-risk signals.

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

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

- Debian apt - tokei - 12.1.2-6+b1: normalized package name match | Debian stable package indexes: tokei from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | display statistics about your code | https://tokei.rs
- Nix - tokei: normalized package name match | nixpkgs package indexes: pkgs/by-name/to/tokei/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- apk - tokei - 14.0.0-r0: normalized package name match | Alpine Linux edge package indexes: tokei from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | A blazingly fast CLOC (Count Lines Of Code) program | https://github.com/XAMPPRocky/tokei
- dnf - tokei - 14.0.0-6.fc45: normalized package name match | Fedora Rawhide package metadata: tokei from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Count your code, quickly | https://crates.io/crates/tokei
- pacman - tokei - 14.0.0-1: normalized package name match | Arch Linux sync databases: tokei from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | A blazingly fast CLOC (Count Lines Of Code) program | https://github.com/XAMPPRocky/tokei
- zypper - tokei - 14.0.0+git0-1.3: normalized package name match | openSUSE Tumbleweed package metadata: tokei from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Code statistics commandline tool | https://github.com/XAMPPRocky/tokei
- MacPorts - tokei: normalized package name match | MacPorts ports tree: devel/tokei/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Scoop - main/tokei: normalized package name match | Scoop official bucket manifest trees: bucket/tokei.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1
- winget - XAMPPRocky.Tokei: normalized package name match | Windows Package Manager source index: XAMPPRocky.Tokei from https://cdn.winget.microsoft.com/cache/source.msix


## 相关链接

- [tokei](https://pkg.so/zh-hans/pkg/cargo/tokei/) - Same normalized package name exists in another local package ecosystem.

## Combined YAML source

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