Package: aicodebot
AI Code Bot 🤖Your AI-powered coding sidekickAICodeBot is a coding assistant designed to make your coding life easier. Think of it as your AI version of a pair programmer. Perform code reviews, create helpful commit messages, debug problems, and help you think through building new features. A team member that accelerates the pace of development and helps you write better code.We've planned to build out multiple different interfaces for interacting with AICodeBot. To start, it's acommand-line toolthat you can install and run in your terminal, and aGitHub Action for Code Reviews.Status: This project is in its early stages, but it already improves the software development workflow, and has a healthy roadmap of features (below).We're using AICodeBot to build AICodeBot, and it's upward spiraling all the time.️ We're looking for contributors to help us build it out. SeeCONTRIBUTINGfor more.Current features - how you can use it todayTaskStatusGenerating quality commit messages✅Thinking through tasks as a pair programmer✅Coding with a small number of files✅Debugging✅Doing code reviews✅Explaining code✅Writing tests✅Integration with GitHub✅Modifying local filesEarly stagesSearching the internet for answersIn ProgressReading library documentationEarly stagesCoding with a large number of filesAs LMs get larger token limitsWriting senior developer level codeEventuallyMajor refactorsEventuallyBuild entire appsEventuallyReplace DevelopersNopeAI Sidekick 🦸‍♂️aicodebot sidekickYour AI-powered coding assistant. It's designed to help you with your coding tasks by providing context-aware suggestions and solutions. Think ChatGPT with the ability to read the local repository for context.By default it will pass along a directory of files from the current working directory, and you can also pass in a list of files to use as context for the task you are working on. For example:aicodebotsidekickfile1.pyfile2.pyIn this example, the sidekick will read the contents of file1.py and file2.py and use them to provide context-aware answers.Pro-tips:Add your README.md to the list of files to get context-aware answers.Paste in error messages from log files or stack traces and it will help you debugBrainstorm new featuresHave it write unit tests for you that cover all the casesThis feature is in its early phases right now, but it's already useful. We'll be adding support for tools that the sidekick can use, including GitHub integration, ingesting repository specific domain knowledge, writing local files, and more. For now, it justreadsfiles and provides suggestions.AI-Assisted Git Commit 📝aicodebot commitimproves the git commit process. It will run pre-commit for you to check syntax, and then generate a commit message for you based on the changes you've made. In about as much effort as typing "fix bug" for the commit message, you will get a high-quality commit message that thoroughly describes the change.AI-Assisted Code Review 👀aicodebot reviewwill 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.
Its goal is to suggest how to make the code better, and we've found that it often teaches us new things about our code and makes us better programmers. It is a great way to get a second set of robot eyes on your code.AI-Assisted Debugging 🐞aicodebot debug $commandwill run the $command and capture the log output. It will pass the error message, stack trace, command output, etc. over to the AI and respond with some suggestions on how to fix it.Installation and UsageTo install AICodeBot, run:pip install aicodebotAnd then, runaicodebot configureto get started.Usage:aicodebot[OPTIONS]COMMAND[ARGS]...

Options:-V,--versionShowtheversionandexit.-h,--helpShowthismessageandexit.-d,--debugEnablelangchaindebugoutput

