Skip to content

xssdoctor/jscollab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

jscollab

A powerful JavaScript analysis tool that uses Google's Gemini AI to provide detailed code explanations and summaries.

Features

  • 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

Prerequisites

  • Go 1.16+
  • Google Gemini API key

Installation

  1. Clone the repository:

    git clone https://github.com/xssdoctor/jscollab.git
    cd jscollab
    
  2. Build the project:

    go build -o jscollab
    
  3. Run the tool once to create the configuration directory:

    ./jscollab /path/to/js/files
    

    This will create a directory at ~/.config/jscollab with a template .env file.

  4. Update the .env file with your Gemini API key:

    # Edit ~/.config/jscollab/.env
    GEMINI_API_KEY=your_api_key_here
    

Usage

Run the tool by providing the path to the directory containing JavaScript files:

./jscollab /path/to/js/files

Output

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

How It Works

  1. Scans the target directory for JavaScript files
  2. Filters out files that exceed the context window threshold (900,000 characters)
  3. Sends each file to Google's Gemini AI for analysis
  4. Extracts key information from the AI's response
  5. Generates a comprehensive table of contents
  6. Saves all analysis files for future reference

Configuration

The tool automatically creates and uses a configuration directory at ~/.config/jscollab. This directory contains:

  • .env file: Stores your Gemini API key

You can adjust the threshold for file size in the source code by modifying the threshold constant.

License

MIT License

Created By

xssdoctor

About

Your AI javascript collaborator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages