zatsu is a deterministic code-outline CLI for quickly understanding a
repository. In directory mode it prints a compact tree and symbol outlines
for supported source files; in file mode it prints the outline for one file.
Files matched by .gitignore are excluded from directory output.
The name is a playful continuation of upstream zat (from Japanese ざっと,
“at a glance”) and Japanese 雑 (zatsu), meaning “rough” or “informal”.
This repository contains the v0.1 CLI: repository directory mode, file mode,
symbol outlines, .gitignore-aware traversal, and output limits. Output is
intended to be stable and suitable for humans and coding agents.
brew install shohei81/tap/zatsucargo install --git https://github.com/shohei81/zatsuOr build a local checkout:
cargo build --release
./target/release/zatsu .Nix users can build the flake directly:
nix build github:shohei81/zatsuPass a repository directory to show its file tree and source outlines:
zatsu
zatsu .
zatsu path/to/repositoryWith no path, zatsu inspects the current directory. Standard CLI metadata is
available with zatsu --help and zatsu --version.
Limit how deeply directory mode traverses a repository with --max-depth (or
-d). The root is depth 0, so --max-depth 0 prints only the root. A directory
whose contents were omitted is marked with … (max depth reached).
zatsu --max-depth 2 .Limit normal output with --max-lines (or -l). This works in both directory
and file mode. If more output exists, zatsu adds one truncation notice after
the requested number of lines.
zatsu --max-lines 200 .
zatsu -d 3 -l 200 path/to/repositoryPass a source file to use file mode:
zatsu src/lib.rsUse -- before a path that starts with a hyphen:
zatsu -- ./-example.rsDirectory traversal respects .gitignore; ignored files are not included in
the tree or outlined.
Only public/exported symbols are shown where the language supports visibility markers. Struct fields, enum variants, and interface members may be included.
| Language | Extensions |
|---|---|
| JavaScript | .js, .jsx, .cjs, .mjs |
| TypeScript | .ts, .tsx, .mts, .cts |
| Rust | .rs |
| Python | .py |
| Go | .go |
| Java | .java |
| C | .c, .h |
| C++ | .cpp, .cc, .cxx, .hpp, .hxx |
| C# | .cs |
| Swift | .swift |
| Kotlin | .kt, .kts |
| Haskell | .hs |
| Ruby | .rb |
| Markdown | .md, .markdown |
All supported languages are parsed with tree-sitter.
## Tools
### zatsu
A deterministic repository and file outline viewer. In directory mode it shows
a `.gitignore`-aware file tree and source symbol outlines; in file mode it
shows one file's outline.
Prefer `zatsu` when you need signatures and structure rather than full
implementation. Use the reported line numbers to read only relevant sections.zatsu is a GPL-3.0 fork of bglgwyng/zat.
The upstream project provided the original tree-sitter outline engine and
language queries; this fork extends the product with repository-oriented
deterministic output. See LICENSE for the applicable license.
