CLI Reference¶
Global options must be placed before the subcommand. Use collider -v <command>
for debug logging; some pkg subcommands use -v for --version.
Use collider <command> --help for command-specific help.
Global Options¶
| Option | Description |
|---|---|
-v, --verbose |
Enable verbose (DEBUG) logging. |
--offline |
Disable network access and rely on the local cache where possible. |
-h, --help |
Show the help message and exit. |
As noted above, global options must precede the subcommand. The effective
offline mode is the global --offline OR the per-command --offline: passing
either one is enough.
init¶
Create collider.json in the current project.
Refuses to run outside a Meson project (no meson.build found).
If the meson.build project() declaration has no license: field, a hint is
emitted at init time to avoid discovering the gap only when publishing.
setup¶
Configure a Meson project.
| Option | Description |
|---|---|
--sourcedir PATH |
Meson source directory. |
--builddir PATH |
Meson build directory (default: collider-build). |
--allow-drift |
Build even if an installed wrap differs from collider.lock (warn instead of fail). |
-- [args] |
Arguments passed through to Meson. |
Examples:
collider setup forces Meson to use Collider's wraps for managed dependencies
(via --force-fallback-for) so the build matches the locked versions rather
than system copies. The forced set is scoped to collider.lock when present, or
all wraps in subprojects/ (with a warning) when it is absent; a malformed
collider.lock aborts with EX_DATAERR. A user-supplied --force-fallback-for
or -Dforce_fallback_for is honored as-is.
When collider.lock is present, setup verifies that each locked wrap on disk
still matches its recorded hash. If an installed .wrap was modified, setup
aborts with EX_DATAERR before configuring Meson; run collider lock to
re-lock or pass --allow-drift to build anyway (downgrades to a warning). The
hash covers the .wrap descriptor only, not the extracted subproject source. A
wrap committed into a consumer repo under Git line-ending normalization
(core.autocrlf or a .gitattributes text rule) can be re-hashed differently
than it was locked and trip the gate; use --allow-drift if that applies. See
Wrap Fallback Enforcement.
lock¶
Resolve dependencies from collider.json and write collider.lock.
| Option | Description |
|---|---|
--offline |
Resolve only from the local cache. |
A repository's releases.json is untrusted input. Individual malformed entries
(non-object shape, unsafe name or version segment) are skipped at the index
boundary with a single warning, and the rest of the repository still loads. If a
package the resolver directly needs has no usable version anywhere and its
metadata was rejected, lock refuses to write a lockfile against corrupt data
and aborts with EX_DATAERR. The same fail-closed check applies to install
and pkg add.
install¶
Install dependencies. Uses collider.lock when present, falls back to
collider.json otherwise.
When using collider.lock, install requires each package's origin repository
to be configured. The origin is the repository URL recorded in the lockfile at
lock time. If a configured repository's URL does not match the locked origin
(after URL normalization), install fails with EX_CONFIG.
With --offline, if the origin repository requires network access, install
falls back to the local cache and emits a warning that origin provenance cannot
be verified.
| Option | Description |
|---|---|
--frozen |
Fail if collider.lock is missing or stale. For CI use. |
--offline |
Disable network access; use cached wraps and archives only. |
patch¶
Create a patch archive from Git changes.
collider patch [--builddir PATH] [--base REV] [--output PATH] [--list]
[--include-uncommitted / --no-include-uncommitted]
| Option | Description |
|---|---|
--builddir PATH |
Meson build directory (default: collider-build). |
--base REV |
Git revision to diff against. |
--output PATH |
Output path (default: dist/<name>_<version>_patch.tar.xz). |
--list |
Dry-run: list files without creating the archive. |
--include-uncommitted |
Include staged, unstaged, and untracked files (default). |
--no-include-uncommitted |
Exclude working tree changes; archive only the committed diff from --base. |
publish¶
Generate a wrap and source archive, then publish to a repository.
collider publish <repo> [--builddir PATH] [--patch-archive PATH]
[--push-token-env VAR] [--insecure] [--dry-run]
| Option | Description |
|---|---|
<repo> |
Repository name from config.json. |
--builddir PATH |
Meson build directory (default: collider-build). |
--patch-archive PATH |
Attach a patch archive to the published package. |
--push-token-env VAR |
Environment variable holding the bearer token (default: COLLIDER_PUSH_TOKEN). |
--insecure |
Allow pushing to a non-https repository, sending the token in cleartext. |
--dry-run |
Validate and package without writing to the repository. |
unpublish¶
Remove a package version from a repository.
| Option | Description |
|---|---|
<repo> |
Repository name from config.json. |
<package> |
Package name. |
<version> |
Version to remove. |
--push-token-env VAR |
Environment variable holding the bearer token. |
--insecure |
Allow deleting from a non-https repository, sending the token in cleartext. |
repo add¶
Add a repository entry to config.json.
| Option | Description |
|---|---|
<name> |
Repository name. |
<type> |
Repository type: filesystem, wrap, or collider. |
<url> |
Repository URL. |
--publish-url URL |
Required for filesystem repositories. Ignored for others. |
repo remove¶
Remove a repository entry from config.json.
Alias: collider repo rm <name>
repo list¶
List configured repositories.
Alias: collider repo ls
pkg add¶
Add a package dependency and install it into subprojects/.
collider pkg add <name> [--version SPEC] [--offline] [--force]
[--include PKG] ... [--exclude PKG] ...
[--include-conditional] [--exclude-optional]
| Option | Description |
|---|---|
<name> |
Package name. |
--version, -v SPEC |
Version constraint (e.g. >=1.2,<2.0); a bare version like 1.2.13 is an exact ==1.2.13 pin. |
--offline |
Resolve from cache only. |
--force, -f |
Reinstall even if the package is already installed. |
--include PKG |
Force-include a transitive dependency by name (repeatable). |
--exclude PKG |
Skip a transitive dependency by name (repeatable). |
--include-conditional |
Also resolve dependencies inside Meson if blocks. |
--exclude-optional |
Skip optional (required: false) dependencies. |
Alias: collider pkg install
Fails if the package is already installed unless --force is given. If the wrap is installed only as a transitive dependency, pkg add promotes it into collider.json without reinstalling it. Does not update collider.lock.
pkg remove¶
Remove a dependency from collider.json. Collider removes the installed wrap
only when it can prove the package is no longer needed; otherwise it leaves
the wrap in place. When it does remove a package, it deletes both the .wrap
descriptor and the extracted source tree under subprojects/ (the directory the
wrap declares via directory=, plus the legacy <name> directory), so a stale
tree cannot later satisfy a Meson dependency().
Alias: collider pkg rm <name>
| Option | Description |
|---|---|
--prune |
Also remove orphaned transitive dependencies (runs pkg prune after removal). |
Does not update collider.lock; you are warned to run collider lock if the removed package is still in the lockfile.
pkg prune¶
Remove orphaned Collider-managed transitive wraps that are no longer needed
by any declared dependency. Only wraps proven to be Collider-managed via
collider.lock are eligible for removal; manually placed wraps are never
touched.
| Option | Description |
|---|---|
--dry-run |
List orphaned wraps without removing them. |
If no lockfile exists, prune warns and does nothing. A corrupt lockfile is
treated the same way to avoid accidental deletion.
pkg prune does not rewrite collider.lock; after deletions, Collider warns
you to run collider lock to refresh it.
pkg search¶
Search repositories or the local cache by package name.
| Option | Description |
|---|---|
<pattern> |
Regular expression matched against package names. |
--cache |
Search only cached wraps without accessing repositories. |
--repository, -r NAME |
Restrict search to specific repositories (repeatable). |
--version, -v SPEC |
Filter by version constraint; a bare version like 1.2.13 matches every 1.2.13.* revision (including 1.2.13-1). |
pkg info¶
Show versions, origins, and cache status for a package.
Alias: collider pkg policy
| Option | Description |
|---|---|
<name> |
Package name. |
--repository, -r NAME |
Restrict to specific repositories (repeatable). |
pkg upgrade¶
Upgrade one or all collider-managed dependencies.
| Option | Description |
|---|---|
<name> |
Package to upgrade. Omit to upgrade all. |
--version, -v SPEC |
New version constraint (only valid with a package name); a bare version like 1.2.13 is an exact ==1.2.13 pin. |
--offline |
Resolve from cache only. |
Does not update collider.lock.
check¶
Detect drift between meson.build dependency() calls and collider.json.
| Option | Description |
|---|---|
--sourcedir PATH |
Meson source directory (default: current directory). |
--include-conditional |
Also check dependencies inside Meson if-blocks. |
Reports untracked dependencies (called in meson.build but not in collider.json) and
stale entries (in collider.json but absent from meson.build). Exits 0 when clean,
non-zero on drift. Suitable for CI use.
Note
Assumes the dependency() name in meson.build matches the collider package name.
Packages where the Meson dep name differs from the package name (e.g. abseil-cpp vs absl_strings)
may produce false positives.
status¶
Show collider-managed dependencies and local wrap status.
Reports tracked Collider dependencies from collider.json, system
dependencies declared with "source": "system", transitive dependencies,
and untracked wraps found in subprojects/. For tracked and transitive
entries, Collider shows version information and whether the wrap is installed or
missing. When collider.lock exists, transitive classification uses the lock.
Otherwise, Collider re-resolves from collider.json when repository metadata
is available. Lock drift (ok / modified / missing) is reported when a
lockfile exists.
serve¶
Serve a filesystem repository over HTTP.
collider serve <path> [--host HOST] [--port PORT]
[--push-token TOKEN] [--push-token-env VAR]
[--publish-url URL]
| Option | Description |
|---|---|
<path> |
Filesystem path to serve. |
--host HOST |
Bind address (default: 127.0.0.1). |
--port PORT |
Bind port (default: 8000). |
--publish-url URL |
Base URL for archive URLs in wraps. Defaults to the repository path as a local file:// URL. |
--push-token TOKEN |
Static bearer token for push auth. |
--push-token-env VAR |
Environment variable holding the push token. |
Push routes are disabled unless a push token is configured.
Exit Codes¶
Subcommands return os.EX_* codes from the standard os module. The two
non-EX_* codes come from the CLI wrapper and argparse.
| Code | Name | Meaning |
|---|---|---|
| 0 | EX_OK |
Success. |
| 1 | -- | Uncaught exception (likely a Collider bug). |
| 2 | -- | Argparse usage error (unknown command or bad arguments). |
| 64 | EX_USAGE |
Command-line usage error. |
| 65 | EX_DATAERR |
Invalid input data: drift, bad version, or wrap hash mismatch. |
| 66 | EX_NOINPUT |
Required input missing: no meson.build, collider.json, or lockfile. |
| 69 | EX_UNAVAILABLE |
A dependency is unavailable: network, resolution, or Meson. |
| 70 | EX_SOFTWARE |
Subprocess failure, such as meson setup exiting non-zero. |
| 73 | EX_CANTCREAT |
Output target could not be created, e.g. the package version already exists. |
| 74 | EX_IOERR |
I/O error reading or writing files or repositories. |
| 77 | EX_NOPERM |
Permission denied, such as a rejected push token. |
| 78 | EX_CONFIG |
Configuration error: a locked origin repository is not configured or its URL does not match. |