Introducing Clib

Micro C Libraries & package manager

TJ Holowaychuk
Oct 11, 2013 · 2 min read

Despite the ubiquitous nature of C it’s sometimes difficult to find just what you need, and you’re especially lucky if it’s not part of some gigantic library of unrelated code. For this reason I’ve decided to create Clib, a GitHub organization aimed at providing small, focused, discoverable “micro libraries”.

Using Clib

Clib is a suite of small C libraries that you can manually copy/paste into your project, or you can use the clib C package manager to install and search for existing packages that exist in the registry — just a plain old GitHub wiki page.

The libraries you install with clib(1) do not require a build step, these are just plain old C source files. This also means that clib does not provide “true” modularity since that would require a build step and name mangling.

Conversely this means that clib(1) can easily fit into your existing C tool-chain without friction, as the source files just become part of your repository, and do not rely on clib(1) for any portion of the build.

Installing Packages

Install packages with the GitHub <user>/<repo> combo, or when the <user> is “clibs” you may omit the username:

Clib also supports “install” scripts so you may build & install executables:

Discovering Packages

With the clibs registry it’s easy to discover packages via the wiki page, or the clib-search(1) executable, passing zero or more keywords:

HINT: on osx hold cmd and dbl-click a url to open it in the browser for review.


This is obviously not a fool-proof approach but it’s a reasonable quick & dirty solution.

If you’re interested in contributing to leave a note with your username and I’ll add you to the organization.

That’s all for now!

    TJ Holowaychuk

    Written by

    Code. Photography. Art.