Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
C

clib

> 包管理
Open source

Package manager for the C programming language.

5.1K stars0 likes0 views
WebsiteGitHub

About

Package manager for the C programming language.

clib(1)

Package manager for the C programming language.

Installation

Expects libcurl to be installed and linkable.

With homebrew:

bash
$ brew install clib

Or MacPorts:

bash
$ sudo port selfupdate
$ sudo port install clib

With git:

bash
$ git clone https://github.com/clibs/clib.git /tmp/clib
$ cd /tmp/clib
$ make install

Ubuntu:

bash
# install libcurl
$ sudo apt-get install libcurl4-gnutls-dev -qq
# clone
$ git clone https://github.com/clibs/clib.git /tmp/clib && cd /tmp/clib
# build
$ make
# put on path
$ sudo make install

Fedora:

bash
# install libcurl
$ sudo dnf install libcurl-devel
# clone
$ git clone https://github.com/clibs/clib.git /tmp/clib && cd /tmp/clib
# build
$ make
# put on path
$ sudo make install

Nix:

bash
$ nix-env -i clib

Or add to your nativeBuildInputs.

About

Basically the lazy-man's copy/paste promoting smaller C utilities, also serving as a nice way to discover these sort of libraries. From my experience C libraries are scattered all over the web and discovery is relatively poor. The footprint of these libraries is usually quite large and unfocused. The goal of clibs is to provide stand-alone "micro" C libraries for developers to quickly install without coupling to large frameworks.

You should use clib(1) to fetch these files for you and check them into your repository, the end-user and contributors should not require having clib(1) installed. This allows clib(1) to fit into any new or existing C workflow without friction.

The wiki listing of packages acts as the "registry" and populates the clib-search(1) results.

Usage

…

More about the Command Line Interface here.

Examples

More examples and best practices at BEST_PRACTICE.md.

Install a few dependencies to ./deps:

bash
$ clib install clibs/ms clibs/commander

Install them to ./src instead:

bash
$ clib install clibs/ms clibs/commander -o src

When installing libraries from the clibs org you can omit the name:

bash
$ clib install ms file hash

Install some executables:

bash
$ clib install visionmedia/mon visionmedia/every visionmedia/watch

clib.json

Example of a clib.json explicitly listing the source:

json
{
  "name": "term",
  "version": "0.0.1",
  "repo": "clibs/term",
  "description": "Terminal ansi escape goodies",
  "keywords": ["terminal", "term", "tty", "ansi", "escape", "colors", "console"],
  "license": "MIT",
  "src": ["src/term.c", "src/term.h"]
}

Example of a clib.json for an executable:

json
{
  "name": "mon",
  "version": "1.1.1",
  "repo": "visionmedia/mon",
  "description": "Simple process monitoring",
  "keywords": ["process", "monitoring", "monitor", "availability"],
  "license": "MIT",
  "install": "make install"
}

See explanation of clib.json for more details.

Contributing

If you're interested in being part of this initiative let me know and I'll add you to the clibs organization so you can create repos here and contribute to existing ones.

If you have any issues, questions or suggestions, please open an issue here.

You can also find us on Gitter: https://gitter.im/clibs/clib

Also feel free to open a GitHub Discussion here.

Before committing to the repository, please run make commit-hook. This installs a commit hook which formats .c and .h files.

Articles

  • Introducing Clib - introduction to clib
  • The Advent of Clib: the C Package Manager - overview article about clib

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Ccclibmanagerpackage

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category包管理
PricingOpen source

> Related tools

N
npm
Node.js 默认包管理器
P
pnpm
高效节省磁盘的 Node 包管理器
I
is-gif
Check if a Buffer/Uint8Array is a GIF image