| name | mcpp-index |
| description | Find, add and publish mcpp packages through mcpp-index (the default package index). Use when looking up a dependency, resolving a "package not found" error, choosing a namespace, or publishing this library to the index. |
mcpp-index
mcpp-index is the default package index for mcpp:
one pkgs/<initial>/<name>.lua descriptor per package. Browse it online at
https://mcpplibs.github.io/mcpp-index/.
Two kinds of packages live there:
- Native mcpp module libraries (
mcpplibs.*, nlohmann.json, imgui, opencv, …) — the
upstream repository carries its own mcpp.toml, so the descriptor (Form A) declares only
metadata and a download address. A library built from this template is Form A.
- Third-party C/C++ libraries under the
compat namespace — upstream has no mcpp support,
so the descriptor (Form B) inlines the build information.
Consuming: Finding and Adding a Dependency
mcpp search <keyword>
mcpp add <pkg>[@<version>]
mcpp build
mcpp index list|add|remove|update
Package identity is a pair: namespace is a dotted hierarchical path, name is a single
atomic segment (compat + zlib, mcpplibs.capi + lua — never mcpplibs + capi.lua).
A bare dependency name resolves in exactly three places, in order:
mcpplibs — the default namespace
compat — third-party C/C++ wrappers
- packages that declare no namespace at all
Anything else must be spelled out — there is no index-wide fuzzy search by short name:
[dependencies]
"chriskohlhoff.asio" = "1.38.1"
[dependencies.chriskohlhoff]
asio = "1.38.1"
When resolution fails: read the error (it lists the namespaces searched), then check the
spelling against the online index, and run xlings update — a release tarball bundles an
index snapshot frozen at build time, which is the usual reason a fresh version "does not
exist".
Mirrors: mcpp self config --mirror CN switches to the GitCode mirror; GLOBAL (upstream) is
the default.
Publishing This Library to the Index
mcpp publish --dry-run
mcpp emit xpkg -o mylib.lua
--dry-run prints the remaining steps with the project's real URLs filled in:
- Tag and push —
git tag -a v<version> -m "v<version>" && git push --tags
- Attach
target/dist/<name>-<version>.tar.gz to that GitHub Release
- Open a PR to mcpp-index adding
pkgs/<initial>/<name>.lua
Before opening the PR, confirm [package] in mcpp.toml carries an accurate namespace,
name, version, description, license and repo — the descriptor is generated from
those fields, and a repo still pointing at the template is the classic mistake.
The index's CI (validate.yml) lints every descriptor, checks the GLOBAL/CN mirror tables,
and builds a small test project per package on three platforms. Reproduce the lint locally
with mcpp xpkg parse pkgs/<initial>/<name>.lua.
Writing a Descriptor by Hand
For anything beyond a generated Form A descriptor — a compat wrapper, features, a CN mirror,
multiple majors in one package — follow the index's own end-to-end procedure rather than
improvising:
Upstream mcpp is authoritative for the descriptor field specification; the index docs are
authoritative for repository conventions and the contribution flow.