HAI Code Generator is a cutting-edge tool designed to simplify and automate task execution while enhancing code generation workflows. Leveraging Specif AI, it streamlines processes like task execution, file identification, and code documentation through intelligent automation and AI-driven capabilities.
ποΈ Built on Aider's powerful foundation for AI-assisted development.
- π Overview
- π₯ Getting Started
- β¨ Features
- π€ Contributing
- βΉοΈ Usage Instructions
- π License
- π Acknowledgments
- π§ Contact
HAI Code Generator is designed to boost productivity and precision by automating task execution and integrating file management capabilities. It combines intelligent file indexing, context generation, and LLM-driven automation to minimize manual effort and ensure task accuracy. With user-friendly interfaces and configurable settings, HAI Code Generator is perfect for both developers and teams aiming to enhance their workflows.
- Download the latest HAI Code Generator extension from our releases page
- Open Visual Studio Code β Extensions (β§βX) β Views and More Actions (Button with three dots in the top right corner of the left pane)
- Click Install from VSIX and select the downloaded β.vsixβ file
- Upon installation, press
Shift + Command + P
(on macOS) orShift + Ctrl + P
(on Windows), then selecthai Build: Initialize
from the command palette to load the extension.
A critical step in ensuring accurate and efficient file management, Code Preparation focuses on enhancing file context and accessibility through :
-
Contextual Code Comments
- Automatically generate contextual comments for every identified file, offering deeper insights and clarifications.
- Store all generated comments in a dedicated folder, ensuring they are easily accessible without cluttering your codebase.
-
Faiss DB Indexing
- Built on the robust vector-search engine, Faiss DB ensures real-time and highly accurate file indexing, enabling instant discovery of relevant files.
- Handles large repositories effortlessly, ensuring HAI Code Generator scales with your project's needs.
By performing Code Preparation as a mandatory step, you establish a foundation for seamless and contextual file discovery, enabling smoother task execution and streamlined workflows.
Harness the power of AI for seamless task management and user-story execution, HAI Code Generator integrates tasks generated by Specif AI, allowing them to be loaded directly into the HAI Tasks page. This streamlined process enables you to:
- Review AI-generated tasks within a dedicated interface.
- Execute them instantly with a single click.
- Manage all tasks in one place for improved clarity and productivity.
By centralizing AI-driven tasks in HAI Code Generator, you can maintain an efficient workflow from ideation to execution.
The Refine Existing Code feature empowers users to directly perform tasks on their existing codebase without the need to load tasks from Specif AI. This allows you to:
- Quickly edit or enhance your code based on specific requirements or improvements.
- Leverage AI-driven suggestions to make precise and efficient changes.
- Maintain control over your codebase while benefiting from automation and contextual understanding.
This feature provides a streamlined way to refine and improve your code without additional setup, ensuring productivity and flexibility in your workflow.
Enhanced file identification with intelligent discovery and retrieval, the File Identification feature provides the ability to locate and retrieve files swiftly within large codebases.
This feature ensures accurate and efficient file management by leveraging HAIβs advanced file-tracking capabilities to:
- Pinpoint relevant files based on your specific queries or requirements.
- Optimize navigation within extensive repositories to enhance productivity.
To contribute to the project, start by exploring open issues or checking our feature request board.
To get started with HAI Code Generator, follow these steps:
Local Development Instructions
-
Clone the repository:
git clone https://github.com/presidio-oss/aider-based-code-generator
-
Open the project in VSCode:
code aider-based-code-generator
-
Run the command:
make
-
Make sure to open plugin folder in a separate VS Code window.Launch by pressing F5 (or Run -> Start Debugging) to open a new VSCode window with the extension loaded. (You may need to install the esbuild problem matchers extension if you run into issues building the project.)
For detailed setup instructions, refer to:
Please read our Contributing Guidelines for more details.
Data Required:
- Absolute path of the
src
folder of the codebase/project - Application context β Description of the project
- Excluded folders(Optional) β Folders that should not be vectorized (e.g.,
node_modules
,.git
)
Prerequisite Condition:
- The codebase must be present within a
src
directory.
Workflow:
- The user clicks on "Prepare Code" after entering the necessary details.
- A Code Preparation orchestrator manages the workflow, with agents performing the following functions:
- Adds comments to the entire codebase before vectorizing, providing code context.
- Finds every file across the codebase, vectorizes the files, and stores them in a
tmp
folder. Faiss DB is used for the vector store.
- Once vectorization is complete, HAI sends a message to the user, asking if any additional tasks need to be done.
Data Required:
- Absolute path of the
tmp
folder containing the vectorized project - Absolute path of the requirements generated by the Requirements app
Prerequisite Condition:
- Code Preparation must be done.
- Tasks must be generated by Specif AI.
Workflow:
- Once the "Build from Requirements" button is clicked, two terminals are initialized:
- HAI Build Terminal: For chatting with the LLM and validating code generation.
- HAI Build Watch Terminal: For monitoring file changes and updating the vector store of the codebase accordingly.
- After the terminals are initialized, HAI prompts the user to select a task to be implemented in the codebase.
- The user clicks on the task of their choice from the list.
- The agent first identifies the files to be edited and seeks confirmation from the user regarding the files to be edited/added.
- Once the user confirms, the tasks are implemented through a few exchanges.
Data Required:
- Absolute path of the
tmp
folder containing the vectorized project
Prerequisite Condition:
- Code Preparation must be done.
Workflow:
- Once the "Start Conversation" button is clicked, two terminals are initialized:
- HAI Build Terminal: For chatting with the LLM and validating code generation.
- HAI Build Watch Terminal: For monitoring file changes and updating the vector store of the codebase accordingly.
- After the terminals are initialized, HAI asks for a task to be implemented in the codebase.
- The user enters the task they want to be completed.
- The agent first identifies the files to be edited and seeks confirmation from the user regarding the files to be edited/added.
- Once the user confirms, the tasks are implemented through a few exchanges.
This project is licensed under the Apache 2.0 License. See the LICENSE file for more details.
Thanks to all contributors and users for their support and feedback.
For any questions or feedback, please contact us at [email protected].