DuetGPT: An AI-Powered CLI Tool for Developers
Exciting News: DuetGPT has recently transitioned away from using Langchain and now utilizes OpenAI functions, resulting in enhanced reliability and performance.
Overview
DuetGPT is an experimental tool designed to assist developers with tasks related to coding and file systems. As a semi-autonomous agent, it takes instructions from the developer, issues necessary commands, and follows up with questions if clarification is needed. Importantly, DuetGPT executes these commands only after receiving developer approval. It also functions effectively as a general bash helper.
Key Features
DuetGPT builds upon OpenAI's GPT-4 language model, leveraging its advanced conversational abilities for two-way communication. A standout feature of DuetGPT is its utilization of the OpenAI API's function-calling capability, allowing the AI to perform tasks more effectively while engaging meaningfully in developer interactions.
Supported Models
- gpt-3.5-turbo-0613 (note that this model does not produce optimal code)
- gpt-4-0613
Example Tasks
Here are some tasks DuetGPT can perform:
- Refactoring code with better variable naming and inline comments.
- Creating bash scripts, such as one that lists all cars in a database.
- Searching for files containing specific text, like "DuetGPT".
- Drafting pull request descriptions based on commit messages.
Security Consideration
Important: DuetGPT does not have built-in safeguards. Developers must review and understand all commands suggested by the AI before execution.
Quick Demo
Witness DuetGPT in action by watching a 30-second demo where it assists in building a Node.js app that draws Mandelbrot fractals using ASCII characters:
Getting Started
To use DuetGPT, install the tool globally via npm:
npm install -g duet-gpt
Then, start the tool with the following command and enter your OpenAI API key:
duet-gpt
Developing with DuetGPT
For those interested in contributing or exploring the development side, here’s how to set it up:
- Clone the repository.
- Install dependencies with npm:
npm install
- Run DuetGPT using Yarn:
npm start
Interaction Example
Here's a simple task to showcase interaction with DuetGPT. Suppose you want to add .yarn/cache
to .gitignore
. DuetGPT might guide you through checking if .gitignore
exists and then appending the necessary path to it.
Known Issues
- For large files, the AI may produce incomplete outputs due to the limited context window of GPT-4. DuetGPT is most effective with smaller files, ideally one function per file.
Contributions
DuetGPT welcomes contributions. Interested individuals can open issues or submit pull requests to enhance the tool further.
Author and Contact Information
- Email: [email protected]
- Twitter: @kristoferlund
- Discord: kristofer#1475
License
DuetGPT is licensed under the MIT License.