Skip to content

Quick Start

This guide walks through the basic Collider workflow: setting up a project, adding a dependency, and publishing a package.

1. Initialize a Project

Navigate to the root of your Meson project (where meson.build lives) and create a collider.json:

collider init

This generates a minimal collider.json next to your meson.build.

You can also write it by hand:

{
  "description": "Example Meson library",
  "dependencies": [
    { "name": "fmt", "source": "system" },
    { "name": "my-lib", "source": "collider", "version": ">=1.2.0" }
  ]
}

2. Configure a Repository

Before adding packages you need at least one repository. Add the official Meson WrapDB:

collider repo add wrapdb wrap https://wrapdb.mesonbuild.com/v2/

Or add a local filesystem repository:

mkdir -p /path/to/repo
collider repo add local filesystem file:///path/to/repo \
    --publish-url https://packages.example.com/collider/

List configured repositories with:

collider repo list

3. Add a Dependency

collider pkg add my-lib

Collider resolves the newest available version, installs the wrap file into subprojects/, and populates subprojects/packagecache/ for offline builds. If the package has transitive dependencies, Collider installs them automatically. (To add a package from WrapDB such as fmt, use collider pkg add fmt and it will be added as a collider dependency.)

To pin a version range:

collider pkg add my-lib --version '>=1.2,<2.0'

4. Configure the Meson Build

collider setup

This runs Meson setup with the collider-managed subprojects in place. Pass extra Meson arguments after --:

collider setup -- --buildtype=debug

5. Lock Dependencies

Create a lockfile for reproducible installs:

collider lock

The lockfile (collider.lock) records exact versions and wrap hashes so that collider install reproduces the same state on any machine.

6. Publish a Package

After building your project, publish it to a repository:

collider publish local

The package name and version are read from Meson introspection. Collider generates the source archive and wrap file and stores them in the repository.

Next Steps