# 使用 Homebrew, apk, Nix 安装 xdg-ninja

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

## 安装

```sh
sudo av install brew:xdg-ninja
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install xdg-ninja
```

  证据: local Homebrew formula metadata

### Linux

- apk (92%):

```sh
sudo apk add xdg-ninja
```

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

- Nix (92%):

```sh
nix profile install nixpkgs#xdg-ninja
```

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

## 软件包事实

- **软件包键:** brew:xdg-ninja
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/xdg-ninja>
- **版本:** 0.2.0.2
- **来源摘要:** Check your $HOME for unwanted files and directories
- **主页:** <https://github.com/b3nj5m1n/xdg-ninja>
- **仓库:** <https://github.com/b3nj5m1n/xdg-ninja>
- **许可证:** MIT
- **源码归档:** <https://github.com/b3nj5m1n/xdg-ninja/archive/refs/tags/v0.2.0.2.tar.gz>
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- xdg-ninja (cli)
- xdg-ninja (别名)

## 依赖

- glow

## macOS 提供的库

- jq

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 all

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 0.2.0.2
- 本地数据: OK
- 上游仓库: https://github.com/b3nj5m1n/xdg-ninja
- 信息: No package-manager update timestamp was available.
- 信息: No cached GitHub release or tag data was available.
## 项目历史与用法

xdg-ninja is a shell-based checker for users who want a cleaner home directory and better XDG Base Directory compliance. It scans for known dotfiles and directories in $HOME, then reports whether each one can be moved and how to do it.

### 项目历史

The project began in May 2022 with an initial shell implementation and an early import of supported-program data from the Arch Wiki XDG Base Directory page. The README still describes the configuration corpus as coming from the Arch Wiki, antidot, and user contributions.

The tool deliberately keeps the main checker simple: a POSIX-like shell script, jq, and find are enough to run the tests. Later work added a Haskell helper, xdgnj, for generating and editing the JSON program configurations, while the README emphasizes that the shell script remains the core checker.

### 采用历史

xdg-ninja grew with dotfiles culture and the recurring frustration that many command-line programs still create legacy ~/.name files even after the freedesktop.org XDG Base Directory Specification defined preferred locations for config, data, state, cache, and runtime files.

The README documents Nix and Homebrew usage, but also warns that because upstream does not cut regular releases, Homebrew users should install and upgrade from HEAD. That is an unusually transparent adoption note and explains why package-manager versions may lag behind the living configuration database.

### 使用方式

Users run xdg-ninja in their home environment. The script checks known paths, prints warnings for unwanted files or directories, and renders Markdown help explaining whether the item is movable and what setting or migration step can relocate it.

Contributors add JSON files under programs/. Each file names a program and the $HOME paths it creates, plus Markdown help for movable or unsupported cases. The XN_PROGRAMS_DIR environment variable can point the checker at an alternate configuration directory.

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

xdg-ninja is important to package nerds because it turns the messy social problem of XDG compliance into a testable, crowd-maintained catalog. It is half lint tool, half living index of which CLI programs respect modern Unix home-directory conventions.

It also exposes a subtle packaging issue: data freshness matters more than binary freshness. A stale packaged xdg-ninja can miss newly documented offenders even if the shell code itself still works.

### 时间线

- 2021-05-08: XDG Base Directory Specification 0.8 publication date.
- 2022-05-12: xdg-ninja initial commit and first implementation.
- 2022-05-12: Early supported-program data imported from the Arch Wiki article.
- 2022-06-06: v0.2.0.0 tag.
- 2024-02-03: v0.2.0.2 tag for the xdgnj helper release line.

### Related projects

- XDG Base Directory Specification: defines the directory conventions xdg-ninja checks against.
- Arch Wiki XDG Base Directory page: one of the configuration-data sources named by upstream.
- antidot: another source of XDG migration knowledge credited by the README.
- xdgnj: upstream helper for creating and previewing xdg-ninja program configuration files.

### 来源

- Git history and tags: https://github.com/b3nj5m1n/xdg-ninja
- README, b3nj5m1n/xdg-ninja: https://github.com/b3nj5m1n/xdg-ninja#readme
- XDG Base Directory Specification: https://specifications.freedesktop.org/basedir-spec/latest/
- xdg-ninja shell script: https://github.com/b3nj5m1n/xdg-ninja/blob/main/xdg-ninja.sh


## 安全说明

narrow executable package without higher-risk signals.

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


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: ./programs/
## 源数据库详情

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** xdg-ninja
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

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

- Nix - xdg-ninja: normalized package name match | nixpkgs package indexes: pkgs/by-name/xd/xdg-ninja/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- apk - xdg-ninja - 0.2.0.2-r0: normalized package name match | Alpine Linux edge package indexes: xdg-ninja from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz | Shell script which checks your home directory for unwanted files and directories | https://github.com/b3nj5m1n/xdg-ninja


## 相关链接

- [Source-control packages](https://pkg.so/zh-hans/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://pkg.so/zh-hans/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://pkg.so/zh-hans/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://pkg.so/zh-hans/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [glow](https://pkg.so/zh-hans/brew/glow/) - Runtime dependency declared by Homebrew.
- [shared-mime-info](https://pkg.so/zh-hans/brew/shared-mime-info/) - Shares pkgdb curated category or tags: cli, system, xdg.
- [stow](https://pkg.so/zh-hans/brew/stow/) - Shares pkgdb curated category or tags: cli, dotfiles, system.
- [displayplacer](https://pkg.so/zh-hans/brew/displayplacer/) - Shares pkgdb curated category or tags: cli, configuration, system.
- [augeas](https://pkg.so/zh-hans/brew/augeas/) - Shares pkgdb curated category or tags: cli, configuration, system.
- [libpaper](https://pkg.so/zh-hans/brew/libpaper/) - Shares pkgdb curated category or tags: cli, configuration, system.
- [desktop-file-utils](https://pkg.so/zh-hans/brew/desktop-file-utils/) - Shares pkgdb curated category or tags: cli, system, xdg.
- [kanata](https://pkg.so/zh-hans/brew/kanata/) - Shares pkgdb curated category or tags: cli, configuration, system.
- [borgmatic](https://pkg.so/zh-hans/brew/borgmatic/) - Shares pkgdb curated category or tags: cli, configuration, system.
- [modclean](https://pkg.so/zh-hans/npm/modclean/) - Local package facts share a topical domain. Shared terms: cli, directories, files, system, unwanted.
- [copy-files-from-to](https://pkg.so/zh-hans/npm/copy-files-from-to/) - Local package facts share a topical domain. Shared terms: cli, configuration, directory, files, system.
- [cpx](https://pkg.so/zh-hans/npm/cpx/) - Local package facts share a topical domain. Shared terms: cli, directories, directory, files, system.

## Combined YAML source

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


## 来源

- pkg.so package database
- Geiger risk classifier
- package-page enrichment
- curated configuration and credential file locations
- curated package history
- package version freshness
- pkgdb category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
