Skip to content

greptileai/repo-summarizer-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Repo Summarizer (Java)

A CLI tool to summarize files in a directory using OpenAI.

Prerequisites

  • Java 17 or higher
  • Maven 3.6 or higher
  • OpenAI API key

Building

mvn clean package

This will create an executable JAR file in the target directory.

Usage

java -jar target/repo-summarizer-1.0.0.jar -d <directory> [options]

Options

  • -d, --directory <path> - Directory to process (required)
  • -o, --output <file> - Output JSON file path (optional)
  • -k, --api-key <key> - OpenAI API key (or set OPENAI_API_KEY environment variable)
  • -l, --log-level <level> - Log level: debug, info, warn, error (default: info)
  • -m, --model <model> - OpenAI model to use (default: gpt-3.5-turbo)
  • -h, --help - Show help message
  • -V, --version - Show version information

Examples

Using API key from command line:

java -jar target/repo-summarizer-1.0.0.jar -d ./test-files -k your-api-key

Using API key from environment variable:

export OPENAI_API_KEY=your-api-key
java -jar target/repo-summarizer-1.0.0.jar -d ./test-files

Save output to a file:

java -jar target/repo-summarizer-1.0.0.jar -d ./test-files -o results.json

With debug logging:

java -jar target/repo-summarizer-1.0.0.jar -d ./test-files -l debug

Output

The tool outputs a JSON object containing:

  • totalFiles - Total number of files found
  • processedFiles - Number of files successfully processed
  • skippedFiles - Number of files skipped
  • summaries - Array of file summaries, each containing:
    • filePath - Full path to the file
    • fileName - Name of the file
    • summary - AI-generated summary
    • fileSize - Size of the file in bytes
    • processedAt - ISO timestamp of when the file was processed
  • processingTime - Total processing time in milliseconds

Logging

Logs are written to both:

  • Console (with colored output)
  • summarizer.log file in the current directory

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages