Expand ↗
Page list (55)

CLI Overview

Every zetl subcommand at a glance, with the flags writers actually use. This page is the reference — the linked how-to pages give the narrative.

Run zetl <cmd> --help for the authoritative flag list for any command. This guide tracks zetl v0.5.0.

Global flags

Every subcommand honours these, wherever they make sense.

FlagEnv varPurpose
-d, --dir <DIR>ZETL_DIRVault root. Default: . (current directory).
-f, --format <FORMAT>ZETL_FORMATjson / table / auto. Auto picks table for a TTY, JSON for a pipe.
--jsonShorthand for -f json.
--no-cacheZETL_NO_CACHEIgnore the cached index; force a full rescan.
--no-colorNO_COLORDisable ANSI colour.
-q, --quietSuppress non-essential output.
-v, --verboseIncrease verbosity. Repeatable (-vv).
--no-inputDisable interactive prompts; fail if input is needed.
--at <TIME-EXPR>Query the vault at a historical point. Requires --features history. See Time Travel.
-V, --versionPrint zetl version.

Subcommand summary

CommandDescriptionFeature flag
indexBuild or refresh the link index
listList every page in the vault
statsSummary counts and most-linked pages
linksForward links from a page
backlinksBacklinks to a page
checkDead links, orphans, syntax, SPL diagnostics
searchFull-text search (BM25, optional semantic)semantic for --semantic/--hybrid
similarSimHash title matches
pathShortest link path between two pages
exportDump the full link graph
blocksList or resolve Merkle blocks
viewTwo-pane terminal reader
serveLocal web server
buildStatic-site HTML export
watchStream vault changes as NDJSON
diffGraph diff against a git ref or snapshot
themeList / install / remove / export themes
hookAuthor, test, and inspect hooks
ecosystemProbe Pandoc / mdBook / remark runtimesecosystems-v1
astInspect or diff zetl-ext AST
agentRun an agent-lifecycle hook
inviteMulti-user invitation tokencollab (built-in)
agent-tokenDerive a headless API tokencollab
derive-ssh-keyDerive an SSH ed25519 key from a mnemoniccollab
capCapability-URL static sharing operations
reasonSPL queries over the vaultreason
mcpStart an MCP servermcp
delegateIssue a delegate JWTmcp
completionsEmit a shell completion script
manEmit a roff(7) man page

zetl index

Scan the vault and write the cached link index to .zetl/index.json. Incremental by default; --no-cache forces a full rescan.

Key flags: --exclude <PATTERN> (repeatable gitignore syntax), --include-hidden (walk .claude/, .obsidian/, etc.).

zetl index
zetl -d ~/notes index --exclude 'drafts/**'

zetl list

Enumerate every page zetl can see. Useful in pipes.

zetl list --json | jq -r '.pages[].title'

zetl stats

Counts: files, links, orphans, dead links, plus the most-linked pages. --top <N> sets how many leaders to print (default 10).

Forward links from a page. See Following Links.

Key flags: --depth <N> (traverse N hops), --context <N> (include N characters of surrounding text), --fuzzy (case-insensitive partial page-name match), --with-conclusions (SPL conclusions each linked page contributes; requires reason).

zetl links "Zettelkasten Method"
zetl links "Zettelkasten Method" --depth 2

Same flags as zetl links, but inbound. See Backlinks.

zetl backlinks "Zettelkasten Method" --context 60

zetl check

Validate vault health: dead links, orphans, syntax errors, SPL diagnostics, and SPL drift. See Finding Orphans and Dead Links.

Key flags: --dead-links, --orphans, --syntax, --spl, --drift (show only that category), --fail-on error|warning (CI gate), --theme <NAME> (for hook-discovery).

zetl check
zetl check --dead-links --fail-on error

Full-text search across vault content. See Searching.

