Skip to main content

Your AI-powered coding companion: AI Code Bot 🤖

Project description

AI Code Bot 🤖

Your AI-powered coding companion

AICodeBot is a coding assistant designed to make your coding life easier. With capabilities to perform code reviews, manage dependencies, and even suggest improvements, think of it as your AI version of a pair programmer - a team member that accelerates the pace of development and helps you write better code.

⚠️ Status: This project is in its infancy with very limited features, but it already improves the software development workflow.

⚠️ It uses OpenAI's ChatGPT large language model, which can hallucinate and be confidently wrong. Sometimes it does dumb things, which is why we have you confirm before it does anything permanent.

We're working on it and it's getting better all the time.

What it's not

aicodebot is a tool for developers, not a replacement for them. It's not going to replace your job, but it will make your job easier and more fun. It's not going to take over the world, but it will help us build a better one. See the Alignment section below for more on that.

It's also not a "build a website for me in 5 minutes" tool that takes a well constructed prompt and builds a scaffold for you. There are other tools for that, Instead, it's built to work with existing code bases and help you improve them at the git-commit level. It's designed to multiply the effectiveness of capable engineers.

Current features - how you can use it

AI-Assisted Git Commit

aicodebot commit will run pre-commit for you to check syntax, and then generate a commit message for you based on the changes you've made. It will also commit the changes for you once everything checks out.

AI-Assisted Debugging

aicodebot debug $command will run the command and capture the log message. It will then try to figure out what's going on from the error message and suggest a fix.

AI-Assisted Code Review

aicodebot review will run a code review on your code and suggest improvements. By default it will look at [un]staged changes, and you can also supply a specific commit hash to review. It also suggests best practices for code improvement.

Getting Started

PyPI version

To install the command line interface, run pip install aicodebot. You'll also need to set up an OpenAI API key, which you can get for free by visiting your API key settings page.

Follow the steps below to set up AICodeBot on your machine:

pip install aicodebot

Note: The first time you run it, you'll be prompted to enter your OpenAI API Key, which is required, as we use OpenAI's large language models for the AI. You can get one for free by visiting your API key settings page.

Roadmap of Upcoming Features

Code Workflow Improvements

  • Assisted Git Commit: Automatically generate a commit message.
  • Assisted Debugging: Run a command with aicodebot and it captures the log message and tries to figure out what's going on from the error message. Eventually, it could also suggest fixes for the error and make the changes for you. Try it out with aicodebot debug $command
  • Code Review: Provides feedback on potential issues in cod, such as style violations, potential bugs, and performance issues. It could also suggest best practices for code improvement. Eventually: FIX the code automatically and notify the team.
  • Fix the Build: Check the CI/CD pipeline, figure out what is broken, and fix the build.
  • Dependency Management: Updating dependencies to their latest versions with pull requests that run tests.
  • Documentation Generation: Generates comprehensive documentation for code, including docstrings, README files, and wiki pages.
  • Performance Optimization Suggestions: Suggests potential performance optimizations for code.
  • Error Detection: Detects errors in code and suggests potential fixes.
  • Test Generation: Generates unit tests for code, improve test coverage.
  • Integration with CI/CD pipelines: Integrates with CI/CD pipelines to automate tasks like code review, testing, and deployment (via GitHub Actions)
  • Rubber Ducky Chat Bot: Helps developers think through design issues by providing a conversational interface to discuss and solve problems, using data from the current repo.
  • Linting/Formatting: Checks code for linting errors and automatically fixes them where possible (via pre-commit)
  • Handle GitHub Issues: Handles basic tasks that you assign to @aicodebot

User Interfaces

  • Command-line, installable via pip: aicodebot can be installed as a Python package using pip install aicodebot
  • Callable as a GitHub action: Can be called as a GitHub action to perform tasks on GitHub repositories.
  • Chat: CLI chat interface that knows the context of your codebase and can answer questions about it. No more going back and forth between ChatGPT and command-line.
  • Slack Bot: Interacts with aicodebot via slack, sends notifications, performs tasks, and provides real-time assistance to developers.
  • Bug Report service integrations: Listen for bug reports from Sentry, Honeybadger, and other bug reporting tools and automatically create issues, assign them to developers, and notify them via Slack. Eventually: FIX the bug automatically and notify the team.

Repository Management

  • Project best practices: Suggest things like pre-commit, linting, license, CI/CD, etc. Eventually: Implement them for you.
  • Handle Stale Issues: Automatically detects and handles stale issues on GitHub by nudging the responsible parties.
  • Triage Incoming Issues: Provides Level 1 triage of incoming issues on GitHub, including tagging, assigning, and responding with FAQs. It could also escalate issues to human developers when necessary.
  • Rate the complexity of PRs: Rates the complexity of pull requests and assigns them to developers based on their skill level and context

Fun

  • Fun Facts: Provides fun facts about programming or AI. It could also share interesting news or articles related to AI and programming.
  • Alignment: Gives a heart-centered inspirational message about how we can build AI in a way that aligns with humanity.
  • Telling Jokes: Tells programming jokes. :smiley:
  • Supportive Encouragement: High fives and kudos for a job well done
  • GIF Reactions: Reacts to messages with relevant and fun gifs. We've gotta figure out how to teach LLMs about humor.

Development / Contributing

The Stack

Test and Build

GitHub Build CodeCov Pytest

Code Quality

Ruff pre-commit Code style: black Imports: isort Super Linter

Infrastructure

Python 3.11 Open AI

Alignment ❤️ + 🤖

Technology itself is amoral, it just imbues the values of the engineers who create it. We believe that AI should be built in a way that aligns with humanity, and we're building aicodebot to help us do just that. We're building from a heart-centered space, and contributing to the healthy intersection of AI and humanity.

Contributing

We'd love your help! If you're interested in contributing, here's how to get started.

  1. Clone the repository
git clone git@github.com:novara-ai/aicodebot.git
  1. Set up a virtual environment (I recommend using virtualenvwrapper)
mkvirtualenv --python=`which python3` aicodebot
  1. Install the dependencies:
pip install -r requirements/requirements-dev.txt
  1. Use aicodebot to build aicodebot 😎

Testing

Install the test dependencies with pip install -r requirements/requirements-test.txt

We use pytest for testing. It will skip some tests if OPENAI_API_KEY is not set.

Coding Principles

Borrowed from the zen of python, with a couple of changes.

1. **Readability is the number 1 code quality metric**.
2. Beautiful is better than ugly.
3. Explicit is better than implicit.
4. Simple is better than complex.
5. Complex is better than complicated.
6. Flat is better than nested.
7. Sparse is better than dense.
8. Special cases aren't special enough to break the rules.
    * Although practicality beats purity.
9. Errors should never pass silently.
    * Unless explicitly silenced.
10. In the face of ambiguity, refuse the temptation to guess.
11. There should be one -- and preferably only one -- obvious way to do it.
12. Now is better than never.

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

aicodebot-0.5.1.tar.gz (28.5 kB view hashes)

Uploaded Source

Built Distribution

aicodebot-0.5.1-py3-none-any.whl (25.5 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