Skip to main content

A coding assistant to help with repository management and code queries.

Project description

Leya

AI coding assistant which can directly be ported into the terminal and be used to query complex Git repositories

Overview

The Git Coding Assistant is a versatile tool designed to allow you to query and find solutions to code within your git repository. Leveraging the power of Git and OpenAI, it offers functionalities such as cloning repositories, selecting repositories for focused queries, and extracting relevant code snippets and providing you solutions to your queries.

Features

  • Repository Cloning: Easily clone GitHub repositories directly from the command line.
  • Repository Selection: Select repositories to work with, enabling focused queries and interactions.
  • Code Querying: Query repositories for specific code issues or information using natural language queries.
  • Function-based Queries: Narrow down queries by specifying function names to focus on.
  • Intelligent Answer Generation: Utilize AI to extract and provide intelligent answers to code-related queries.

Usage

Before using Leya, you need to set up your environment variables for the OpenAI API key and Pinecone API key:

Option 1: Export Environment Variables (Linux and macOS)

Open your terminal and export the environment variables using the following commands:

    $ export OPENAI_API_KEY=<your_openai_api_key>
    $ export PINECONE_KEY=<your_pinecone_api_key>

Option 2: Export Environment Variables (Windows)

For Windows users, you can set the environment variables using the following commands in PowerShell bash $ $env:OPENAI_API_KEY="<your_openai_api_key>" $ $env:PINECONE_KEY="<your_pinecone_api_key>" Option 3: Add Environment Variables (Manual)

Alternatively, you can manually add the environment variables through your system settings:

OpenAI API Key: Add a new environment variable named OPENAI_API_KEY with your OpenAI API key as the value. Pinecone API Key: Add a new environment variable named PINECONE_KEY with your Pinecone API key as the value. After setting up the environment variables, Leya will be able to access your API keys for authentication

After Environment Variable setup

  1. Downloading the package:
    $ pip install leya
    
  2. Cloning Repositories and uploading repo chunks to pinecone:
    $ leya -r <repository_url>
    
  3. Selecting Repositories:
    $ leya -s
    
  4. Querying Repositories:
    $ leya -q "<query>" 
    
  5. Optional addition of Function-based Queries:
    $ leya -q "<query>" -f <function_name_1> <function_name_2> ...
    

Contributing

Fork the repository. Create a new branch (git checkout -b feature-branch). Make your changes. Commit your changes (git commit -am 'Add new feature'). Push to the branch (git push origin feature-branch). Create a new Pull Request.

Credits

Developed by: PranavN1234

Working

Store repositories

Screenshot 2024-04-24 125402

Swap between stored repositories

Screenshot 2024-04-24 125420

Sample queries

** Query without functional parameters **

Screenshot 2024-04-24 125501

** Query with functions appended to narrow scope of search ** Screenshot 2024-04-24 125642

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

leya-0.1.5.tar.gz (12.2 kB view hashes)

Uploaded Source

Built Distribution

leya-0.1.5-py3-none-any.whl (13.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page