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

vix list

vix list lists project dependencies or globally installed packages.

Use it when you want to inspect the dependencies locked by the current project or the packages installed globally in your Vix environment.

bash
vix list
1

Overview

vix list has two modes:

txt
project mode
global mode
1
2

Project mode reads the current project lockfile:

bash
vix list
1

Global mode reads the global package manifest:

bash
vix list -g
1

or:

bash
vix list --global
1

The command only lists package state. It does not install anything. It does not update anything. It does not check whether packages are outdated.

Usage

bash
vix list
vix list -g
vix list --global
1
2
3

Basic examples

bash
# List project dependencies from vix.lock
vix list

# List globally installed packages
vix list -g

# Same as -g
vix list --global
1
2
3
4
5
6
7
8

Modes

ModeCommandReads fromScope
Project modevix list./vix.lockCurrent project
Global modevix list -g~/.vix/global/installed.jsonGlobal Vix environment

Project dependencies

Run from inside a project folder:

bash
vix list
1

Vix reads:

txt
./vix.lock
1

Example output shape:

txt
Project dependencies
lock: /home/user/api/vix.lock

gk/json  1.0.0
commit: 8f3a9c4...
repo: https://github.com/gk/json

gk/jwt  1.2.0
commit: 5d1b7c2...
repo: https://github.com/gk/jwt

✔ Found 2 dependency(ies).
1
2
3
4
5
6
7
8
9
10
11
12

Project lockfile requirement

Project mode requires:

txt
vix.lock
1

If the lockfile is missing, Vix reports:

txt
missing lock file: /path/to/project/vix.lock
Tip: add a package with: vix add <pkg>@<version>
1
2

Fix it by adding or resolving dependencies:

bash
vix registry sync
vix add gk/json
vix install
vix list
1
2
3
4

Or, if the project already has a committed lockfile, restore it from version control.

Supported project lockfile shapes

vix list supports two project lockfile shapes.

Array shape:

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

Object shape:

json
{
  "lockVersion": 1,
  "dependencies": [
    {
      "id": "gk/json",
      "version": "1.0.0",
      "repo": "https://github.com/gk/json",
      "tag": "v1.0.0",
      "commit": "8f3a9c4..."
    }
  ]
}
1
2
3
4
5
6
7
8
9
10
11
12

If the lockfile does not match one of these shapes, Vix reports:

txt
invalid lock: expected array or { dependencies: [] }
1

Displayed project fields

For each dependency, Vix can display:

FieldSource
package idid
versionversion or tag
commitcommit
repositoryrepo

If version is missing but tag exists, Vix derives the version from the tag.

Example:

json
{
  "tag": "v1.0.0"
}
1
2
3

is displayed as:

txt
1.0.0
1

Empty project dependencies

If vix.lock exists but contains no dependencies, Vix prints:

txt
No dependencies.
1

This means the project has no locked registry dependencies.

Global packages

Run:

bash
vix list -g
1

or:

bash
vix list --global
1

Vix reads:

txt
~/.vix/global/installed.json
1

Example output shape:

txt
Global packages

gk/json  1.0.0
commit: 8f3a9c4...
repo: https://github.com/gk/json
type: header-only
include: include

✔ Found 1 global package(s).
1
2
3
4
5
6
7
8
9

Global manifest path

Global packages are tracked in:

txt
~/.vix/global/installed.json
1

The manifest has this shape:

