Skip to content

Repository files navigation

zatsu

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.

Animated zatsu repository outline demo

The name is a playful continuation of upstream zat (from Japanese ざっと, “at a glance”) and Japanese 雑 (zatsu), meaning “rough” or “informal”.

Status

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.

Installation

Homebrew

brew install shohei81/tap/zatsu

Cargo

cargo install --git https://github.com/shohei81/zatsu

Or build a local checkout:

cargo build --release
./target/release/zatsu .

Nix users can build the flake directly:

nix build github:shohei81/zatsu

Usage

Pass a repository directory to show its file tree and source outlines:

zatsu
zatsu .
zatsu path/to/repository

With 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/repository

Pass a source file to use file mode:

zatsu src/lib.rs

Use -- before a path that starts with a hyphen:

zatsu -- ./-example.rs

Directory 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.

Supported languages

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.

For AI agents

## 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.

Upstream

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.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages