Project layout
Minimal project:
my-app/ zz.toml src/main.zz tests/ bench/Create it
Section titled “Create it”# Create a new project in a fresh folder (templates: cli | lib | web | plugin)zz new my-app --template cli
# Or initialize zz.toml + src/main.zz in the current folderzz init --template clizz.toml
Section titled “zz.toml”[package]name = "my-app"version = "0.1.0"
[test]jobs = 4
# Add dependencies here, or with `zz add <pkg>[@ver]` then `zz install`.[dependencies]# my-dep = "1.2.3"zz add <pkg>[@ver] writes the entry into zz.toml; zz install resolves
dependencies into vendor/ and writes the exact pins to zz.lock. Commit
zz.toml and zz.lock; vendor/ is typically git-ignored (it can be
regenerated with zz install).
Entry point
Section titled “Entry point”zz build / zz run with no file uses src/main.zz (then main.zz).
Override with [package] entry = "src/cli.zz" (must stay inside the package).
Outputs go to <root>/bin/<name> for projects, ./<stem> for standalone files.
Sidecars (app.c, build.sh, build.bat) sit next to the binary for manual rebuilds.
Imports resolve by tree, not CWD
Section titled “Imports resolve by tree, not CWD”import std.mathimport std.strimport app.math // <root>/src/math.zz as math.*import app.utils.helpers as hPrecedence: std > package (app.*) > registry dep > relative file.
- and _ spellings agree (my-app is my_app).
Tests, benches, assets
Section titled “Tests, benches, assets”- Tests:
zz testuses./tests/when it holds.zzfiles, else.. - Benches:
zz benchuses./bench/when present, else.. - Static assets:
zz build --embed ./assets+fs.embedfs()at runtime.
Useful commands
Section titled “Useful commands”zz check src/ # fast, cached type-checkzz fmt src/ # format in placezz test # run @test functionszz bench # run @bench functionszz clean # bin/, build/, src/bin/zz clean --deps # + vendor/ + zz.lockzz upgrade # self-update zz + zz-lsp from GitHub releases