json
{
  "packages": [
    {
      "id": "gk/json",
      "version": "1.0.0",
      "repo": "https://github.com/gk/json",
      "tag": "v1.0.0",
      "commit": "8f3a9c4...",
      "type": "header-only",
      "include": "include",
      "installed_path": "/home/user/.vix/global/packages/gk.json/8f3a9c4..."
    }
  ]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14

No global packages

If no global manifest exists, Vix prints:

txt
No global packages installed.
1

If the manifest exists but the packages array is empty, Vix also prints:

txt
No global packages installed.
1

Invalid global manifest

Global mode expects:

json
{
  "packages": []
}
1
2
3

If the manifest does not contain a valid packages array, Vix reports:

txt
invalid global manifest: expected { packages: [] }
1

Displayed global fields

For global packages, Vix displays the normal dependency fields:

txt
id
version
commit
repo
1
2
3
4

It also displays:

txt
type
include
1
2

when available.

Example:

txt
type: header-only
include: include
1
2

These fields come from the package metadata read during global installation or upgrade.

Project vs global packages

Project dependencies and global packages are different.

Project dependencies belong to the current project and are pinned in:

txt
vix.lock
1

Global packages belong to the user’s Vix environment and are tracked in:

txt
~/.vix/global/installed.json
1

Use project dependencies for normal application or library builds.

Use global packages for packages you intentionally install globally.

Difference between vix list and vix outdated

CommandPurpose
vix listShow what is currently locked or globally installed.
vix outdatedCompare locked project dependencies against registry latest versions.

Use vix list to inspect current state.

Use vix outdated to check whether project dependencies are behind.

Difference between vix list and vix install

CommandPurpose
vix listRead and display dependency state.
vix installInstall exact dependencies from vix.lock.

vix list does not install missing dependencies.

If dependency files are missing, run:

bash
vix install
1
CommandPurpose
vix listShow dependencies already locked or installed.
vix searchSearch packages in the local registry index.

Use vix search when you want to discover packages.

Use vix list when you want to inspect your current project or global state.

Add and list workflow

bash
vix registry sync
vix add gk/json
vix install
vix list
1
2
3
4

This shows the dependency after it has been added and locked.

Update and list workflow

bash
vix outdated
vix update --install
vix list
1
2
3

This lets you inspect the project after updating dependency versions.

Remove and list workflow

bash
vix remove gk/json
vix install
vix list
1
2
3

This lets you confirm the dependency is no longer present in the lockfile.

Global package workflow

Install globally:

bash
vix registry sync
vix install -g gk/json
1
2

List global packages:

bash
vix list -g
1

Upgrade global package:

bash
vix upgrade -g gk/json
1

Remove global package:

bash
vix uninstall -g gk/json
1

List again:

bash
vix list -g
1

CI usage

In CI, vix list can be useful for debugging dependency state.

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

For normal CI validation, vix install and vix check --tests matter more.

vix list is mainly informational.

Options

OptionDescription
-gList globally installed packages.
--globalSame as -g.
-h, --helpShow command help.

Commands reference

CommandDescription
vix listList project dependencies from vix.lock.
vix list -gList globally installed packages.
vix list --globalSame as vix list -g.

Common workflows

List project dependencies

bash
vix list
1

List global packages

bash
vix list -g
1

Add and list

bash
vix add gk/json
vix install
vix list
1
2
3

Update and list

bash
vix update --install
vix list
1
2

Remove and list

bash
vix remove gk/json
vix install
vix list
1
2
3

Install and inspect after clone

bash
git clone https://github.com/example/api.git
cd api
vix install
vix list
1
2
3
4

Common mistakes

Running project list outside a project

Wrong:

bash
cd /tmp
vix list
1
2

Correct:

bash
cd /path/to/project
vix list
1
2

Project mode needs:

txt
vix.lock
1

Expecting vix list to check latest versions

vix list only shows current dependency state.

To check for newer versions:

bash
vix registry sync
vix outdated
1
2

Expecting vix list to install dependencies

vix list does not install anything.

To install locked dependencies:

bash
vix install
1

Confusing project and global packages

Project packages:

bash
vix list
1

Global packages:

bash
vix list -g
1

Expecting global packages to appear in project list

Global packages are not project dependencies.

If a project needs a package, add it to the project:

bash
vix add gk/json
vix install
1
2

Expecting project dependencies to appear in global list

Project dependencies are not global installs.

Use:

bash
vix list
1

inside the project.

Troubleshooting

Missing lock file

If Vix reports:

txt
missing lock file
1

run the command from a Vix project folder or create dependency state:

bash
vix add gk/json
vix install
1
2

Failed to read lock

If Vix reports:

txt
failed to read lock
1

the lockfile may be invalid JSON or unreadable.

Check:

bash
cat vix.lock
1

Then regenerate or restore it.

Invalid lock

If Vix reports:

txt
invalid lock: expected array or { dependencies: [] }
1

make sure vix.lock has either an array or an object with a dependencies array.

No dependencies

If Vix prints:

txt
No dependencies.
1

the project lockfile exists but has no dependencies.

This is valid for projects that do not use registry packages.

No global packages installed

If Vix prints:

txt
No global packages installed.
1

there is no global package state yet.

Install a global package with:

bash
vix install -g gk/json
1

Failed to read global manifest

If Vix reports:

txt
failed to read manifest
1

check:

txt
~/.vix/global/installed.json
1

It may be unreadable or malformed.

Invalid global manifest

The global manifest must contain:

json
{
  "packages": []
}
1
2
3

If it is corrupted, reinstall or clean global package state intentionally.

Best practices

Run vix list after adding, updating, or removing project dependencies.

Use vix list -g before upgrading or uninstalling global packages.

Use vix outdated when you need update information.

Use vix install after cloning a project.

Commit vix.lock.

Do not manually edit vix.lock.

Do not confuse global packages with project dependencies.

CommandPurpose
vix addAdd a project dependency.
vix installInstall dependencies from vix.lock.
vix updateUpdate project dependencies.
vix outdatedCheck outdated project dependencies.
vix removeRemove a project dependency.
vix searchSearch packages in the local registry.
vix registry syncRefresh local registry metadata.
vix install -gInstall a global package.
vix upgrade -gUpgrade a global package.
vix uninstall -gRemove a global package.

Next step

Continue with packaging.

Open the vix pack guide

Released under the MIT License.

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