Repo-snapshot is a CLI tool for packaging GitHub repositories to share with Large Language Models (LLMs).
This idea originated from the experience of a software engineer who was coding a program and used an AI tool to help progress efficiently. However, when a developer asks AI tools like ChatGPT, Gemini, or Claude, there may not be a proper answer initially. That is where this idea comes from.
I chose TypeScript because I had previously worked on a group project using JavaScript for both frontend and backend development. I also built a business frontend project with TypeScript in my previous team, and I found that TypeScript could remind coders identify problems in the code. This made me feel it is a stronger-typed language than JavaScript, which is also the reason why my friends recommended that I learn it. After using it, I would say that I want to continue using TypeScript.
While working on this project using TypeScript, I initially had no idea what to do. However, after researching, I found answers by using commander
, simple-git
, and glob
.
Commander
is a popular library for building command-line interfaces (CLIs). It simplifies parsing command-line arguments, defining commands and options, and automatically generating help and usage information.
I used it with glob
to filter what the user wants to include or exclude.
Simple-git
is a lightweight Node.js library that provides an easy-to-use interface for running Git commands programmatically without invoking the Git CLI directly. In this project, I used it to retrieve Git information such as commit
, branch
, author
, and date
.
Glob
is a utility that matches file paths using shell-like wildcard patterns called "glob patterns." It helps find files and folders in the filesystem that match specific patterns, which is useful for tasks such as file searching, filtering, and batch processing. I used it to filter include
and exclude
arguments.
This CLI tool not only checks the files and folders on GitHub but also packages the project, making it easier for users to upload files to AI assistants by using the -o
or --output
argument.
I used this CLI tool for my project after completing the first version. I felt it was great to generate the project structure and display the included code. It helped me a lot while coding.
I am thinking about adding more functionalities to this project to make coding easier for me in the future. For this reason, I want to keep improving it with more features and continue using it.
Top comments (0)