clib

ID

clib

Home page

https://github.com/clibs/clib

Platforms

🐧 Linux · 🍎 macOS

Operations

search · install · remove

purl types

pkg:clib

CLI name

clib

Issues and PRs

📦 manager: clib

Source

meta_package_manager/managers/clib.toml

clib is the package manager of the C ecosystem, distributing small libraries and standalone programs.

Parsing notes, verified against clib 2.8.7 on macOS:

  • install forces --global. Without it clib vendors sources into a deps/ directory relative to the working directory, which is a project operation rather than a machine-wide one; --global installs to the prefix instead.

  • No inventory: clib ships no list command of any kind, so installed and outdated are not declared and mpm auto-skips them. What remains is still more than the competing wrappers offer, none of which reach clib at all.

  • upgrade is not declared either. clib upgrade upgrades clib itself to a given version rather than any package, and clib update re-fetches packages into the project deps/ directory, so neither is a package upgrade.

  • Every operation keys on the owner/repo slug. search reports it as repo, install takes it directly, and uninstall parses it back apart through parse_repo_owner/parse_repo_name (src/clib-uninstall.c), so one id feeds all three.

  • The registry carries no versions at all, only names, URLs and descriptions, so search results are yielded version-less. The description is dropped too: the definition schema only maps package_id, installed_version and latest_version, so a class would be needed to carry it, which is not worth the weight for one cosmetic column.

What mpm adds to clib

Through mpm, clib gains --exact and --extended search, to narrow to exact names or match descriptions.

Bigger still, mpm reaches across every manager at once: mpm installed and mpm outdated cover clib alongside every other manager you run in one table, mpm upgrade --all updates them together, and mpm sbom exports the whole machine as one bill of materials.

Every mpm command also gains --dry-run and --plan previews, cross-scheme version comparison and purl identifiers. See manager augmentations for how each one is built.

Your clib commands, in mpm

You already know clib: each operation maps one-to-one onto mpm, in an interface shared by every manager.

To…

With clib

With mpm

Search for a package

clib search --json --no-color <query>

mpm --clib search <query>

Install a package

clib install --global <package_id>

mpm install pkg:clib/<package_id>

Remove a package

clib uninstall <package_id>

mpm remove pkg:clib/<package_id>

Prefix any command above with --dry-run to simulate the underlying manager calls without touching the system: the safe way to watch what mpm would do before trusting it.

Operations

Operation

Supported

Notes

installed

outdated

orphans

search

exact and extended search backfilled by mpm

install

upgrade

upgrade_all

remove

sync

cleanup

doctor

Selecting and configuring clib

Deselect clib for a single run with --no-clib, or persist the choice in your configuration:

[mpm]
clib = false

Keep it enabled but tune how mpm drives it with a per-manager override:

[mpm.managers.clib]
timeout = 900

mpm config-template clib prints every overridable attribute as a ready-to-paste block.

Recipes

A few jobs you would otherwise script around clib, one mpm command each:

  • Snapshot and clone a machine: mpm --clib dump clib.toml, then mpm restore clib.toml on the next one.

  • Export a compliance SBOM: mpm --clib sbom (CycloneDX by default, --spdx for SPDX).

Privilege escalation

mpm runs this manager as the current user and never prepends sudo by default. Flip the policy for its privileged operations with --sudo or the per-manager sudo override.

None of its operations needs root.

See privilege escalation for the full policy.

Cooldown

State of clib’s release-age gating, from the cooldown support table:

Status: ❌ None

A cooldown only pays off where a compromised release can be withdrawn while the clock runs, and can only be emulated where the registry dates its releases. From the retraction table:

  • Registry: clib package wiki

  • Retraction: Wiki edit: the index is a GitHub wiki page, clibs/clib/wiki/Packages, scraped as HTML (CLIB_WIKI_URL in src/clib-search.c), so withdrawal is an edit to that page; the code itself is fetched from the GitHub archive of whichever repository the row names, and disappears with it

  • Publish date: ❌ the index carries names, URLs and descriptions only, with no version field at all, so there is nothing to date a release by

With --cooldown set, mpm skips this manager’s install and upgrade operations rather than run them unguarded (fail-closed); --allow-unsupported-managers opts back in.

Version probe

The version is probed by running:

$ clib --version
2.8.7

and extracted with:

r"(?P<version>\d+\.\d+\.\d+)"

Reference traces

Raw native outputs captured in the bundled definition: the reference mpm’s parsers were written against. If you know clib well and a transcript below looks wrong, or a newer release changed its output format, report it.

$ clib search --json --no-color {query}
[
  {
    "repo": "willemt/skiplist",
    "href": "https://github.com/willemt/skiplist",
    "description": "Dictionary implemented through a skiplist",
    "category": "data structure"
  }
]

Feed any of these through mpm and the raw output becomes one uniform table, the same shape for every manager: filter it, project columns, or export it (mpm --clib installed --output json, or csv, toml, yaml), each package carrying a purl and a version comparable across managers.

Changelog

  • 7.7.0.dev0 (unreleased)

    • Add clib package manager as a bundled definition, with search, install and remove support. install forces --global, without which clib vendors sources into a deps/ directory relative to the working directory. It ships no listing command, so no inventory is declared.