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

vix pack

vix pack packages a Vix project into a distributable folder and, on Unix-like systems, optionally creates a .vixpkg archive.

Use it when you want to prepare a project for sharing, verification, caching, release workflows, or deployment pipelines.

bash
vix pack
1

Overview

vix pack creates a package under:

txt
dist/<name>@<version>
1

On Linux and macOS, it can also create:

txt
dist/<name>@<version>.vixpkg
1

The generated package uses the Vix manifest v2 format:

txt
manifest.json
1

The package can include:

txt
include/
src/
lib/
modules/
tests/
meta/
README.md
CMakeLists.txt
CMakePresets.json
vix.toml
LICENSE
checksums.sha256
manifest.json
1
2
3
4
5
6
7
8
9
10
11
12
13

Usage

bash
vix pack [options]
1

Basic examples

bash
# Package the current project
vix pack

# Package with explicit name and version
vix pack --name blog --version 1.0.0

# Package another project directory
vix pack --dir ./my-lib

# Write output to another directory
vix pack --out ./artifacts

# Print copied files and signing details
vix pack --verbose

# Create only the folder package
vix pack --no-zip

# Skip checksums.sha256
vix pack --no-hash

# Disable signing
vix pack --sign=never

# Require signing
VIX_MINISIGN_SECKEY=./keys/vix-pack.key vix pack --sign=required
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

Project requirement

vix pack currently requires a project with:

txt
CMakeLists.txt
1

If no CMakeLists.txt exists, Vix reports:

txt
No CMakeLists.txt found in: <project>
Run from a Vix project folder or use: vix pack --dir <path>
1
2

This means vix pack currently packages CMake-backed Vix projects.

Output layout

Default output directory:

txt
<project>/dist
1

Default package folder:

txt
<project>/dist/<name>@<version>
1

Default archive on Linux/macOS:

txt
<project>/dist/<name>@<version>.vixpkg
1

Example:

bash
vix pack --name blog --version 1.0.0
1

Output:

txt
dist/
├── blog@1.0.0/
│   ├── include/
│   ├── src/
│   ├── meta/
│   ├── CMakeLists.txt
│   ├── manifest.json
│   └── checksums.sha256
└── blog@1.0.0.vixpkg
1
2
3
4
5
6
7
8
9

Default name and version

If no name is passed, Vix uses the project folder name.

Example:

txt
/home/user/projects/blog
1

Default package name:

txt
blog
1

If no version is passed, Vix uses:

txt
0.1.0
1

So:

bash
vix pack
1

can create:

txt
dist/blog@0.1.0
1

Custom output directory

Use:

bash
vix pack --out ./artifacts
1

Example:

bash
vix pack --out ./artifacts --name blog --version 1.0.0
1

Output:

txt
artifacts/blog@1.0.0
artifacts/blog@1.0.0.vixpkg
1
2

Custom project directory

Use:

bash
vix pack --dir ./my-lib
1

or:

bash
vix pack -d ./my-lib
1

This packages another project without changing your current shell directory.

What gets copied

vix pack copies these directories when they exist:

txt
include/
src/
lib/
modules/
tests/
1
2
3
4
5

It also copies these root files when they exist:

txt
README.md
CMakeLists.txt
CMakePresets.json
vix.toml
LICENSE
1
2
3
4
5

README.md is copied into:

txt
meta/README.md
1

CMakeLists.txt, CMakePresets.json, vix.toml, and LICENSE are copied to the package root.

Verbose copy output

Use:

bash
vix pack --verbose
1

This prints copied files and signing output when signing is used.

Example output shape:

txt
vix pack
Project:
  /home/user/blog
Output:
  /home/user/blog/dist
Packaging:
  blog@1.0.0
copied: include/blog.hpp
copied: src/blog.cpp
copied: CMakeLists.txt
1
2
3
4
5
6
7
8
9
10

Existing package folder

If the target package folder already exists, Vix removes it before creating the new package.

Example:

txt
dist/blog@1.0.0
1

is removed and recreated when you run:

bash
vix pack --name blog --version 1.0.0
1

Manifest v2

vix pack writes:

txt
manifest.json
1

The manifest schema is:

txt
vix.manifest.v2
1

The manifest contains package metadata, ABI info, exports, dependencies, toolchain info, layout information, payload digest, signature metadata, and checksums.

Example shape:

