Vix.cpp v2.6.0 is here Read the blog
Skip to content

vix remove

vix remove removes a package dependency from the current project lockfile.

Use it when your project no longer needs a locked package dependency.

bash
vix remove gk/jwt
1

Overview

vix remove removes one dependency from:

txt
vix.lock
1

It can also delete the project-local dependency folder under:

txt
.vix/deps/
1

when --purge is used.

It does not remove a package from the Vix Registry.

It does not uninstall a global package.

It does not currently rewrite vix.json.

Usage

bash
vix remove [@]namespace/name[@version]
vix remove [@]namespace/name[@version] --purge [-y]
1
2

Basic examples

bash
# Remove a locked dependency
vix remove gk/jwt

# Scoped-style syntax
vix remove @gk/jwt

# Remove only if the locked version matches
vix remove gk/jwt@1.0.0

# Scoped-style syntax with version
vix remove @gk/jwt@1.0.0

# Remove and delete project-local dependency files
vix remove @gk/jwt --purge

# Remove and purge without confirmation
vix remove @gk/jwt --purge -y
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

What it does

When you run:

bash
vix remove gk/jwt
1

Vix does this:

  1. Parses the package target.
  2. Reads vix.lock.
  3. Finds the matching dependency in the lockfile.
  4. Removes the first matching dependency entry.
  5. Writes the updated vix.lock.
  6. Optionally deletes .vix/deps/<namespace>.<name> when --purge is used.
  7. Prints a tip to regenerate dependency integration if needed.

Important behavior

vix remove currently removes from:

txt
vix.lock
1

It does not remove the dependency declaration from:

txt
vix.json
1

So after removing a dependency, check whether vix.json still contains it.

If it is still declared there, remove it manually or use the dependency workflow that matches your project.

Package format

A package target uses this format:

txt
namespace/name
1

Examples:

txt
gk/jwt
gk/json
1
2

Scoped-style syntax is also accepted:

txt
@namespace/name
1

Example:

txt
@gk/jwt
1

Both forms refer to the same dependency id:

txt
gk/jwt
1

Version matching

You can pass a version:

bash
vix remove gk/jwt@1.0.0
1

When a version is provided, Vix removes the dependency only if the locked dependency matches that version.

Vix checks:

txt
version
tag
1
2

If the lockfile uses a tag like:

txt
v1.0.0
1

then this still matches:

bash
vix remove gk/jwt@1.0.0
1

Lockfile requirement

vix remove requires:

txt
vix.lock
1

If the lockfile is missing, Vix reports:

txt
missing lock file: /path/to/project/vix.lock
Run: vix add <pkg>@<version> first
1
2

This command is lockfile-based.

Lockfile format

vix remove expects a lockfile with:

json
{
  "dependencies": [
    {
      "id": "gk/jwt",
      "version": "1.0.0"
    }
  ]
}
1
2
3
4
5
6
7
8

If the lockfile does not contain a dependencies array, Vix reports:

txt
invalid lock: missing 'dependencies' array
Tip: regenerate lock by re-adding dependencies
1
2

Remove from lockfile

Run:

bash
vix remove gk/jwt
1

Example output shape:

txt
Remove
id: gk/jwt
✔ removed from vix.lock: gk/jwt
✔ lock:  /home/user/api/vix.lock
⚠ Tip: run 'vix install' to regenerate .vix/vix_deps.cmake if needed.
1
2
3
4
5

Remove with version

Run:

bash
vix remove gk/jwt@1.0.0
1

Example output shape:

txt
Remove
id: gk/jwt
version: 1.0.0
✔ removed from vix.lock: gk/jwt
✔ lock:  /home/user/api/vix.lock
⚠ Tip: run 'vix install' to regenerate .vix/vix_deps.cmake if needed.
1
2
3
4
5
6

If the dependency exists but the version does not match, Vix reports:

txt
dependency not found in lock: gk/jwt
Tip: use 'vix list' to check current deps
1
2

Purge project-local files

Use --purge to delete the project-local dependency folder.

