---
name: zigman
description: Read the official Zig language reference from the terminal while writing or reviewing Zig. Use whenever you are unsure about Zig language semantics — slices, pointers, comptime, error sets, switch/for/while, casting, or a builtin (@TypeOf, @intCast, ...) — instead of guessing. Requires the `zigman` CLI on PATH.
---

# zigman — read the Zig reference instead of guessing

Zig moves fast and small syntax/semantic details matter. When writing or reviewing Zig,
look the answer up in the language reference rather than recalling it. One lookup is cheaper
than a wrong compile.

## when to reach for it

- unsure about a language feature: slices vs arrays vs pointers, `comptime`, error unions,
  optionals, `switch`/`for`/`while`, `defer`, casting, result-location semantics
- need a builtin's exact behavior: `@TypeOf`, `@import`, `@intCast`, `@bitCast`, `@Type`, ...
- a compile error names a concept you're not 100% sure of — read that section first
- before asserting "Zig does X" in a review

## how to use it

```bash
zigman comptime          # print the matching section (markdown, real code examples)
zigman slice             # fuzzy: if several match, it lists them — pick one
zigman -l                # full table of contents (discover exact section names)
zigman -l error          # list sections whose name matches a word
zigman -V 0.15.1 comptime # read a specific Zig version (default: master)
```

Output is plain markdown on stdout, so it pipes: `zigman comptime | head -40`. Workflow:
`zigman -l <word>` to find the section, then `zigman <name>` to read it.

## scope

The reference documents the **language**, not the standard library. For `std.ArrayList`,
`std.Io`, `std.fmt`, allocators, etc., read the std source instead (`zig env` reports
`.std_dir`, relative to `$HOME`) — `zigman` won't have those.

## install

`curl -fsSL https://nate.tngl.io/zigman/install.sh | sh`
(source: https://tangled.org/zzstoatzz.io/zigman)
