fuori is a dependency-light C99 command-line tool designed to export codebases into single Markdown artifacts. These artifacts are optimized for Large Language Model (LLM) context packing and streamlined code review workflows README.md1-9 By consolidating a project's structure and source code into a single file, it eliminates manual copy-pasting and provides a clean, auditable snapshot of a repository or specific changesets README.md11-16
The tool operates by selecting files through various modes (Git-aware or filesystem-based), filtering out non-exportable content (binaries, symlinks, or sensitive data), and rendering a structured Markdown document README.md17-22
Key features include:
For installation and basic usage, see Getting Started.
The architecture of fuori is guided by predictability and simplicity. It favors a "conservative" collection model where files are biased toward UTF-8 source text docs/design.md47-49 A primary architectural constraint is the separation of Selection (identifying candidate paths) and Rendering (formatting the final Markdown) docs/design.md31-32
The project explicitly avoids becoming a complex "context platform," eschewing features like template engines, remote cloning, or TUI interfaces in favor of a stable, easy-to-review implementation docs/design.md19-28
For a deep dive into these constraints, see Design Philosophy and Non-Goals.
The following diagram illustrates how the major components interact to transform a local repository into a Markdown artifact.
Sources: src/app.h18-51 docs/design.md31-77
The codebase is organized into several distinct subsystems that handle the lifecycle of an export:
| Subsystem | Primary Responsibility | Key Entities |
|---|---|---|
| Orchestration | Manages the application lifecycle, CLI parsing, and atomic file writes. | main(), AppContext src/app.h18-41 |
| Path Collection | Discovers candidate files via Git (worktree, staged, diff) or filesystem walking. | FileSelectionMode, collect_git_paths src/app.h43-51 |
| Filtering | Validates files against .gitignore rules and scans for sensitive tokens/keys. | IgnorePattern, fuori_is_sensitive_filename src/app.h16 |
| Rendering | Formats the ExportPlan into Markdown, including the project tree and code fences. | render_export_plan, TreeNode |
| Unpacker | (Optional) Appends a Python script to the artifact to allow programmatic extraction. | fuori_unpacker_script |
This diagram bridges the "Natural Language" requirements to the specific code entities that manage data as it flows through the system.
Sources: src/app.h43-51 src/app.h16-30
Makefile and basic CLI usage.