Originally forked from o1-engineer
A command-line tool designed to assist developers in managing and interacting with their projects efficiently. Leveraging the power of Ollama's local language models, ollama-engineer provides functionalities such as code generation, file editing, project planning, and code review to streamline your development workflow.
- Local LLM Integration: Now uses Ollama for local language model processing, eliminating the need for an external API.
- Model Selection: Users can choose from available Ollama models at startup.
- Enhanced File and Folder Management: The
/add
and/edit
commands support adding and modifying both files and folders, providing greater flexibility in managing your project structure. - Project Planning: The
/planning
command allows users to create comprehensive project plans that can be used to generate files and directories systematically. - Advanced Workflows: New examples demonstrate how to integrate planning and creation commands for efficient project setup.
- Automated Code Generation: Generate code for your projects effortlessly using local LLMs.
- File Management: Add, edit, and manage project files directly from the command line.
- Interactive Console: User-friendly interface with rich text support for enhanced readability.
- Conversation History: Save and reset conversation histories as needed.
- Code Review: Analyze and review code files for quality and suggestions.
- Project Planning: Create comprehensive project plans to guide development.
- Initialization: The script initializes global variables and sets up the connection to Ollama.
- Model Selection: Users choose from available Ollama models at startup.
- Handling User Commands: It listens for user commands such as
/edit
,/create
,/add
,/review
, and/planning
, processing them accordingly. - Processing File and Folder Modifications: Based on the user's instructions, the script modifies files and folders, adds new content, or creates new files and folders as needed.
- AI-Generated Instructions: The tool interacts with Ollama to generate instructions and suggestions for code generation, editing, project planning, and reviewing.
- Applying Changes: Changes are applied to the project files and folders based on the AI-generated instructions.
- Managing Conversation History and Added Files: The script manages the conversation history and keeps track of files and folders added to the context.
- Python: Ensure you have Python 3.7 or higher installed. Download Python
- Ollama: Install Ollama on your system. Ollama Installation Guide
-
Clone the Repository:
git clone https://github.com/ZacharyZhang-NY/Ollama-Engineer
-
Navigate to the Project Directory:
cd Ollama-Engineer
-
Install Dependencies:
pip install -r requirements.txt
Launch the application using the following command:
python ollama-eng.py
/edit
: Edit files or folders (followed by file or folder paths)/create
: Create files or folders (followed by instructions)/add
: Add files or folders to context (followed by file or folder paths)/planning
: Plan project structure and tasks (followed by instructions)/debug
: Print the last AI response/reset
: Reset chat context and clear added files/review
: Review and analyze code files for quality and potential improvements (followed by file or folder paths)/quit
: Exit the program
Here's an example workflow that demonstrates using /planning
followed by /create
to generate files based on the created plan:
-
Planning the Project:
You: /planning Create a basic web application with the following structure: - A frontend folder containing HTML, CSS, and JavaScript files. - A backend folder with server-side scripts. - A README.md file with project documentation.
-
Creating the Project Structure based on the Plan:
You: /create Generate the project structure based on the above plan.
This demonstrates how to use the new /planning
command to define a project structure, and then /create
to generate the files and folders accordingly.
You: /add src/main.py src/utils/helper.py src/models/
You: /planning Outline a RESTful API project with separate folders for models, views, and controllers.
You: /create Set up the basic structure for a RESTful API project with models, views, and controllers folders, including initial files.
You: /edit src/main.py src/models/user.py src/views/user_view.py
We welcome contributions! Please follow these steps:
-
Fork the repository.
-
Create a new branch (
git checkout -b feature/YourFeature
). -
Commit your changes (
git commit -m 'Add some feature'
). -
Push to the branch (
git push origin feature/YourFeature
). -
Open a pull request.