yggdrasil-cli

Crates.ioyggdrasil-cli
lib.rsyggdrasil-cli
version0.1.3
created_at2025-09-06 21:55:21.888257+00
updated_at2025-09-18 23:27:29.170015+00
descriptionThe god-tree of your codebase β€” flatten projects into an AI-ready codex.
homepage
repositoryhttps://github.com/andrewrgarcia/yggdrasil-cli
max_upload_size
id1827653
size923,083
Andrew Garcia (andrewrgarcia)

documentation

README

yggdrasil logo

Yggdrasil

The god-tree of your codebase
Flatten your entire project into an AI-ready codex β€” index + contents, in one command.


πŸ€” 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:

  1. Files β€” index of all discovered paths.
  2. File Contents β€” full file text, wrapped in markers.

Example commands

# Export your repo as Markdown (index + contents)
ygg --show --md --contents --out SHOW.md

# List only file paths (no contents)
ygg --show rs
ygg --show py
ygg --show json --ignore node_modules .next

# Restrict scan to a subdir
ygg --show md --only src

# Exclude files listed in BLACK.md
ygg --show --blacklist BLACK.md --contents

# Show only files listed in a manifest (WHITE.md)
ygg --show --manifest WHITE.md --contents

# Pipe into another tool (AI, pager, etc.)
ygg --show --md --contents | less

πŸ“„ 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:

ygg --show --manifest WHITE.md --contents

πŸš€ Installation

You’ll need Rust.

cargo install yggdrasil-cli

Then ensure ~/.cargo/bin is in your PATH.

Upgrade after edits:

cargo install --path . --force

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

Commit count: 17

cargo fmt