π€ What is Yggdrasil?
Yggdrasil CLI is a project flattener: it takes your codebase and transforms it into a single, structured document.
Think of it as tree meets cat, but with superpowers:
- π Files β indexed, filtered by extension, glob, or blacklist.
- π Contents β full text for each file, neatly marked.
- π Anchors β clickable links from index β content (Markdown mode).
- π¨ Stylish CLI β cyberpunk colors, or plain mode for piping.
- π‘ Controls β
--only,--ignore,--blacklist,--out.
Why? To make your repo AI-ready, doc-ready, and share-ready.
π Why would I want this?
- π€ AI Prompts: Feed your repo as one codex to ChatGPT/Claude.
- π Docs & Reviews: Export a clean snapshot for collaborators.
- π§βπ» Developers: Browse projects with context in your terminal.
- ποΈ Archival: Serialize project state for reproducibility.
Yggdrasil doesnβt just list files β it builds a codex of your project.
π How does it work?
Yggdrasil generates two sections:
- Files β index of all discovered paths.
- File Contents β full file text, wrapped in markers.
Example commands
# Export your repo as Markdown (index + contents)
# List only file paths (no contents)
# Restrict scan to a subdir
# Exclude files listed in BLACK.md
# Show only files listed in a manifest (WHITE.md)
# Pipe into another tool (AI, pager, etc.)
|
π Manifest files
A manifest is just a plain text file with one path per line. Only the files listed in the manifest will be shown.
Example WHITE.md:
src/pages/codebase.tsx
src/data/codebaseAssets.tsx
src/i18n/codebase.en.json
src/i18n/codebase.es.json
src/types/codebase.ts
Run with:
π Installation
Youβll need Rust.
Then ensure ~/.cargo/bin is in your PATH.
Upgrade after edits:
π² Philosophy
In Norse myth, Yggdrasil is the world-tree connecting all realms. In your terminal, Yggdrasil connects all files β flattening complexity into a single codex.
Itβs built to be:
- Minimal: no configs, just flags.
- Readable: AI-friendly and human-friendly.
- Extensible: Markdown, CLI, ignore lists, output redirection.
Goal: Make your projectβs structure transparent and portable.
π£ Roadmap (v0.1 β v1.0)
- β
Index & contents export (
--show,--contents) - β
Markdown mode (
--md) - β
Ignore & blacklist support (
--ignore,--blacklist) - β
Output to file (
--out) - β³ Tree vs flat mode toggle
- β³ Configurable themes / styles
π License
MIT, like almost everything else thatβs friendly and open-source.