Commands:alignmentAmessagefromAICodeBotaboutAIAlignment❤+🤖.commitGenerateacommitmessagebasedonyourchanges.configureCreateorupdatetheconfigurationfiledebugRunacommandanddebugtheoutput.reviewDoacodereview,with[un]stagedchanges,ora...sidekickCodinghelpfromyourAIsidekickOpen AI key setupThe 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 yourAPI key settings page.Note: You will be billed by OpenAI based on how much you use it. Typical developers will use less than $10/month - which if you are a professional developer you'll likely more than make up for with saved time and higher quality work. SeeOpenAI's pricing pagefor more details. Also, see the note about increasing your token size and using better language models below.Integration with GitHub ActionsHow about automated code reviews on every commit? You can have AICodeBot run as a GitHub action on your repository. SeeThe AICodeBot GitHub Action for Code Reviews. It will look at every commit and pull request, and then either:✅ Pass🗒️ Comments - pass the action, but leave a comment with minor issues, suggestions, or improvements.❌ Fail the action - if a serious issue is found, it will leave a comment and let you know about something that should be addressed.Roadmap of Upcoming Features ️Code Workflow ImprovementsAssisted Git Commit: Automatically generate a commit message based on the changes you've madeAssisted 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 withaicodebot debug $commandCode Review: Provides feedback on potential issues in code,  and suggests improvements to make it better.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.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). Eventually: Fix the build automatically when there are small errors.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 repository.Linting/Formatting: Checks code for linting errors and automatically fixes them where possible (via pre-commit)Automatically Generate ChangeLogs and Release Notes: Generates release notes and changelogs based on commit messages and code changes.User InterfacesCommand-line, installable via pip: aicodebot can be installed as a Python package usingpip install aicodebotMention the @aicodebot GitHub user: Mentioning the@aicodebotGitHub user in a comment will trigger it to perform a task, review code, or pull in an appropriate GIF.Callable as a GitHub action: Can be called as a GitHub action to perform tasks on GitHub repositories.AICodeBot ActionJupyter Notebook Extension: Provides a Jupyter Notebook extension that can be used to debug code in the notebook.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 / Project ManagementProject best practices: Suggest things like pre-commit, linting, license, CI/CD, etc. Eventually: Implement them for you.Manage GitHub 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, and provide nudges for tasks that need more input.Welcome new contributors: Automatically welcome new contributors to the project, find out what they're interested in, and suggest issues for them to work on.FunAlignment: Gives a heart-centered inspirational message about how we can build AI in a way that aligns with humanity. Try it out withaicodebot alignment.Telling Jokes: We've gotta figure out how to teach language models about humor. :)Supportive Encouragement: High fives and kudos for a job well doneGIF Reactions: Reacts to messages with relevant and fun gifs.Alignment ❤️ + 🤖Technology itself is amoral; it just imbues the values of the people 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.What it's NOTaicodebotis 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 won't take over the world, but it will help us build a better one. See theAlignmentsection below for more.⚠️ AICodeBot currently uses OpenAI's ChatGPT large language models, which can hallucinate and be confidently wrong. Sometimes AICodeBot does dumb things, so it's mostlyreadingandadvisingand not yetwriting. Much like Tesla's "Full Self Driving", you must keep your hands on the wheel.It's also not a "build a site for me in 5 minutes" tool that takes a well-constructed prompt and builds a scaffold for you. There areother toolsfor that. It's not a no-code platform. Instead, AICodeBot is built to work with existing codebases and the git-commit level. It's designed to multiply the effectiveness of capable engineers.Configuring the language model to useNot all OpenAI accounts have GPT-4 API access enabled. By default, AICodeBot will use GPT-4. If your OpenAI account supports it, we will check the first time you run it. If your OpenAI API does not support GPT-4, you can ask to be added to the waitlisthere. In our testing, GPT-4 is the best model and provides the best results.To specify a different model, you can set thelanguage_modelin your$HOME/.aicodebot.yamlfile. For example:openai_api_key:sk-*****language_model:gpt-3.5-turbopersonality:Stewieversion:1.2You can also use openrouter.ai to get access to advanced models like GPT-4 32k and Anthropic's 100k model for larger context windows. Seeopenrouter.aifor more details. Here's a sample config:openai_api_key:sk-*****openrouter_api_key:sk-or-****language_model_provider:OpenRouterlanguage_model:openai/gpt-4-32k# or anthropic/claude-2 for 100k token limitpersonality:Stewieversion:1.2Note: We'll be adding more options for AI models in the future, including those that can be run locally, such asGPT4alland HuggingFace'sTransformers.Understanding Tokens and Using Commands EfficientlyIn AI models like OpenAI's GPT-4, a "token" is a piece of text, as short as a character or as long as a word. The total tokens in an API call, including input and output, affect the cost, time, and whether the call works based on the maximum limit.Each model has a maximum token limit. For example, GPT-3.5 has a limit of 4096 tokens, and GPT-4 has a token limit of 8192 tokens. If a conversation exceeds this limit, you must reduce your text until it fits.When using commands like the Sidekick command in AICodeBot, which allows you to pass in files for context, it's important to manage your tokens effectively. Due to token limits, it's not feasible to load your entire codebase. Instead, you should only load the specific files that are relevant to the task you're working on. This ensures that the AI model can process your request efficiently and provide the most relevant suggestions for your current task.How can I get a larger token limit?Do you need a larger context window for your task? Are you running into token limits and getting a message like this?Thecontextistoolarge(21414)foranyofthemodelssupportedbyyourAPIkey.😞There are a couple of things you can do:Load fewer files into the context (only what you need to work with)Apply for GPT-4-32k access from OpenAI by contacting them.Use openrouter.ai - this allows you to use the full power of GPT-4-32k, which offers a 4x larger context window. Seeopenrouter.aifor more details. Once you sign up and set youropenrouter_api_keyin your$HOME/.aicodebot.yamlfile, you can have access to larger models. Soon we will have support for Claude 2, which has a 100k token limit.Development / ContributingWe'd love your help! If you're interested in contributing, here's how to get started. SeeCONTRIBUTINGfor more details.DockerAssumes you have changes in current working dir that are already added.docker build -t aicodebot .
docker run -v ~/.aicodebot.yaml:/home/user/.aicodebot.yaml -v .:/app aicodebot commit -y