I reimplemented a Python script that summarizes project structure and file contents using Bun + TypeScript.
Original References
- How to let an LLM read an entire repository of source code
- A Python script that automatically summarizes a project’s structure and file contents so you can dump the whole thing into Claude 3
Motivation
- I’m not very comfortable with Python
- I wanted practice reimplementing something written by someone else in JS/TS
- I’m reasonably comfortable with JS and TS
- I wanted a CLI that can bundle repository content into a single file for LLM use
- I wanted it to become a portable executable binary that can run cross-platform
Source Code
Tech Stack
| Language | TypeScript |
| Package Manager | Bun |
| JS Runtime | Bun |
| Linter/Formatter | Biome |
| Editor | VS Code |
Pain Points / Open Issues
I struggled to get the exact behavior I wanted from Bun’s built-in Glob API and eventually fell back to minimatch.
Implementation Highlights
- Single File Executable: use Bun’s
--compileoption to build an executable binary - Glob handling: filter files with minimatch
- LLM-oriented output: collect the project structure and file contents into one markdown file
Summary
Reimplementing the Python script helped me deepen my understanding of TypeScript and Bun.
Because it can be distributed as an executable binary, users do not need Node.js installed, which makes it easier to use across platforms.
If you want to let an LLM read an entire repository, this tool makes it easy to generate the context in one shot.
hsb.horse