A powerful JavaScript analysis tool that uses Google's Gemini AI to provide detailed code explanations and summaries.
- Automatically processes JavaScript files from a target directory
- Intelligently filters large files that exceed the AI context window
- Generates detailed analysis for each JavaScript file including:
- Concise summary of the code's purpose
- Detailed explanation of functionality
- Step-by-step breakdown of the code's operation
- Creates a table of contents with summaries of all processed files
- Parallel processing for improved performance
- Error handling to ensure partial results are preserved even when some files fail
- Go 1.16+
- Google Gemini API key
-
Clone the repository:
git clone https://github.com/xssdoctor/jscollab.git cd jscollab -
Build the project:
go build -o jscollab -
Run the tool once to create the configuration directory:
./jscollab /path/to/js/filesThis will create a directory at
~/.config/jscollabwith a template.envfile. -
Update the
.envfile with your Gemini API key:# Edit ~/.config/jscollab/.env GEMINI_API_KEY=your_api_key_here
Run the tool by providing the path to the directory containing JavaScript files:
./jscollab /path/to/js/files
The tool generates the following outputs in the output directory:
table_of_contents.txt: A summary of all processed files- Individual analysis files for each JavaScript file (named after the original file)
out_of_context_window.txt: List of files that were too large to process
- Scans the target directory for JavaScript files
- Filters out files that exceed the context window threshold (900,000 characters)
- Sends each file to Google's Gemini AI for analysis
- Extracts key information from the AI's response
- Generates a comprehensive table of contents
- Saves all analysis files for future reference
The tool automatically creates and uses a configuration directory at ~/.config/jscollab. This directory contains:
.envfile: Stores your Gemini API key
You can adjust the threshold for file size in the source code by modifying the threshold constant.