Zig standard library documentation in the terminal.
The doc comments in the Zig standard library are the manual, and they are spread over hundreds of files. zigdoc std.mem.Allocator prints the comment, the file and line, the signature, and the members, without leaving the terminal. Run it in a project and it reads the modules that build.zig declares, so a dependency is documented the same way.
- Symbols: one symbol at a time, with its doc comment, signature, and members.
zigdoc std.mem.Allocatorprints all four. - Modules from your build:
zigdoc vaxis.Windowreads the modules that yourbuild.zigdeclares, and--dump-importsprints them as JSON. - Starting a project:
zigdoc @initwrites a Zig 0.16 project with anAGENTS.mdthat tells a coding agent how to work in it.
Not implemented:
- A pinned standard library: zigdoc reads the
zigonPATH, andZIG_LIB_DIRpoints it at another lib directory. - Modules that
build.zigdoes not declare, even when a source file imports one. - A quiet run: the import trace goes to stderr on every run.
zigdoc runs zig to find the standard library, so zig must be on PATH. It reads projects on Zig 0.14, 0.15, and 0.16.
With Homebrew, on macOS or Linux:
brew install --cask baskingspot/tap/zigdocWith mise:
mise use -g github:baskingspot/zigdocWith Nix:
nix run github:baskingspot/zigdoc/v0.6.0 -- std.ArrayListEach release has a tarball for linux-x64, linux-arm64, and macos-arm64, a zip for windows-x64, and a SHA256SUMS file. The archives are attested, so check a download with gh attestation verify FILE -R baskingspot/zigdoc --signer-repo baskingspot/gh-actions.
From source:
zig build install -Doptimize=ReleaseFast --prefix $HOME/.local- The guide: what each command does, with real output.
- The command reference: every option and command, as
zigdoc --helpprints them. - The changelog: what changed in each release.
nix develop
just cinix develop provides the toolchain and the site tools. just lists the recipes, just ci runs what CI runs, just guide serves the guide with live reload, and just doc builds the whole site into zig-out/site/zigdoc/. The command reference page is generated by zig build reference.
MIT. See LICENSE. The logo files in docs/static/ are baskingspot marks and are not covered by it. See docs/static/LICENSE.
Built with LLM assistance.