# 使用 Homebrew, MacPorts, Nix 安装 clib

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

## 安装

```sh
sudo av install brew:clib
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install clib
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install clib
```

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

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#clib
```

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

## 软件包事实

- **软件包键:** brew:clib
- **软件包管理器:** Homebrew
- **版本:** 2.8.7
- **来源摘要:** Package manager for C programming
- **主页:** <https://github.com/clibs/clib>
- **仓库:** <https://github.com/clibs/clib>
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- clib (别名)
- clib-build (别名)
- clib-configure (别名)
- clib-init (别名)
- clib-install (别名)
- clib-search (别名)
- clib-uninstall (别名)
- clib-update (别名)
- clib-upgrade (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

clib is a package manager for the C programming language, built around small standalone C libraries and a `clib.json` manifest.

### 项目历史

The clib GitHub repository was created in October 2012 and presents the project as a package manager for C. The README describes it as a way to promote small C utilities, improve discovery, and avoid pulling large frameworks into C projects.

clib's project model expects packages to describe themselves with `clib.json`, including fields such as name, version, repo, description, keywords, license, sources, and install commands. The wiki package listing acts as the registry and feeds `clib-search`.

### 采用历史

The README documents installation through Homebrew, MacPorts, Nix, and source builds on Ubuntu and Fedora, showing packaging across both macOS package managers and Unix-like source workflows.

GitHub repository metadata showed thousands of stars at research time, and the project has continued publishing 2.x releases through 2024. That combination makes it one of the more recognizable attempts to give C a lightweight package-manager workflow.

### 使用方式

clib is used to initialize projects, install dependencies, update or uninstall packages, configure and build dependencies, and search the registry. The README recommends checking fetched files into the consuming repository so end users and contributors do not need clib installed.

Common commands include `clib install clibs/ms clibs/commander`, installing packages into `./deps` or another output directory, and using `clib.json` to describe both libraries and executables.

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

clib is significant because C has no single dominant package manager comparable to npm or Cargo. clib's deliberately small model, GitHub-centered registry, vendored source expectation, and manifest format capture a practical answer to C's fragmented library-discovery problem.

For package nerds, clib sits in the lineage of language package managers but keeps C's cultural preference for source files, makefiles, and minimal runtime assumptions. Its Homebrew/MacPorts/Nix availability also made it easy to try without adopting a whole new platform.

### 时间线

- 2012: The GitHub repository is created.
- 2017: GitHub release metadata records clib 1.8.1.
- 2023: GitHub release metadata records clib 2.8.3 and 2.8.5.
- 2024: GitHub release metadata records clib 2.8.7.

### Related projects

- The clibs GitHub organization and clib wiki package list are related because the README describes them as the package registry.
- Homebrew, MacPorts, and Nix are related distribution channels documented by the README and input package metadata.
- libcurl is a build dependency named by the README.

### 来源

- <https://github.com/clibs/clib#readme>
- <https://api.github.com/repos/clibs/clib>
- <https://api.github.com/repos/clibs/clib/releases>


## 安全说明

infrastructure mutation or orchestration signal.

- **Geiger 风险:** orange / 中
- infrastructure mutation or orchestration signal


## 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: ./clib.json
## 其他软件包管理器记录

- Nix - clib: normalized package name match | nixpkgs package indexes: pkgs/by-name/cl/clib/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- MacPorts - clib: normalized package name match | MacPorts ports tree: devel/clib/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## Combined YAML source

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


## 来源

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