Skip to content

Prompt OpenAI models with git repository context

License

Notifications You must be signed in to change notification settings

blomqma/git-vector

Repository files navigation

Git-Vector

License: MIT

Git-Vector is a command-line tool that allows developers to interact with their Git repositories using OpenAI models. It provides a conversational interface to help you understand and navigate your codebase by leveraging the full context of your repository.

Table of Contents

Features

  • Conversational Interface: Interactively ask questions about your codebase and receive detailed explanations.
  • Full Repository Context: The tool indexes your entire Git repository to provide context-aware responses.
  • Caching Mechanism: Embeddings are cached to improve performance on subsequent runs.
  • Customizable Models: Supports different OpenAI models for both embeddings and chat completions.
  • Configurable Parameters: Adjust maximum tokens for prompts and responses to suit your needs.

Installation

pip install git-vector

Usage

  1. Set Up Environment Variables:

    Export your OpenAI API key as an environment variable (or use a .env file):

    export OPENAI_API_KEY=your_api_key_here
    
  2. Run the Application:

    git-vector --repo-dir /path/to/your/git/repository
    

    This will start the interactive CLI for the user to chat with the codebase.

Configuration

  • --repo-dir: (Required) The path to the Git repository.
  • --embedding-model: The OpenAI model to use for embeddings (default: text-embedding-3-small).
  • --chat-model: The OpenAI model to use for chat completions (default: gpt-4o-mini).
  • --max-prompt-tokens: Maximum number of tokens for the prompt (default: 2000).
  • --max-response-tokens: Maximum number of tokens for the response (default: 500).

License

This project is licensed under the MIT License. See the LICENSE file for details.

Author

Acknowledgments

  • OpenAI for providing the API that powers this tool.
  • GitPython for interacting with Git repositories.
  • NumPy and scikit-learn for numerical and machine learning.

About

Prompt OpenAI models with git repository context

Resources

License

Stars

Watchers

Forks

Packages

No packages published