Key flags: --limit <N> (default 50), --context <N> (default 40), --case-sensitive, --path <GLOB> (restrict to matching files), --near <PAGE> with --depth <N> (restrict to pages within N link-hops of PAGE), --semantic and --hybrid (require --features semantic).

zetl search "wikilink"
zetl search "API" --near "Backend Overview" --depth 2
zetl search "memory" --hybrid --limit 20

zetl similar

SimHash locality-sensitive title match. See Similar Pages.

Key flags: --threshold <N> (max Hamming distance, default 12), --limit <N> (default 10).

zetl path

Shortest link path between two pages. See Following Links.

Key flag: --max-depth <N> (default 10).

zetl path "Quick Start" "Capability URLs"

zetl export

Dump the full link graph — pages + edges — to JSON. Pipe into Gephi, Obsidian Canvas, or your own tooling.

zetl blocks

List the Merkle blocks of a page, or resolve a block by its BLAKE3 hash.

Key flags: --type heading|paragraph|spl|code|table|list|blockquote|frontmatter|all, --resolve <HASH> (full or prefix; mutually exclusive with PAGE).

zetl blocks "Zettelkasten Method" --type heading
zetl blocks --resolve 0f3ac1

zetl view

Xanadu-style two-pane terminal reader. See Terminal Viewer.

Key flags: --main-width <pct> (30–80, default 58), --context-lines <N> (1–20, default 5). Run without a page name to open a picker.

zetl serve

Local web server. See Web Server.

Key flags: --port <PORT> (default 3000), --theme <NAME>, --public <DIR> (files that override generated pages), --collab (multi-user), --init-owner / --owner-name <NAME> (first-time collab bootstrap), --hostname <HOST> (WebAuthn relying-party; env: ZETL_HOSTNAME), --server-key-seed <MNEMONIC> (deterministic keys; env: ZETL_SERVER_KEY_SEED), --git-poll-interval 30s, --safe-mode (only theme-declared hooks run).

zetl serve
zetl serve --collab --init-owner --owner-name Jo
zetl serve --port 8080 --theme fountain

zetl build

Generate a static HTML site. See Static Site Export.

Key flags: -o, --out-dir <DIR> (default dist), --theme <NAME>, --public <DIR>, --site-url <URL> (absolute og:image URLs), --safe-mode, --strict-parsers (promote mixed-parser warnings to errors).

zetl build
zetl build --theme docs --site-url https://notes.example

zetl watch

Watch the vault for changes and emit NDJSON graph events. See Watching for Changes.

Key flags: --debounce <MS> (default 150, min 10, max 5000), --exec <CMD> (shell command run once per event with the event JSON on stdin), --exclude, --include-hidden.

zetl watch --exec 'jq .type'

zetl diff

Graph-level diff against a git ref or jj change-ID.

Key flags: --from <REF> or --since <DATE>, --filter pages|links|orphans|dead-links.

zetl diff --from HEAD~5
zetl diff --since "last monday" --filter dead-links

zetl theme

Manage themes. See Customising the Look.

Subcommands:

