Packages — zz.toml, deps, publish
Manifest
Section titled “Manifest”[package]name = "my-app"version = "0.1.0"entry = "src/main.zz" # optional override, must stay inside package
[dependencies]toml = "1.2.3" # registryutils = { git = "https://...", rev = "abc123" }local = { path = "../local" }faker = { version = "1.0", optional = true }
[features]# List form: enables other features and/or optional deps.default = ["std", "locales-ar"]std = []# Table form: gates module files and pulls in optional deps.locales-ar = { modules = ["locales/ar"], deps = ["faker"] }
[test]jobs = 4
[collect.commands] # directory-based typed registrydir = "commands"sig = "func(args: [str]) -> int"See Collections for member discovery, ordering, and diagnostics.
Same-name deps across workspace members stay unsupported until [workspace] —
keep names unique per workspace.
Features
Section titled “Features”[features] makes optional dependencies and module files opt-in. Without the
section nothing changes: every dependency installs and every module imports
exactly as before.
- A list entry (
default = ["std"]) enables other features. It may also name anoptional = truedependency directly. - A table entry (
locales-ar = { modules = [...], deps = [...] }) gates module files and enables optional dependencies. modulespaths are relative to the package source root (src/), without.zz:"locales/ar"gatessrc/locales/ar.zz. Absolute paths and..are rejected.depsmust name a declaredoptional = truedependency, and every optional dependency must be reachable from at least one feature (otherwise it can never be enabled).- The
defaultfeature is always active.--features a,b(repeatable) adds more;--all-featuresenables every declared feature.
zz install # only the default feature setzz install --features locales-ar # + locales-ar (and its optional dep)zz run --features locales-ar src/main.zzzz build --all-featureszz check --features locales-ar,extras srcDisabled optional dependencies stay out of resolution: no registry metadata,
lock entry, vendor/ link, or compile. Importing a gated module or dependency
names the exact feature:
cannot resolve import `locales.ar`: module `locales/ar` is provided by feature `locales-ar`, which is not enabledhint: enable it with --features locales-ar (or add it to `default`)zz install records the feature selection in zz.lock; switching features
re-resolves and relinks. Published packages carry their [features] tables in
the registry metadata, and zz info <pkg> prints them.
Commands
Section titled “Commands”zz init [name] # scaffoldzz new <name> # new projectzz add <dep> # add depzz install # fetch + link vendor/, rewrite zz.lockzz install --frozen # CI: fail if lock stale (use in CI)zz remove <dep>zz updatezz outdatedzz depszz auditzz search <q>zz info <pkg>zz registry / login / publishzz generate-wrapperzz clean --deps # drop vendor/ + lock, re-fetch with installA dep name has exactly one source: manifest wins. Stale lock pins from another
source are ignored with note: <name>: manifest declares <source>, ignoring stale <source> pin; install rewrites lock + vendor/ links, so registry↔path flips
need no manual cleanup. Fresh clones (lock matches, vendor/ missing) fetch+link
instead of up to date. Long-form docs bundle DOCS.md else docs/**/*.md
(max 200KB, sorted #-level) for publish/info.
Layout
Section titled “Layout”vendor/holds links/copies;zz.lockpins exact versions.- Flipping registry↔path during local dev is safe — just
zz install. bin/is gitignored append-only by builds;src/bin/twins from old versions are reaped on publish (logged), anything else left alone.
Next: Project layout, Plugins.