README
¶
zvk
Cross-platform multi-toolchain version manager and SSH key manager, written in
Go. Single binary, runs on macOS, Linux, and Windows. Everything lives under
~/.zvk/ (override with ZVK_ROOT).
zvk zig install # install the latest stable zig
zvk zig install nightly # install the latest nightly zig
zvk go install # install the latest stable go
zvk node install # install the latest LTS node
zvk ssh keygen # generate an ed25519 keypair
Install
zvk installs itself from source: the installer always downloads the latest
Go into the directory zvk manages (~/.zvk/go/versions/<ver>/) — never reusing
a system go — then builds zvk with it via go install github.com/zoptia/zvk@latest. That same Go becomes zvk's default go. The
resulting binary is compiled locally — it carries no Mark-of-the-Web, so it
avoids the SmartScreen/Gatekeeper prompts that hit downloaded executables, and
its sources are hash-verified through sum.golang.org (GOSUMDB).
If a non-zvk go (or node) is already on your PATH, zvk leaves it untouched
and prints an advisory with the command to remove it — zvk's own bin/ is
prepended to PATH, so the managed copy wins in new shells regardless.
macOS / Linux
curl -fsSL https://raw.githubusercontent.com/zoptia/zvk/main/install.sh | sh
Windows (PowerShell)
irm https://raw.githubusercontent.com/zoptia/zvk/main/install.ps1 | iex
The installer puts the zvk binary into ~/.zvk/bin/, adds that directory to
PATH, promotes the freshly downloaded Go to the stable channel, and runs zvk zig install to pull the latest stable Zig.
Behind a firewall, set a module proxy first:
export GOPROXY=https://<your-proxy>,direct(PowerShell:$env:GOPROXY=...).ZVK_GO_SITEandZVK_GO_MIRRORredirect the Go release index and archive downloads, e.g.ZVK_GO_MIRROR=https://dl.google.com/go/.
Update
Updating zvk is just re-running the installer, and self-update is a
convenience that does exactly that — it downloads the canonical
install.sh/install.ps1 and runs it. Keeping the real logic in one place
means there is a single update path that cannot drift from the install path.
zvk self-update # re-run the installer for the latest release
zvk self-update --version=v0.2.0
zvk self-update --dry-run # show what it would do
# equivalently, just re-run the installer:
curl -fsSL https://raw.githubusercontent.com/zoptia/zvk/main/install.sh | sh
Commands
zvk zig install [release|nightly]
zvk zig update [release|nightly|all]
zvk zig use <channel> <version>
zvk zig uninstall <version>
zvk zig list
zvk zig which [channel]
zvk zig status [--json]
zvk go install [<version>|latest]
zvk go update
zvk go use <version>
zvk go uninstall <version>
zvk go list [--remote]
zvk go which
zvk go status [--json]
zvk node install [lts|current|<version>]
zvk node update
zvk node use <version>
zvk node uninstall <version>
zvk node list [--remote]
zvk node which
zvk node status [--json]
zvk app list
zvk app install <homebrew|claude-code|winget|scoop>
zvk app uninstall <name>
zvk ssh keygen [--name N] [--comment C] [--force]
zvk ssh list
zvk ssh show <name> [--private]
zvk ssh remove <name>
zvk ssh add <name> # invoke ssh-add to load into ssh-agent
zvk ssh copy <name> # copy the public key to the system clipboard
zvk ssh path [<name>]
zvk status [--json]
zvk self-install
zvk self-update [--dry-run] [--version=<v>]
zvk version
zvk help
On-disk layout
~/.zvk/
├── bin/
│ ├── zvk # the manager itself
│ ├── zig → ../zig/channels/release/zig
│ ├── zig-nightly → ../zig/channels/nightly/zig
│ ├── go → ../go/channels/stable/bin/go
│ ├── gofmt → ../go/channels/stable/bin/gofmt
│ ├── node → ../node/channels/default/bin/node
│ ├── npm → ../node/channels/default/bin/npm
│ └── npx → ../node/channels/default/bin/npx
├── zig/
│ ├── channels/{release,nightly} # → ../versions/<ver>
│ └── versions/<ver>/
├── go/
│ ├── channels/stable # → ../versions/<ver>
│ └── versions/<ver>/ # top level is the unpacked go/ contents
├── node/
│ ├── channels/default # → ../versions/<ver>
│ └── versions/<ver>/
└── ssh/
└── keys/
├── id_ed25519_xxxxxxxx
└── id_ed25519_xxxxxxxx.pub
How it works
Zig
- Fetch https://ziglang.org/download/index.json for the latest version, tarball URL, and sha256.
- Skip if already installed.
- Otherwise download → verify sha256 → fetch
.minisigand verify with the official Zig Ed25519 public key (usingcrypto/ed25519+golang.org/x/crypto/blake2b) → extract in pure Go (github.com/ulikunitz/xz+ stdlibarchive/tar) into~/.zvk/zig/versions/<ver>/. - Maintain the channel symlink and the bin symlink.
- After a nightly install, remove older nightly builds (
0.X.Y-dev.…): only the newest is kept. Tagged releases and any version a channel still points at are never removed. - Generate assistant reference docs for that build (see below).
Assistant reference docs (Zig only)
Zig has no stability promise — stdlib and the build system are reorganized across releases — and an AI assistant's training data lags the current compiler, so it tends to write outdated Zig. After installing Zig, zvk deterministically lays out the raw material an assistant needs to target this build instead of stale memory (no LLM is involved — zvk only stages inputs):
zig/REFERENCE.<channel>.md— version-pinned pointers (locallangref.html, stdlib root) + a grep "topic map" (I/O, fs, http, Build, crypto…).zig/versions/<ver>/STD_INDEX.md— a lightweight "which file exports what" index (column-0pubdecls of each top-levellib/stdfile).zig/versions/<ver>/release-notes.html— the official breaking-change list, snapshotted locally.zig/versions/<ver>/ADAPTATION.prompt.md— a prompt you hand to Claude; it reads the notes + index and writes anADAPTATION.mdcheat sheet of "what my memory gets wrong about this version".~/.zvk/CLAUDE.md— a few lines (installed versions, when to usezigvszig-nightlyby a project'sminimum_zig_version, where the reference is), idempotently@imported into~/.claude/CLAUDE.mdso Claude Code loads it automatically. It is kept short on purpose: it is in every session's context.
zvk self-install also installs Claude Code skills for the situational
commands: ~/.claude/skills/zvk-fetch/ and ~/.claude/skills/zvk-serve/. Unlike
a CLAUDE.md import, a skill only keeps its one-line description in context
and loads the rest when Claude needs it. zvk never overwrites a same-named
skill it did not generate.
Disable with ZVK_NO_DOCS (skip entirely) or ZVK_NO_CLAUDE_MD (keep the docs
but don't write anything into ~/.claude).
Go
- Fetch https://go.dev/dl/?mode=json for the version list and sha256.
- Skip if already installed.
- Otherwise download the
.tar.gz→ verify sha256 → extract in pure Go (stdlibcompress/gzip+archive/tar, stripping the top-levelgo/directory). - Maintain
go/channels/stableand thebin/{go,gofmt}symlinks.
Node.js
- Fetch https://nodejs.org/dist/index.json and resolve the version:
ltspicks the newest LTS release,currentthe newest overall, or an exact version likev20.11.0. - Skip if already installed.
- Otherwise fetch that release's
SHASUMS256.txt, look up the sha256 for this platform's archive, download → verify sha256 → extract in pure Go (.tar.gzon POSIX,.zipon Windows). - Maintain
node/channels/defaultand thebin/{node,npm,npx}symlinks. Node has a single active pointer (the commandsnode/npm/npxcan't be suffixed per channel the wayzig/zig-nightlyare), solts/currentare install-time selectors, not persistent channels.
Apps
Some tools aren't version-managed toolchains — Homebrew is a package manager,
Claude Code is an app, scoop is a Windows package manager; none has channels or
versions to switch between. zvk app installs these via their official
scripts (not the tarball pipeline). It is deliberately not a package
manager — no version tracking, no bookkeeping.
zvk app list— show the apps installable on this platform and whether each is on PATH (macOS/Linux → homebrew, claude-code; Windows → winget, scoop).zvk app install <name>— run the tool's official installer (Homebrew'sinstall.shnon-interactively; Claude Code'sinstall.sh; scoop'siwr | iex). No-op if already installed. Some apps have no install script (winget ships with Windows' App Installer) — those just print where to get it. For Claude Code, zvk also turns off the in-session "How is Claude doing?" survey by addingCLAUDE_CODE_DISABLE_FEEDBACK_SURVEY=1to theenvblock of~/.claude/settings.json, even when Claude Code was already installed. Only that key is added; the rest of the file is kept as is, and a value you set yourself is never overridden.zvk self-installdoes the same when it finds Claude Code.ZVK_NO_CLAUDE_MD=1skips it.zvk app uninstall <name>— prints the official removal steps; zvk never deletes a system tool it didn't lay out itself.
Adding an app is one recipe in cmd_app.go.
zvk app vminit
Configures this host as a low-footprint VM node (not an install — it reconfigures the local machine). Works on Linux and macOS:
- hostname →
vm-<primary-ipv4>(e.g.vm-192-168-1-50; the primary IPv4 is found via the default-route interface, dots become dashes); - disable sleep/suspend/hibernate;
- disable file indexing (Spotlight on macOS, mlocate/plocate on Linux);
- disable the graphical UI (Linux
multi-user.target) / reduce animations (macOS).
Changes are system-level and run via sudo (password prompt passed through).
zvk app vminit --dry-run prints the exact commands without running them — run
that first to see what will change.
SSH
keygencallscrypto/ed25519.GenerateKeyto produce a keypair.golang.org/x/crypto/ssh'sMarshalAuthorizedKeyandMarshalPrivateKeyemit the standard OpenSSH public key line andopenssh-key-v1private key (unencrypted).- The private key is written with 0600 permissions.
addinvokesssh-add;copyinvokespbcopyon macOS,wl-copyorxclipon Linux.
Browser fingerprints
zvk fetch follows the default Chrome profile in its linked tls-client release.
With tls-client v1.18.1, that default is Chrome 150; Chrome 152 and 154 are also available
as explicit profiles. Existing binaries do not update profiles at runtime.
zvk fetch --list-profiles
zvk fetch https://example.com
zvk fetch --profile chrome_154 https://example.com
zvk fetch --profile chrome_154_PSK https://example.com
Chrome User-Agent and Client Hints versions derive from the selected profile,
including PSK variants. Client Hints brand ordering and GREASE values follow
Chromium's version-seeded generation.
Profile names are case-insensitive. Non-Chrome profiles select the transport
fingerprint while retaining the default Chrome headers; use -A and -H to
customize those headers. Browser fingerprints can improve compatibility with
some sites but do not execute JavaScript or guarantee access.
Reliability and file receiving
Toolchain install/use/uninstall operations use a per-toolchain OS lock. A second concurrent mutation fails with an actionable error; locks are released when the process exits, including crashes. Downloads are extracted into private staging directories and required files are checked before publishing a version. Failed extraction leaves existing installations and channel mappings unchanged. Channel and command-entry updates are preflighted and rolled back on write errors. Windows updates multiple shim files, so the group is not crash-atomic.
Archive operations are confined to the extraction directory, including symlink traversal. Version and SSH key names must be portable single path components.
zvk serve --receive ./inbox/ --once
zvk serve --receive result.bin --max-bytes 104857600
Directory uploads preserve existing files and select a unique name on collision,
including concurrent requests. Publishing uses hard links and requires a filesystem
that supports them. Single-file uploads intentionally replace the destination only
after the complete body has been received. Interrupted and oversized uploads leave
no partial destination. The upload limit defaults to 1 GiB; --max-bytes 0 disables
it. Request reads and response writes have a five-minute timeout. In receive mode,
--once admits one upload at a time, permits retry after failure, and exits after
the first successful save and response shutdown. Other methods return HTTP 405.
Checks
go test -race ./...
go vet ./...
go build -o zvk .
Tests use temporary directories and synthetic archives, without installing real toolchains or changing shell configuration.
Environment variables
| Variable | Effect |
|---|---|
ZVK_ROOT |
Install root (defaults to ~/.zvk) |
ZVK_NO_MODIFY_PATH |
Skip writing to shell rc |
ZVK_NO_MINISIGN |
Skip minisign verification of Zig tarballs (not advised) |
ZVK_NO_DOCS |
Skip generating the Zig assistant reference docs |
ZVK_NO_CLAUDE_MD |
Generate the docs but don't write into ~/.claude (no CLAUDE.md import, no skills, no settings.json defaults) |
ZVK_VERSION |
Module version the installer builds (self-update forwards it) |
GOPROXY |
Go module proxy used by the installer |
ZVK_GO_SITE |
Go version/index site (default https://go.dev) |
ZVK_GO_MIRROR |
Flat directory of Go archives (e.g. https://dl.google.com/go/); verified against the index sha256 |
Build from source
Requires Go 1.27 or newer.
go install github.com/zoptia/zvk@latest # straight to $GOBIN
# or, from a clone:
git clone https://github.com/zoptia/zvk
cd zvk
go build -o zvk .
./zvk self-install
zvk zig install
zvk go install
Third-party dependencies
Direct dependencies:
golang.org/x/crypto— SSH key serialization and BLAKE2b for minisign.golang.org/x/sys— Windows process locking.github.com/ulikunitz/xz— pure-Go xz decompression.github.com/bogdanfinn/tls-clientandgithub.com/bogdanfinn/fhttp— browser TLS/HTTP2 fingerprints and the HTTP client used byzvk fetch.
tar/gz/zip are handled entirely by the standard library (archive/tar,
compress/gzip, archive/zip); there is no dependency on the system tar
binary, so zvk runs in minimal environments where tar is absent.