The god-tree of your codebase
Flatten any subset of your project into an AI-ready codex — index + contents, in one command.
Yggdrasil is a project flattener and diff engine. It builds a single, deterministic codex from whatever subset of your codebase you choose:
- A full index of files
- Accurate line counts
- Language-tagged code blocks
- Markdown or plain text output
- Optional rich diff mode
- Optional movement annotations (
[MOVED])
Use it for:
- LLM prompts
- Documentation snapshots
- Code reviews
- Reproducible archives
- Project comparisons
Yggdrasil does not guess what you want. You explicitly choose the files — this makes your snapshot deterministic and deeply controllable.
Yggdrasil never prints the entire repo by default. You must specify what to include using any of:
--only <paths…>--show <extensions…>--white <manifest>
You may also exclude using:
--ignore--black
Formatting is separate:
--printed→ Markdown (SHOW.mdby default)--contents --out FILE→ explicit output mode
--printed does not select files.
It only specifies the output format.
These examples are accurate and guaranteed to work because they always include a file-selection flag.
ygg --show rs md --printedygg --only src/main.rs \
src/scanner \
src/snapshot/format_selection.rs \
src/snapshot/writer.rs \
--printedWHITE.md:
src/lib/model.rs
src/app/main.tsx
README.md
Command:
ygg --white WHITE.md --printedMarkdown:
ygg --show py --contents --out PY_SNAPSHOT.mdPlain text:
ygg --show rs --contents --out snapshot.txtygg --show rs
ygg --show py md txtygg --only src --printed--white never triggers interactive input.
--whited enables the fastest workflow:
- launches interactive paste mode
- implies
--white - implies
--contents - writes Markdown to
SHOW.mdautomatically
Run:
ygg --whitedYou will see:
Enter WHITE patterns (one per line):
Tip: Paste your paths (e.g., from VS Code → Copy Relative Path).
Finish with Ctrl+D (Linux/macOS) or Ctrl+Z then Enter (Windows).
Paste:
src/main.rs
src/utils/io.rs
README.md
Then Yggdrasil generates SHOW.md automatically.
This is the only flag that triggers interactive paste mode.
Compare directories:
ygg diff src/ -- old_src/Compare specific files:
ygg diff controller.py -- controller_old.pyAlign annotations:
ygg diff --align-tags src/ -- old_src/Diff features:
- inline diff visualization
- contextual additions/removals
- cross-file movement detection
[MOVED → file:line]annotations- optional aligned metadata
Requires Rust:
cargo install yggdrasil-cliEnsure ~/.cargo/bin is in your path.
Install from local source:
cargo install --path . --forceIn Norse myth, Yggdrasil is the world-tree unifying realms. This tool unifies your project structure into one portable artifact.
Design principles:
- Explicit over implicit
- Deterministic, repeatable output
- Minimal configuration
- LLM-friendly structure
- Complete control over what’s included
- Snapshot export
- Markdown and plain-text modes
- Manifests:
--whiteand interactive--whited - Blacklists:
--ignore,--black --onlyand--showfilters- Diff engine
- Block movement detection
--align-tags--printed
- Tree-view / flat-view toggle
- Themeable CLI output
- HTML codex export
- Combined codex+diff bundles
MIT License.