SubcommandPurpose
zetl theme listList bundled + installed themes
zetl theme install <SOURCE>Install from git (user/repo, URL, git@…#ref); flags: --path, --name, --force
zetl theme remove <NAME>Remove an installed theme
zetl theme export <NAME>Copy a bundled theme into .zetl/themes/ for customisation; --force

zetl hook

Author, test, and inspect hooks. See Lifecycle Hooks and Render Pipeline Hooks.

SubcommandPurpose
zetl hook listActive hooks for this vault + theme
zetl hook run <NAME> [-- <EXTRA>...]Run a lifecycle hook with real vault context
zetl hook new <STAGE> <NAME>Scaffold a render-pipeline hook; flags: --lang py|js|sh, --ecosystem pandoc|mdbook|remark, --force
zetl hook test <NAME>Run a hook against its fixture and diff the golden; --update regenerates
zetl hook fixture --from <PAGE> --hook <NAME>Capture a vault page into the hook’s fixture dir
zetl hook watch <NAME>Live-reload the hook’s persistent-mode subprocess on source change
zetl hook coveragePer-hook coverage from the most-recent build; --stage, --json
zetl hook dry-run <STAGE>/<NAME>Print pages the hook’s selector matches; hook is not invoked; --limit, --theme
zetl hook capabilitiesProbe every hook’s supported stages + AST types; --stage, --json

zetl ecosystem

Probe plugin ecosystems. Requires ecosystems-v1 feature flag.

  • zetl ecosystem check — per-ecosystem detection, version, configured-hook count, reachable plugins. Exits 0 when all configured ecosystems are available. See Plugin Ecosystems.

zetl ast

Inspect the zetl-ext AST for a page or diff two AST JSON documents.

  • zetl ast sample <FILE> — print canonical AST JSON. --stage pre-parse|transform|post-render chooses which stage’s input to emit (default transform).
  • zetl ast diff <BEFORE> <AFTER> — tree-aware structural diff; non-zero exit on non-empty diff.

zetl agent

Agent lifecycle integration for LLM / automation hooks.

  • zetl agent run <NAME> [-- <EXTRA>...] — run an on-agent hook with task context. Flags: --pages <TARGET>..., --budget <TOKENS> (0 = unlimited), --theme.

zetl invite

Generate an invitation token for a collaborator. See Invitations.

Key flags: --as <USER> (inviter), --role reader|editor|admin, --pages <GLOB> (scoped grant), --expires 72h|24h|7d (default 72h), --host, --port (URL generation).

zetl invite --as alice --role editor
zetl invite --as alice --role reader --pages 'projects/*' --expires 7d

zetl agent-token

Derive a headless API token from a BIP39 mnemonic.

zetl agent-token --mnemonic "word1 word2 ... word12"

zetl derive-ssh-key

Derive an SSH ed25519 key from a BIP39 mnemonic. Useful for ephemeral containers where one seed covers the server key and the git SSH key.

zetl derive-ssh-key --mnemonic "word1 ... word12" --out /root/.ssh/id_ed25519

zetl cap

Capability-URL static-site operations. See Capability URLs.

SubcommandPurpose
zetl cap genkeyEmit the content-encryption secret + signing keypair (once)
zetl cap invite <NAME> --cohort <ID>Issue an invitation grant; flags: --expires, --pages <GLOB>, --recipient <PUBKEY>, --via enrol-page, --split-key, --site-url, --slug
zetl cap listList issued grants; --cohort, --output
zetl cap revoke <GRANT_ID>Revoke a grant
zetl cap rotate --cohort <ID>Rotate a cohort’s content-key salt (URLs stay stable)
zetl cap finalise <GRANT_ID>Mark a grant operator-confirmed; --rotate-grant
zetl cap checkStale-grant + public-safety audit; --public-safety
zetl cap sweepMark past-expiry grants as revoked
zetl cap pairSPAKE2 pubkey handoff; --grantor / --grantee, --peer, --phrase, --pubkey
zetl cap audit-diff [OLD] [NEW]Scan a diff for malicious content; --corpus, --corpus-root
zetl cap rotate-signing-keyRotate the Ed25519 vault-signing key (rebuilds every page)
zetl cap emergency-shutdownPrint the takedown checklist (no files changed)

zetl reason

SPL queries over the vault. Requires --features reason. See Running Queries.

Subcommands (consult zetl reason --help inside a feature-reason build): status, explain, conflicts, why-not, what-if.

zetl mcp

Start a Model Context Protocol server. Requires --features mcp. See MCP Server.

zetl delegate

Issue a delegate JWT for an MCP client. Requires --features mcp.

zetl completions

Print a shell-completion script.

zetl completions zsh > ~/.zsh/completions/_zetl

Supported shells: bash, zsh, fish, elvish, powershell.

zetl man

Print a roff(7) man page. Preview with zetl man | man -l -.

Last changed by zetl · history

Backlinks