AI powered cli coding agent that monitors your dev/test server and fixes errors and adds features
Python
204
175 commits
updated Aug 20, 2024
Dravid (DRD) is an advanced, AI-powered CLI coding framework (in alpha) designed to follow user instructions until the job is done, even if it means fixing errors, including installation issues. It can also listen to a live dev server or a test server (in watch mode) or any processes with interactive pair programming. It can generate code and fix errors autonomously until the intended result is achieved.
To install Dravid, run the following command:
pip install dravid
To upgrade for latest fixes:
pip install --upgrade dravid
After installation, you can use the drd command directly from your terminal. Here are some common usage examples:
NOTE: for better results, go step by step and communicate clearly. You can also define project_guidelines.txt which will be referenced in the main query, you can use this to instruct on how the code should be generated etc.
Also, any png or jpg files that will be generated and needs to be replaced will have placeholder prefix, so you know that it has to be replaced.
You can run the development server with automatic error fixing.
This command will start your dev server or test server and then continually fix any errors and then restart, you can sitback and sip coffee :) You can give instructions into this mode, it will generate code, fix any errors, restart. You can also provide image for reference, or any number of files for references.
drd "rails server"
drd "npm run test:watch"
drd --do "create a nextjs project"
drd --do "make the walls permeable in the snake_game file"
When you have larger string or if you want to copy paste a error stack with double quotes etc, please use this.
drd --do """
Fix this error:
....
"""
Ask questions or generate content:
drd --ask "how is the weather"
Generate a file directly:
drd --ask "create a MIT LICENSE file, just the file, don't respond with anything else" >> LICENSE
--ask is much faster than the execute command because it doesn't load project context or project guidelines (you can create your own project_guidelines.txt)
Use image references in your queries:
drd --do "make the home image similar to the image" --image "~/Downloads/reference.png"
Dravid supports multiple AI providers and models to suit your needs. Here's an overview of the available options:
By default, Dravid uses Claude 3.5 Sonnet from Anthropic. Claude is known for its strong performance across a wide range of tasks, including coding, analysis, and creative writing.
To use Claude, set the following environment variable:
CLAUDE_API_KEY=your_claude_api_key_here
Dravid also supports OpenAI's models. When using OpenAI, the default model is gpt-4o.
To use OpenAI, set the following environment variables:
DRAVID_LLM=openai
OPENAI_API_KEY=your_openai_api_key_here
You can control the specific OpenAI model used by changing the OPENAI_MODEL environment variable.
For example:
OPENAI_MODEL=gpt-4 # for standard GPT-4
OPENAI_MODEL=gpt-3.5-turbo # for GPT-3.5 Turbo
Depending on your chosen AI provider, you'll need to set different environment variables:
DRAVID_LLM=azure
AZURE_OPENAI_API_KEY=your_azure_api_key_here
AZURE_OPENAI_API_VERSION=your_api_version_here
AZURE_OPENAI_ENDPOINT=your_azure_endpoint_here
AZURE_OPENAI_DEPLOYMENT_NAME=your_deployment_name_here
DRAVID_LLM=custom
DRAVID_LLM_API_KEY=your_custom_api_key_here
DRAVID_LLM_ENDPOINT=your_custom_endpoint_here
DRAVID_LLM_MODEL=your_preferred_model_here
DRAVID_LLM=ollama
DRAVID_LLM_MODEL=your_preferred_local_model_here
src/drd/: Main source code directory
cli/: Command-line interface modulesapi/: API interactionutils/: Utility functions and helpersprompts/: AI prompt templatesmetadata/: Project metadata managementtests/: Test suite for the projectWe welcome contributions to Dravid! Please see our Contributing Guide for more details on how to get started.
To install Dravid, you need Python 3.7+ and Poetry. Follow these steps:
Clone the repository:
git clone https://github.com/vysakh0/dravid.git
cd dravid
Install dependencies using Poetry:
poetry install
Set up environment variables:
Create a .env file in the project root and add your API keys:
For eg: if you use CLAUDE, if you use other services, you can add those env.
CLAUDE_API_KEY=your_claude_api_key_here
You can use Dravid to add features or functionalities to the project. As this project uses drd.json and has used Dravid to build Dravid.
poetry run drd --do "refactor api_utils"
or
poetry run drd --do "add tests for utils/utils"
poetry run drd --ask "who are you"
After adding some functionalities, if you want to test how it works, I suggest creating a directory
called myapp or testapp or test-app in the root of this project. These folder names are already in .gitignore.
cd myapp
poetry run drd --do "create a simple elixir project"
To run the test suite:
poetry run pytest
drd --version it means the pygments library (dependency of openai) needs upgradepip install --upgrade pygments
This project is licensed under the MIT License - see the LICENSE file for details.
For questions, suggestions, or issues, please open an issue on the GitHub repository or contact the maintainers directly.
Happy coding with Dravid!
175 commits
Python
100.0%
AI powered cli coding agent that monitors your dev/test server and fixes errors and adds features
Python
204
175 commits
updated Aug 20, 2024
Dravid (DRD) is an advanced, AI-powered CLI coding framework (in alpha) designed to follow user instructions until the job is done, even if it means fixing errors, including installation issues. It can also listen to a live dev server or a test server (in watch mode) or any processes with interactive pair programming. It can generate code and fix errors autonomously until the intended result is achieved.
To install Dravid, run the following command:
pip install dravid
To upgrade for latest fixes:
pip install --upgrade dravid
After installation, you can use the drd command directly from your terminal. Here are some common usage examples:
NOTE: for better results, go step by step and communicate clearly. You can also define project_guidelines.txt which will be referenced in the main query, you can use this to instruct on how the code should be generated etc.
Also, any png or jpg files that will be generated and needs to be replaced will have placeholder prefix, so you know that it has to be replaced.
You can run the development server with automatic error fixing.
This command will start your dev server or test server and then continually fix any errors and then restart, you can sitback and sip coffee :) You can give instructions into this mode, it will generate code, fix any errors, restart. You can also provide image for reference, or any number of files for references.
drd "rails server"
drd "npm run test:watch"
drd --do "create a nextjs project"
drd --do "make the walls permeable in the snake_game file"
When you have larger string or if you want to copy paste a error stack with double quotes etc, please use this.
drd --do """
Fix this error:
....
"""
Ask questions or generate content:
drd --ask "how is the weather"
Generate a file directly:
drd --ask "create a MIT LICENSE file, just the file, don't respond with anything else" >> LICENSE
--ask is much faster than the execute command because it doesn't load project context or project guidelines (you can create your own project_guidelines.txt)
Use image references in your queries:
drd --do "make the home image similar to the image" --image "~/Downloads/reference.png"
Dravid supports multiple AI providers and models to suit your needs. Here's an overview of the available options:
By default, Dravid uses Claude 3.5 Sonnet from Anthropic. Claude is known for its strong performance across a wide range of tasks, including coding, analysis, and creative writing.
To use Claude, set the following environment variable:
CLAUDE_API_KEY=your_claude_api_key_here
Dravid also supports OpenAI's models. When using OpenAI, the default model is gpt-4o.
To use OpenAI, set the following environment variables:
DRAVID_LLM=openai
OPENAI_API_KEY=your_openai_api_key_here
You can control the specific OpenAI model used by changing the OPENAI_MODEL environment variable.
For example:
OPENAI_MODEL=gpt-4 # for standard GPT-4
OPENAI_MODEL=gpt-3.5-turbo # for GPT-3.5 Turbo
Depending on your chosen AI provider, you'll need to set different environment variables:
DRAVID_LLM=azure
AZURE_OPENAI_API_KEY=your_azure_api_key_here
AZURE_OPENAI_API_VERSION=your_api_version_here
AZURE_OPENAI_ENDPOINT=your_azure_endpoint_here
AZURE_OPENAI_DEPLOYMENT_NAME=your_deployment_name_here
DRAVID_LLM=custom
DRAVID_LLM_API_KEY=your_custom_api_key_here
DRAVID_LLM_ENDPOINT=your_custom_endpoint_here
DRAVID_LLM_MODEL=your_preferred_model_here
DRAVID_LLM=ollama
DRAVID_LLM_MODEL=your_preferred_local_model_here
src/drd/: Main source code directory
cli/: Command-line interface modulesapi/: API interactionutils/: Utility functions and helpersprompts/: AI prompt templatesmetadata/: Project metadata managementtests/: Test suite for the projectWe welcome contributions to Dravid! Please see our Contributing Guide for more details on how to get started.
To install Dravid, you need Python 3.7+ and Poetry. Follow these steps:
Clone the repository:
git clone https://github.com/vysakh0/dravid.git
cd dravid
Install dependencies using Poetry:
poetry install
Set up environment variables:
Create a .env file in the project root and add your API keys:
For eg: if you use CLAUDE, if you use other services, you can add those env.
CLAUDE_API_KEY=your_claude_api_key_here
You can use Dravid to add features or functionalities to the project. As this project uses drd.json and has used Dravid to build Dravid.
poetry run drd --do "refactor api_utils"
or
poetry run drd --do "add tests for utils/utils"
poetry run drd --ask "who are you"
After adding some functionalities, if you want to test how it works, I suggest creating a directory
called myapp or testapp or test-app in the root of this project. These folder names are already in .gitignore.
cd myapp
poetry run drd --do "create a simple elixir project"
To run the test suite:
poetry run pytest
drd --version it means the pygments library (dependency of openai) needs upgradepip install --upgrade pygments
This project is licensed under the MIT License - see the LICENSE file for details.
For questions, suggestions, or issues, please open an issue on the GitHub repository or contact the maintainers directly.
Happy coding with Dravid!
175 commits
Python
100.0%