Diff Command
zetl diff computes a graph-level diff against Git history, showing what changed in the link structure between two points in time.
Usage
# Diff against previous commit (default: HEAD~1)
zetl -d ./my-vault diff
# Diff against a specific ref
zetl diff --from main~5
# Diff by date
zetl diff --since "2026-02-01"
# Filter by change category
zetl diff --filter links
Flags
| Flag | Default | Description |
|---|---|---|
--from <ref> | HEAD~1 | Git ref to diff against |
--since <datetime> | none | Find closest commit at or before this date |
--filter <category> | none | Filter output: pages, links, orphans, dead_links |
How it works
zetl uses an efficient reconstruction algorithm (see ADR-012 Changed Files Reconstruction):
git diff --name-onlyidentifies changed.mdfiles between the baseline and HEADgit showretrieves the old content of each changed file- Old content is parsed for wikilinks
- Set differences between old and new graphs yield the diff
This scales with the size of the change, not the size of the vault.
Output
- Pages added and removed
- Links added and removed
- Orphans gained and resolved
- Dead links added and resolved
Design decision
zetl uses Git as its history backend rather than maintaining its own snapshots. See ADR-011 No Snapshots for the rationale. This is the only zetl command that requires Git.
See also: CLI Reference, Watch Command, Check Command, SPEC-007 Graph Diff