This package scans a repository and generates a unified output of current source files, designed to be used as context for Large Language Models (LLMs).
The primary goal of this script is to create a comprehensive, structured representation of a codebase that can be easily ingested by LLMs. This allows for more accurate and context-aware interactions when using LLMs for code-related tasks such as:
- Code understanding and explanation
- Bug detection and fixing
- Code completion and generation
- Documentation creation
- Code review assistance
- Scans a specified directory (default:
src
folder in the current directory) - Ignores specified directories (e.g.,
node_modules
,dist
,.git
) - Processes specific file types (
.ts
,.sol
,.js
,.json
,.md
,.html
) - Generates three output files:
- A tree structure of the repository
- The contents of all scanned files
- A combination of both the tree structure and file contents (primary output for LLM context)
- Ensure you have Node.js installed on your system.
- Place this script in the root directory of your project.
- Create an
out
directory in the same location as the script. - Run the script using Node.js: