logo hsb.horse
← Back to blog index

Blog

Reimplementing generate-project-summary.py with Bun + TypeScript

A Bun + TypeScript rewrite of a Python project-summary script. Covers the path to a portable executable for feeding whole repositories into an LLM.

Published:

I reimplemented a Python script that summarizes project structure and file contents using Bun + TypeScript.

Original References

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

mktbsh/generate-project-summary.js: Inspired by https://github.com/Olemi-llm-apprentice/generate-project-summary

Tech Stack

LanguageTypeScript
Package ManagerBun
JS RuntimeBun
Linter/FormatterBiome
EditorVS 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

  1. Single File Executable: use Bun’s --compile option to build an executable binary
  2. Glob handling: filter files with minimatch
  3. 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.