Git Product home page Git Product logo

aidev's Introduction

AI Dev

Are you tired of making small code changes only to have a series of CI tests fail afterward?
Introducing an AI-powered(Chatgpt/gpt4) solution to

โœจ Run mock tests before committing

๐Ÿš€ Get valuable suggestions to improve your code before you commit

๐Ÿ›  Automatically generate unit tests for your code changes before committing

๐Ÿ“ Generate insightful commit messages automatically based on your code changes

PyPI Download Last Commit

๐ŸŒŸ Features

  • Run mock tests on your latest code changes before committing, powered by AI
  • Get actionable code improvement suggestions to optimize your codebase
  • Automatically generate unit tests for your code changes, saving you time and effort
  • Easy-to-use CLI with configuration options for a tailored experience
  • Improve code quality, reduce technical debt, and increase confidence in your commits

๐Ÿ“ฆ Installation

Install the AI Test package using pip:

pip install aidev

๐Ÿš€ Quick Start

After installation, use the aidev command to analyze your code changes:

aidev

You can customize the behavior of the CLI using various options:

aidev --threshold 0.8 --engine gpt-3.5-turbo --max-tokens 400

For more information on available options, run:

aidev --help

โš™๏ธ Configuration

AI Tester allows you to configure various settings to better suit your needs. To manage and edit these configurations, use the aidev-config CLI command.

Configurable settings include:

  • API Key: Store your OpenAI API key in a local configuration file. The CLI tool will guide you through entering and storing the key the first time you use it.
  • Threshold: Set the confidence threshold for the AI-generated results (ranging from 0.0 to 1.0).
  • Engine: Choose the GPT engine to use (e.g., "gpt-3.5-turbo", "gpt-4", "gpt-4-32k").
  • Max Tokens: Specify the maximum number of tokens in the AI-generated response.
  • Language: Set the output language for the AI-generated response.

Configuration management:

The aidev-config CLI command allows you to view, add, update, or remove configuration settings. The command provides a user-friendly interface to manage your settings.

To set up and manage the configuration, follow these steps:

  1. Run the aidev-config command with the desired subcommand, e.g., aidev-config set-api-key <your-api-key>.
  2. The CLI will update the configuration with the provided value.
  3. Use aidev-config show-config to view the current configuration settings.

The main CLI tool, aidev, reads the configuration settings and applies them when generating AI responses, ensuring a customized experience based on your preferences.

๐Ÿ“š How it works

AI Test harnesses the power of OpenAI's GPT-4 to provide real-time assistance for developers. When you run the CLI tool with your code changes, it performs the following steps:

  • Retrieve code changes: The tool first runs git diff to capture the latest code changes in your repository.
  • Generate a prompt: Depending on your chosen action (mock test, code suggestions, or unit test generation), the CLI tool creates a prompt for the AI model to understand the task.
  • Interact with GPT-4: The tool sends the prompt to GPT-4, which processes the information and generates a relevant response.
  • Display the results: The AI-generated results are displayed in the CLI, providing you with mock test outcomes, code improvement suggestions, or unit test examples based on your request.

By leveraging AI technology, AI Test streamlines your development process, making it more efficient, accurate, and enjoyable.

๐ŸŒฑ Contribute

We welcome contributions! Feel free to open issues, submit pull requests, or start discussions on improving AI Test.

๐Ÿ“ƒ License

This project is licensed under the MIT License.

๐Ÿš€ Empower your code commit workflow with AI Test today! Give it a try, and don't forget to โญ๏ธ the repository if you find it helpful!

aidev's People

Contributors

voidful avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.