bash
vix remove gk/jwt --purge
1

For package:

txt
gk/jwt
1

Vix deletes:

txt
.vix/deps/gk.jwt
1

The folder format is:

txt
.vix/deps/<namespace>.<name>
1

Examples:

PackageProject-local dependency folder
gk/jwt.vix/deps/gk.jwt
gk/json.vix/deps/gk.json
adastra/http.vix/deps/adastra.http

Purge confirmation

When --purge is used, Vix asks for confirmation before deleting files.

Example:

txt
This will also delete files from this project:
/home/user/api/.vix/deps/gk.jwt
Type DELETE to confirm:
1
2
3

You must type:

txt
DELETE
1

If you type anything else, Vix cancels:

txt
cancelled
1

Skip purge confirmation

Use -y or --yes:

bash
vix remove gk/jwt --purge -y
1

or:

bash
vix remove gk/jwt --purge --yes
1

This skips confirmation and deletes the project-local dependency folder if it exists.

What --purge does not delete

--purge deletes the project-local dependency folder under:

txt
.vix/deps/
1

It does not delete the global Git store.

It does not delete registry metadata.

It does not delete a globally installed package.

For global packages, use the global uninstall workflow.

What files are affected

vix remove can affect:

txt
vix.lock
.vix/deps/<namespace>.<name>   # only with --purge
1
2

It may require regenerating:

txt
.vix/vix_deps.cmake
1

That is why Vix prints:

bash
vix install
1

after removal.

After removing a package

After removing a dependency, validate the project.

bash
vix install
vix build
vix check --tests
1
2
3

If your source code still includes headers from the removed package, the build will fail.

Remove those includes and target links.

Using remove with vix.app

For vix.app projects, check these places after removal:

txt
vix.lock
vix.json
vix.app
1
2
3

If the package is still declared in vix.app, remove it from:

ini
deps = [
  gk/jwt@^1.0.0,
]

links = [
  gk::jwt,
]
1
2
3
4
5
6
7

Example cleanup:

ini
deps = [
]

links = [
  vix::vix,
]
1
2
3
4
5
6

Then run:

bash
vix install
vix build
1
2

Using remove with CMake

For CMake projects, remove the dependency link if the target is no longer used.

Example before:

cmake
target_link_libraries(api PRIVATE
  gk::jwt
)
1
2
3

After:

cmake
target_link_libraries(api PRIVATE
)
1
2

Then regenerate dependency integration if needed:

bash
vix install
vix build
1
2

Difference between vix remove and vix uninstall

CommandPurpose
vix remove <pkg>Remove a locked dependency from the current project.
vix uninstall -g <pkg>Remove a globally installed package.

Use vix remove for project dependencies.

Use vix uninstall -g for global packages.

Difference between vix remove and manual cleanup

ActionResult
vix remove <pkg>Updates vix.lock.
vix remove <pkg> --purgeUpdates vix.lock and deletes .vix/deps/<namespace>.<name>.
manual delete from .vix/depsDeletes files but leaves lockfile unchanged.
manual edit of vix.lockNot recommended.

Prefer vix remove.

Full workflow

Remove the dependency:

bash
vix remove gk/jwt
1

Regenerate dependency integration:

bash
vix install
1

Remove usage from source code, vix.app, or CMake.

Validate:

bash
vix build
vix check --tests
1
2

Full purge workflow

bash
vix remove gk/jwt --purge -y
vix install
vix build
vix check --tests
1
2
3
4

Use --purge when you want to clean project-local dependency files too.

Options

OptionDescription
--purgeDelete local package files under .vix/deps/<namespace>.<name>.
-ySkip confirmation when using --purge.
--yesSame as -y.
-h, --helpShow command help.

Commands reference

CommandDescription
vix remove gk/jwtRemove gk/jwt from vix.lock.
vix remove @gk/jwtSame using scoped-style syntax.
vix remove gk/jwt@1.0.0Remove only if version matches.
vix remove @gk/jwt --purgeRemove and ask before deleting project-local files.
vix remove @gk/jwt --purge -yRemove and delete project-local files without confirmation.