json
{
  "schema": "vix.manifest.v2",
  "package": {
    "name": "blog",
    "version": "1.0.0",
    "kind": "package",
    "license": "MIT"
  },
  "abi": {
    "os": "linux",
    "arch": "x86_64"
  },
  "exports": ["blog"],
  "dependencies": {},
  "toolchain": {
    "cxx": {
      "path": "c++",
      "version": "c++ (Ubuntu 13.3.0) ...",
      "standard": "c++23"
    },
    "cmake": {
      "version": "cmake version ...",
      "generator": "presets"
    }
  },
  "layout": {
    "include": true,
    "src": true,
    "lib": false,
    "modules": false,
    "readme": true
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

Metadata from vix.toml

If the project has:

txt
vix.toml
1

vix pack reads package metadata from it.

Supported sections include:

txt
[package]
[exports]
[dependencies]
[toolchain]
1
2
3
4

[package]

Example:

toml
[package]
name = "blog"
version = "1.0.0"
kind = "library"
license = "MIT"
1
2
3
4
5

Supported fields:

FieldPurpose
namePackage name.
versionPackage version.
kindPackage kind.
licensePackage license.

CLI options can still provide name and version defaults, but vix.toml is used by the manifest writer when present.

[exports]

Example:

toml
[exports]
items = ["blog", "blog/http"]
1
2

If no exports are defined, Vix uses the package name as the default export.

[dependencies]

Example:

toml
[dependencies]
softadastra.core = "^1.0.0"
1
2

Dependencies are written into manifest.json.

[toolchain]

Example:

toml
[toolchain]
cxx_standard = "c++23"
cmake_generator = "Ninja"
1
2
3

If no C++ standard is provided, Vix uses:

txt
c++23
1

If CMakePresets.json exists and no generator is set, Vix can mark the generator as:

txt
presets
1

ABI metadata

The manifest includes ABI information.

OS values include:

txt
linux
macos
windows
1
2
3

Architecture values include:

txt
x86_64
arm64
x86
unknown
1
2
3
4

Example:

json
{
  "abi": {
    "os": "linux",
    "arch": "x86_64"
  }
}
1
2
3
4
5
6

Payload digest

On Linux and macOS, vix pack creates:

txt
meta/payload.digest
1

The payload digest is computed from a stable SHA256 listing of package files.

These files are excluded from the payload digest to avoid self-referential hashes:

txt
manifest.json
checksums.sha256
meta/payload.digest
meta/payload.digest.minisig
1
2
3
4

The digest is also recorded in manifest.json.

Example:

json
{
  "payload": {
    "digest_algorithm": "sha256",
    "digest": "...",
    "digest_available": true,
    "excludes": [
      "manifest.json",
      "checksums.sha256",
      "meta/payload.digest",
      "meta/payload.digest.minisig"
    ]
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13

Checksums

On Linux and macOS, vix pack writes:

txt
checksums.sha256
1

unless you pass:

bash
vix pack --no-hash
1

The checksum file excludes:

txt
checksums.sha256
manifest.json
1
2

This avoids self-referential checksum problems.

Disable checksums

Use:

bash
vix pack --no-hash
1

This skips checksums.sha256.

The package still gets manifest.json.

Archive creation

On Linux and macOS, Vix tries to create:

txt
dist/<name>@<version>.vixpkg
1

using the zip command.

If zip is missing or fails, Vix keeps the folder package and prints a hint.

Example:

txt
zip tool not available (or zip failed). Keeping folder package instead.
You can install zip, or use: vix pack --no-zip
1
2

Folder-only package

Use:

bash
vix pack --no-zip
1

This creates only:

txt
dist/<name>@<version>
1

No .vixpkg archive is created.

Windows behavior

On Windows, vix pack currently creates the folder package only.

It writes:

txt
manifest.json
1

but does not create the .vixpkg archive in the current implementation.

Example output:

txt
Package folder created:
dist/blog@1.0.0
1
2

Signing

Signing is optional.

On Linux and macOS, vix pack can sign:

txt
meta/payload.digest
1

with minisign.

The signature file is:

txt
meta/payload.digest.minisig
1

The manifest records signature metadata but does not embed the signature content.

Signing modes

--sign supports:

txt
auto
never
required
1
2
3
ModeBehavior
autoSign if minisign and a signing key are available. Never blocks for passphrase.
neverDo not sign.
requiredSigning must succeed or packaging fails.

Default:

txt
auto
1

--sign

Passing:

bash
vix pack --sign
1

is the same as required signing.

It requires minisign and a signing key.

--sign=auto

Use:

bash
vix pack --sign=auto
1

In auto mode, Vix signs only when possible.

Auto mode does not block for an interactive passphrase.

If signing needs a passphrase, signing is skipped in auto mode.

With --verbose, Vix may print:

txt
Signing skipped (auto): needs passphrase or minisign failed.
1

--sign=never

Use:

bash
vix pack --sign=never
1

This disables signing.

The manifest records signature as disabled.

--sign=required

Use:

bash
vix pack --sign=required
1

This requires signing.

If minisign is missing or no key is available, Vix fails.

Example error shape:

txt
pack: signing required but unavailable: minisign not found
Install minisign and/or set VIX_MINISIGN_SECKEY=/path/to/key
1
2

Signing key

Set the signing key with:

bash
VIX_MINISIGN_SECKEY=./keys/vix-pack.key vix pack --sign=required
1

Environment variable:

txt
VIX_MINISIGN_SECKEY
1

On Unix-like systems, auto mode can also look for default keys:

txt
~/.config/vix/keys/vix-pack.key
~/keys/vix/vix-pack.key
1
2

Required signing output

Example:

bash
VIX_MINISIGN_SECKEY=./keys/vix-pack.key vix pack --sign=required
1

Output shape:

txt
Signing:
  mode: required
  tool: minisign (ed25519)
  key: ./keys/vix-pack.key
  file: meta/payload.digest
  minisign may prompt for the private key passphrase.
1
2
3
4
5
6

If signing succeeds, the package includes:

txt
meta/payload.digest.minisig
1

Manifest signature section

Example:

json
{
  "signature": {
    "enabled": true,
    "algorithm": "ed25519",
    "tool": "minisign",
    "signed": "meta/payload.digest",
    "file": "meta/payload.digest.minisig"
  }
}
1
2
3
4
5
6
7
8
9

If signing is disabled or skipped:

json
{
  "signature": {
    "enabled": false,
    "algorithm": "ed25519",
    "tool": "minisign",
    "signed": "meta/payload.digest",
    "file": "meta/payload.digest.minisig"
  }
}
1
2
3
4
5
6
7
8
9

Required tools on Unix

For full Unix packaging behavior, these tools are useful:

txt
sha256sum
zip
minisign
1
2
3

Required for checksums:

txt
sha256sum
1

Required for .vixpkg archive:

txt
zip
1

Required for signing:

txt
minisign
1

If zip is missing, Vix can still create the folder package.

If minisign is missing in auto mode, Vix can still package without signing.

If minisign is missing in required mode, Vix fails.

bash
vix build --preset release
vix check --tests
vix pack --name blog --version 1.0.0
vix verify --path ./dist/blog@1.0.0
1
2
3
4

If an archive was created:

bash
vix verify --path ./dist/blog@1.0.0.vixpkg
1

Release flow with signing

bash
vix build --preset release
vix check --tests
VIX_MINISIGN_SECKEY=./keys/vix-pack.key vix pack --name blog --version 1.0.0 --sign=required
vix verify --path ./dist/blog@1.0.0
1
2
3
4

Package folder flow

bash
vix pack --no-zip
vix verify --path ./dist/blog@0.1.0
1
2

Use this when you want an unpacked package folder.

Package archive flow

bash
vix pack
vix verify --path ./dist/blog@0.1.0.vixpkg
1
2

Use this when you want a single distributable .vixpkg file.

Options

OptionDescription
-d, --dir <path>Project directory. Default: current directory.
--out <path>Output directory. Default: <project>/dist.
--name <name>Package name. Default: project folder name.
--version <ver>Package version. Default: 0.1.0.
--no-zipDo not create .vixpkg; create folder package only.
--no-hashDo not generate checksums.sha256.
--verboseShow copied files and minisign output when used.
--signRequire signing. Same as --sign=required.
--sign=autoSign when possible without blocking. Default mode.
--sign=neverDisable signing.
--sign=requiredFail if signing cannot be completed.
-h, --helpShow command help.

Environment variables

VariableDescription
VIX_MINISIGN_SECKEYSecret key path used to sign meta/payload.digest.
CXXCompiler path recorded in manifest toolchain metadata.
CMAKE_GENERATORCMake generator recorded in manifest metadata when set.

Commands reference

CommandDescription
vix packPackage current project with default name and version.
vix pack --name blog --version 1.0.0Package as blog@1.0.0.
vix pack --dir ./my-libPackage another project directory.
vix pack --out ./artifactsWrite package output to ./artifacts.
vix pack --no-zipCreate folder package only.
vix pack --no-hashSkip checksums.sha256.
vix pack --verboseShow copied files and signing details.
vix pack --sign=neverPackage without signing.
vix pack --sign=requiredRequire minisign signing.

Common workflows

Package current project

bash
vix pack
1

Package with explicit name and version

bash
vix pack --name blog --version 1.0.0
1

Package to artifacts folder

bash
vix pack --out ./artifacts --name blog --version 1.0.0
1

Package another project

bash
vix pack --dir ../my-lib --name my-lib --version 1.0.0
1

Package folder only

bash
vix pack --no-zip
1

Package without signing

bash
vix pack --sign=never
1

Package with required signing

bash
VIX_MINISIGN_SECKEY=./keys/vix-pack.key vix pack --sign=required
1

Package and verify

bash
vix pack --name blog --version 1.0.0
vix verify --path ./dist/blog@1.0.0
1
2

Common mistakes

Running outside a CMake-backed project

Wrong:

bash
cd /tmp
vix pack
1
2

Correct:

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

The project must contain:

txt
CMakeLists.txt
1

Packing before building

For release workflows, build first:

bash
vix build --preset release
vix check --tests
vix pack --name blog --version 1.0.0
1
2
3

Forgetting to verify

After packing, verify the output:

bash
vix verify --path ./dist/blog@1.0.0
1

or:

bash
vix verify --path ./dist/blog@1.0.0.vixpkg
1

Requiring signing without a key

Wrong:

bash
vix pack --sign=required
1

when no key is configured.

Correct:

bash
VIX_MINISIGN_SECKEY=./keys/vix-pack.key vix pack --sign=required
1

Expecting auto signing to prompt for a passphrase

Auto mode does not block for a passphrase.

Use required signing when you want interactive signing:

bash
vix pack --sign=required
1

Expecting .vixpkg without zip

On Linux/macOS, .vixpkg creation needs zip.

If zip is missing, Vix keeps the folder package.

Install zip or use:

bash
vix pack --no-zip
1

Expecting .vixpkg on Windows

The current Windows path creates a folder package only.

Use the generated folder:

txt
dist/<name>@<version>
1

Expecting --no-hash to remove manifest integrity metadata

--no-hash skips checksums.sha256.

The manifest is still generated.

The payload digest can still exist on Unix-like systems.

Troubleshooting

No CMakeLists.txt found

Run from the project root or pass --dir:

bash
vix pack --dir /path/to/project
1

Unable to create output directory

Check permissions for the output path:

bash
vix pack --out ./artifacts
1

Failed to copy file

Check file permissions and whether the destination is writable.

Retry with:

bash
vix pack --verbose
1

to see which file was being copied.

Zip tool not available

Install zip or use:

bash
vix pack --no-zip
1

Signing required but minisign not found

Install minisign, then retry:

bash
VIX_MINISIGN_SECKEY=./keys/vix-pack.key vix pack --sign=required
1

Signing required but no key found

Set:

bash
VIX_MINISIGN_SECKEY=/path/to/key
1

Then run:

bash
vix pack --sign=required
1

Minisign failed

Check that the key path is correct and that you entered the correct passphrase.

Use:

bash
vix pack --sign=required --verbose
1

checksums.sha256 missing

If you passed:

bash
vix pack --no-hash
1

then checksums.sha256 is intentionally skipped.

If you did not pass --no-hash, make sure sha256sum is available on Unix-like systems.

Best practices

Build before packing release artifacts.

Run tests before packing.

Use explicit --name and --version for releases.

Use --out ./artifacts in CI.

Use --verbose when debugging packaging.

Use --sign=required for serious release artifacts.

Use --sign=never for local test packages when signing is not needed.

Run vix verify after vix pack.

Keep vix.toml accurate so manifest.json contains useful metadata.

Do not edit generated manifest.json manually.

CommandPurpose
vix verifyVerify a package folder or artifact.
vix cacheStore a package locally.
vix buildBuild before packaging.
vix checkValidate before packaging.
vix taskAutomate release workflows.
vix publishPublish a tagged package version to the registry.

Next step

Verify a package artifact.

Open the vix verify guide

Released under the MIT License.

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