This document provides an overview of the Code Bandit project for AI agents to understand its purpose, architecture, and how to contribute.
Code Bandit is an AI-powered command-line assistant that allows users to interact with their codebases using natural language. It is designed to be a flexible and extensible tool for developers to analyze and modify their code.
The project is in its early stages of development, so expect some rough edges and potential for breaking changes.
- TypeScript: The primary language used for development.
- Node.js: The runtime environment for the CLI application.
- Ink: A React-based framework for building command-line interfaces.
- LangChain.js: Used for integrating with various large language models (LLMs).
- ESBuild: For bundling the application.
- Commander.js: For parsing command-line arguments.
The project is organized into the following main directories:
src/: Contains the source code for the application.src/app.tsx: The main application component that handles the user interface and interactions.src/ai/: Contains the logic for interacting with the AI models and the file system.src/ai/chat-session.ts: Manages the chat history and session state.src/ai/work.ts: The main entry point for processing user requests and generating responses.
src/ui/: Contains the React components for the user interface.
docs/: Contains documentation and other project-related files.dist/: Contains the bundled and transpiled code for distribution.
The application works by taking user input from the command line, passing it to an AI model, and then executing the generated commands. The AI model has access to a set of tools that allow it to interact with the file system, such as reading, writing, and listing files.
The main application component, ChatApp, manages the chat history and user interactions. When a user sends a message, the work function is called to process the request. The work function then uses the ChatSession class to manage the conversation and generate a response from the AI model.
The AI model's response is then parsed and executed by the application. The results of the execution are then displayed to the user in the command-line interface.
When creating release notes, please use the template located in docs/RELEASE_NOTES_TEMPLATE.md. This ensures that all release notes are consistent in their format and content.
When creating a pull request description, please use the template located in docs/PULL_REQUEST_TEMPLATE.md. This ensures that all pull request descriptions are consistent in their format and content.
To gather the necessary information for the pull request description, the agent should use the git diff main...<branch-name> command, where <branch-name> is the name of the branch with the changes. This will show the differences between the main branch and the feature branch, which can then be used to create a comprehensive summary of the changes.