GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing docs.vixcpp.com — Vix.cpp Documentation vix add
Use it when the application itself needs a package, or when an application module needs a registry package that should stay declared with that module. bash 1 Overview
For a root project dependency, it resolves the package from the local registry index, updates This distinction keeps dependency ownership visible. A JWT package used only by text 1 2 3 4 5 6 7 8 9 10 11 Usage bash 1 2 3 4 Basic examples bash 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 What it does When you run: bash 1 Vix does this:
If resolution or publication fails, Vix does not leave the manifest and lockfile describing different dependency states. Registry requirement
If the registry has not been synced, Vix reports: txt 1 2 Fix: bash 1 2 Package format A package name uses this format: txt 1 Examples: txt 1 2 3 Scoped-style syntax is also accepted: txt 1 Example: txt 1 Both forms point to the same package id: txt 1 Version format A package spec can include a version or version range. bash 1 2 3 4 5 If no version is provided, Vix resolves the latest available version from the local registry index. bash 1 If a range is provided, Vix resolves the highest version that satisfies that range. bash 1 Supported version behavior
Supported forms include: txt 1 2 3 The selected version is stored exactly in For root-level dependencies, the requested version or range is stored in What files are updated Without txt 1 2 With txt 1 2 It does not directly edit There is no per-module Module dependencies Use bash 1 The requirement is stored in the module manifest. toml 1 2 3 4 5 6 7 8 If text 1 Use an explicit target when the package exports a different target: bash 1 2 3 When the module is active, its Registry requirement participates in the same dependency constraint analysis as root application requirements and requirements from other active modules. The module target receives the module-owned link targets. They are not automatically attached to sibling modules or to the application target. text 1 2 3 4 5 The Registry requirement list and CMake link list represent different information. A Registry requirement identifies what must be resolved. A link entry identifies a target consumed by the module. Do not assume that the two arrays form a positional one-to-one mapping. After adding a module dependency: bash 1 2 Module dependency constraints Active root and module Registry requirements are analyzed together. For example: text 1 2 Vix selects an available version that satisfies all active compatible requirements. If no available version can satisfy the active requirements, the operation fails instead of allowing one owner to overwrite another owner's requirement. A disabled module can keep its Registry dependency metadata on disk. Its requirements do not constrain the active application dependency graph until the module becomes active. Registry versus direct Git dependencies
bash 1 For a direct Git repository, use bash 1 2 3 4 The Git form is stored as a structured Do not use
|
| Command | Purpose |
|---|---|
vix add <pkg> | Add or change a Vix Registry requirement. |
vix add <pkg> --module <name> | Add or change a Registry requirement owned by one module. |
vix install | Materialize the dependency state already described by project manifests and vix.lock. |
vix install <git-url> | Add a direct Git dependency to the application. |
vix install <git-url> --module <name> | Add a direct Git dependency owned by one module. |
Use vix add when the dependency comes from the Vix Registry.
Use vix install <git-url> when the dependency is a direct Git repository.
After cloning an existing project, a normal reproducible workflow is:
vix install
vix buildvix add and vix update | Command | Purpose |
|---|---|
vix add <pkg> | Add or change one dependency requirement. |
vix update | Re-resolve project dependencies and rewrite vix.lock. |
Use vix update when you want to refresh existing locked versions.
vix add and vix search | Command | Purpose |
|---|---|
vix search <query> | Search the local registry index. |
vix add <pkg> | Add a package by exact registry id. |
If you do not know the exact package name, search first:
vix search jwt
vix add gk/jwtvix add updates project dependency metadata through one project mutation boundary.
For a root dependency, the relevant authoritative files are:
vix.json
vix.lockFor a module dependency:
modules/<name>/vix.module
vix.lockVix resolves the prospective dependency state before publishing the new metadata. If resolution, repository materialization, or metadata publication fails, the previous project state is preserved.
Project mutations are serialized so concurrent Vix commands cannot silently overwrite the same dependency metadata.
vix registry sync
vix search jwt
vix add gk/jwt@^1.0.0
vix install
vix build
vix testsFor development:
vix devAfter dependencies are committed:
vix registry sync
vix install
vix build --build-target all
vix testsvix add is usually not used in CI.
CI should use:
vix installbecause CI should install the exact versions from vix.lock.
vix add takes one package spec. By default it writes a root dependency; with --module, it writes the dependency to a module manifest instead.
vix add [@]namespace/name[@version]
vix add [@]namespace/name[@version] --module <name>
vix add [@]namespace/name[@version] -m <name>
vix add [@]namespace/name[@version] --module <name> --link <target>| Option | Description |
|---|---|
-m, --module <name> | Add the dependency to modules/<name>/vix.module instead of the root dependency list. |
--link <target> | Set the CMake target linked by the module dependency. |
-h, --help | Show help. |
| Command | Description |
|---|---|
vix add gk/jwt | Add latest available version to the root dependency list. |
vix add gk/[email protected] | Add exact version. |
vix add gk/jwt@^1.0.0 | Add compatible range. |
vix add @gk/jwt | Add using scoped-style syntax. |
vix add gk/jwt@^1.0.0 --module auth | Add the dependency to the auth module. |
vix add gk/jwt@^1.0.0 --module auth --link gk::jwt | Add the dependency to auth with an explicit CMake link target. |
vix registry sync
vix add gk/jwt
vix install
vix buildvix add gk/jwt@^1.0.0
vix install
vix check --testsvix search jwt
vix add gk/jwtvix add gk/jwt
vix install
vix check --testsvix add gk/jwt@^1.0.0 --module auth
vix modules check
vix buildFor a direct Git dependency owned by the module, use vix install <git-url> --module auth instead.
Wrong:
vix add gk/jwtwhen the registry has not been synced.
Correct:
vix registry sync
vix add gk/jwtWrong:
vix add jwtCorrect:
vix add gk/jwtvix add to update every dependency vix add adds or changes one dependency requirement.
To refresh existing locked versions, use:
vix updatevix add to only update vix.json vix add also rewrites vix.lock. With --module, it updates modules/<name>/vix.module instead of adding the dependency directly to vix.json.
It resolves the whole project dependency graph after updating the root manifest or the module manifest.
vix add to automatically edit vix.app vix add updates package metadata. It does not add root vix.app link entries automatically.
For root-level vix.app dependencies, add the target alias to links when you need to link it. For module-level dependencies, use vix add --module so the link target is written to the module manifest.
Example:
links = [
vix::vix,
gk::json,
]vix add for a direct Git repository vix add resolves Vix Registry package ids.
For a Registry package:
vix add gk/jwt@^1.0.0 --module authFor a direct Git repository:
vix install https://github.com/gabime/spdlog \
--tag v1.15.3 \
--target spdlog::spdlog \
--module authDo not create modules/<name>/vix.lock.
The root vix.lock is the exact dependency state for the whole application, including active module-owned dependencies.
Package spec:
gk/json@^1.0.0CMake alias:
gk::jsonUse package specs in dependency declarations.
Use aliases in links or target_link_libraries.
vix.lock manually Do not manually edit vix.lock.
Use:
vix add
vix update
vix removeto change dependency state.
Run:
vix registry syncThen:
vix add gk/jwtSearch locally:
vix search jwtThen add the exact package id:
vix add gk/jwtIf the package should exist, refresh the registry:
vix registry syncUse:
namespace/name
namespace/name@version
@namespace/name
@namespace/name@versionExamples:
vix add gk/jwt
vix add @gk/jwt@^1.0.0If Vix reports:
no version matches range: gk/jwt@^2.0.0choose a range that exists in the registry.
Check available versions through the registry or package listing tools.
If Vix reports that the resolved version is not found in the registry entry, sync the registry again:
vix registry syncThen retry.
Vix fetches package source from the repository URL stored in the registry entry.
Check:
Then retry:
vix add gk/jwtThe registry entry points to a commit that could not be checked out.
This usually means registry metadata is stale or invalid.
Run:
vix registry syncIf the issue remains, the registry entry needs correction.
A transitive dependency may be missing, invalid, or impossible to resolve.
Run:
vix registry sync
vix add <package>If it still fails, inspect the dependency package’s vix.json.
Run vix registry sync before adding Registry packages when the local index may be stale.
Use vix search when you do not know the exact Registry package id.
Use version ranges when compatible updates are acceptable. Use exact versions when the project requires an exact declared requirement.
Keep dependencies owned by the narrowest appropriate scope. If only auth needs a Registry package, prefer:
vix add gk/jwt@^1.0.0 --module authDo not create per-module lockfiles or caches.
Commit the dependency manifests and root vix.lock.
Do not edit vix.lock manually.
Run module checks after changing module-owned dependencies:
vix modules check
vix buildUse vix install <git-url> for direct Git dependencies rather than treating Git repositories as Registry package ids.
| Command | Purpose |
|---|---|
vix search | Search the local Registry index. |
vix install | Materialize locked dependencies or add a direct Git dependency. |
vix modules | Manage and validate application modules. |
vix update | Re-resolve Registry dependency versions. |
vix outdated | Check outdated Registry dependencies. |
vix remove | Remove dependencies. |
vix list | List dependency state. |
vix registry sync | Refresh the local Registry index. |
vix build | Build after dependency changes. |
vix tests | Run tests after dependency changes. |
Install locked dependencies.