Common workflows

Remove a dependency

bash
vix remove gk/jwt
vix install
vix build
1
2
3

Remove a scoped dependency

bash
vix remove @gk/jwt
vix install
vix build
1
2
3

Remove a specific version

bash
vix remove gk/jwt@1.0.0
vix install
vix build
1
2
3

Remove and purge files

bash
vix remove @gk/jwt --purge -y
vix install
vix build
1
2
3

Remove and validate

bash
vix remove gk/jwt
vix install
vix check --tests
1
2
3

Common mistakes

Expecting remove to unpublish a package

vix remove only affects the current project.

It does not remove anything from the registry.

Expecting remove to uninstall global packages

Wrong:

bash
vix remove gk/jwt
1

when you mean a global install.

Use the global uninstall command instead:

bash
vix uninstall -g gk/jwt
1

Expecting remove to update vix.json

The current command removes from vix.lock.

Check vix.json after removal.

If the dependency is still declared there, remove or update it intentionally.

Forgetting to update vix.app

For vix.app projects, also remove unused entries from:

txt
deps
links
1
2

Forgetting to update CMake

For CMake projects, remove unused target links such as:

cmake
target_link_libraries(api PRIVATE gk::jwt)
1

Forgetting to update source code

After removing a dependency, remove includes such as:

cpp
#include <jwt/api.hpp>
1

Then run:

bash
vix check --tests
1

Forgetting to regenerate dependency integration

After changing dependency state, run:

bash
vix install
1

This regenerates:

txt
.vix/vix_deps.cmake
1

Using wrong package format

Wrong:

bash
vix remove jwt
1

Correct:

bash
vix remove gk/jwt
1

Troubleshooting

Missing package id

If you run:

bash
vix remove
1

Vix reports a missing package id and shows help.

Use:

bash
vix remove namespace/name
1

Example:

bash
vix remove gk/jwt
1

Package id cannot be empty

Use a valid package id:

txt
namespace/name
1

Valid:

bash
vix remove gk/jwt
vix remove @gk/jwt
1
2

Invalid:

bash
vix remove jwt
vix remove @/jwt
vix remove gk/
1
2
3

Missing lock file

If Vix reports:

txt
missing lock file
1

the project has no vix.lock.

Check the current directory.

If this is a Vix project with dependencies, recreate dependency state:

bash
vix add <pkg>
1

or restore vix.lock from version control.

Invalid lockfile

If Vix reports:

txt
invalid lock: missing 'dependencies' array
1

regenerate the lockfile by re-adding dependencies or restoring a valid lockfile.

Dependency not found in lock

If Vix reports:

txt
dependency not found in lock: gk/jwt
1

check current dependencies:

bash
vix list
1

The package may already be removed, or the id may be different.

Purge cancelled

When using --purge, type exactly:

txt
DELETE
1

or pass:

bash
-y
1

if you intentionally want to skip confirmation.

Failed to delete project-local files

If Vix reports:

txt
failed to delete: .vix/deps/gk.jwt
1

check permissions:

bash
ls -ld .vix/deps/gk.jwt
1

Then fix ownership or remove manually if needed.

Best practices

Use vix list before removing dependencies.

Remove the dependency from source code before or after running vix remove.

For vix.app, remove unused package specs from deps.

For vix.app, remove unused CMake aliases from links.

For CMake, remove unused target_link_libraries entries.

Run vix install after removing dependencies.

Run vix build after removal.

Run vix check --tests before committing.

Use --purge when you want to clean .vix/deps.

Do not manually edit vix.lock.

Do not confuse project dependencies with global packages.

CommandPurpose
vix addAdd a project dependency.
vix installInstall dependencies from vix.lock.
vix updateUpdate dependency versions.
vix outdatedCheck outdated dependencies.
vix listList project dependencies.
vix installRegenerate dependency integration files.
vix uninstallRemove Vix or a global package.
vix checkValidate after removing dependencies.

Next step

List project dependencies.

Open the vix list guide

Released under the MIT License.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.