Developer Tools

vpackage-cli

The command line face of the package manager.

Released v1.0.0 · 2026-09-28
Import
use "stdlib/package_cli.ven"

The command line side of the package manager: the commands you type, from install to verify.

vpackage-cli.ven
print strip_archive_extension("foo.tar.gz")
Reference (24 functions)

API reference

strip_archive_extension(name)

strip_archive_extension("foo.tar.gz")

trim_trailing_slash(path)

Strips one trailing / off path, unless path is just "/" itself.

trim_trailing_slash("vendor/libs/")

is_archive_path(location)

Tests whether location looks like a supported archive file.

is_archive_path("libs/foo.tgz")

name_flag_value(args)

name_flag_value(["mylib", "--name", "renamed"])

positional_args(args)

positional_args(["mylib", "--name", "renamed", "extra"])

flag_value(args, flag_name)

Gives back the value that follows flag_name in args, if present.

flag_value(["mylib", "--registry", "/tmp/reg"], "--registry")

positional_args_excluding_flag(args, flag_name)

Gives back args with flag_name and its following value removed.

positional_args_excluding_flag(["mylib", "--registry", "/tmp/reg", "1.0.0"], "--registry")

registry_dir_for(project_dir, args)

Picks the local registry directory publish or fetch should use.

registry_dir_for("/proj", ["--registry", "/custom/reg"])

manifest_path_for(project_dir)

Gives back the path to project_dirs own venutian.json manifest.

manifest_path_for("/proj")

packages_dir_for(project_dir)

Gives back the path to project_dirs installed-packages directory.

packages_dir_for("/proj")

lockfile_path_for(project_dir)

Gives back the path to project_dirs own lockfile.

lockfile_path_for("/proj")

load_or_new_manifest(project_dir)

Loads project_dirs existing manifest, or starts a fresh one.

load_or_new_manifest("/proj")

results_for_names(names, packages_dir)

Builds one "name"/"destination" result map per name in names.

results_for_names(["mylib", "otherlib"], "/proj/venutian_packages")

install_from_manifest(project_dir, packages_dir)

venutian install with no source: reinstalls everything already declared in this project's own venutian.json, transitively.

install_from_manifest(".", "venutian_packages")
:: prints "Installed 2 package(s):" followed by one line per package

install_one(location, name_override, project_dir, packages_dir)

venutian install <path-or-archive>: records the dependency in this project's venutian.json (creating one if this is the first package added), then installs it right away.

install_one("../my-local-package", nothing, ".", "venutian_packages")
:: adds "my-local-package" to venutian.json and installs it

cmd_install(args)

cmd_install([])
:: reinstalls every dependency in venutian.json

cmd_uninstall(args)

Handles the venutian uninstall <name> verb: removes an installed package from venutian_packages/ by name.

cmd_uninstall(["my-local-package"])
:: prints "Removed my-local-package." (or "my-local-package is not installed.")

cmd_list(args)

Handles the venutian list verb: prints every package name currently installed under venutian_packages/, one per line, alphabetically.

cmd_list([])
::   my-local-package
::   requests-clone

cmd_lock(args)

Handles the venutian lock verb: writes venutian.lock.json, recording a content hash for every package currently installed under venutian_packages/, so a later cmd_verify can detect drift.

cmd_lock([])
:: prints "Wrote venutian.lock.json (2 package(s) locked)."

cmd_verify(args)

Handles the venutian verify verb: re-checks every package listed in venutian.lock.json against what is actually installed under venutian_packages/ right now, and fails loudly (raises) if anything drifted since the lockfile was written.

cmd_verify([])
:: prints a per-package verify summary; raises if anything drifted

cmd_publish(args)

cmd_publish(["../my-package", "my-package", "1.0.0"])
:: prints "Published my-package 1.0.0 -> ./venutian_registry/my-package/1.0.0"

cmd_fetch(args)

cmd_fetch(["my-package"])
:: prints "  + my-package 1.0.0 -> venutian_packages/my-package"

print_usage()

Prints the package manager's usage help: one line per verb (install, uninstall, list, lock, verify, publish, fetch), shown when run_package_cli is called with no arguments or an unrecognized verb.

print_usage()
:: prints the multi-line usage block starting "Venutian's package manager."

run_package_cli(all_args)

run_package_cli(["list"])
:: prints every installed package name

Get notified when vpackage-cli changes

Get notified about

New versions and security advisories.

New and updated packages, once a day.

News on the math model built in Venutian.