• Stars
    star
    163
  • Rank 231,141 (Top 5 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 1 year ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A conversational semi-autonomous developer assistant. AI pair programming without the copypasta.

DuetGPT

πŸŽ‰ News: DuetGPT no longer uses langchain but instead OpenAI functions. This means a significant improvement in reliability and performance.

DuetGPT is an experimental AI powered CLI tool and semi-autonomous agent that helps developers with coding tasks and file system tasks. The developer describes tasks to the AI who then issues commands or follow-up questions for clarification. After approval by the developer, DuetGPT automatically executes the commands issued by the AI.

DuetGPT also does really well as a general bash helper.

Works with OpenAI models:

  • gpt-3.5-turbo-0613 (does not produce any great code though)
  • gpt-4-0613

Example tasks:

  • Refactor index.js: add inline comments, improve variable naming.
  • Write a bash script that lists all cars in the database.
  • Find all files in current directory and subdirectories that contain the word "DuetGPT"
  • Write a PR description based on the commit messages in the PR.

DuetGPT builds on OpenAI's GPT-4 language model and uses its conversational capabilities to engage in a two-way conversation with the developer. It uses the newly released feature of the OpenAI API that allows the AI to make function calls.

⚠️ DuetGPT has no guardrails! Make sure you understand the commands given by the AI before executing them. ⚠️

Here is a 30 second demo, use DuetGPT to build a Node.js app that draws a mandelbrot fractal using ASCII characters to the console:

mandelbrot.mp4

Setup

Install the DuetGPT CLI tool globally using npm:

npm install -g duet-gpt

Usage

To start DuetGPT, run the following command:

duet-gpt

You will be prompted to enter your OpenAI API key. You can find your API key on the OpenAI dashboard.

     _            _              _
    | |          | |            | |
  __| |_   _  ___| |_ __ _ _ __ | |_
 / _` | | | |/ _ \ __/ _` | '_ \| __|
| (_| | |_| |  __/ || (_| | |_) | |_
 \__,_|\__,_|\___|\__\__, | .__/ \__|
                      __/ | |
                     |___/|_|

β”Œ  DuetGPT
β”‚
β—†  Please enter your OpenAI API key:
β”‚  sk-XXX…
β””

Setup for development

  1. Clone the repository.

  2. Install dependencies:

npm install
  1. Run DuetGPT using yarn:
npm start

Sample interaction

For the purposes of illustrating how interactions work, I chose a super simple task. Let's say you want to add .yarn/cache to .gitignore. Here is how to ask DuetGPT to help you with that:

     _            _              _
    | |          | |            | |
  __| |_   _  ___| |_ __ _ _ __ | |_
 / _` | | | |/ _ \ __/ _` | '_ \| __|
| (_| | |_| |  __/ || (_| | |_) | |_
 \__,_|\__,_|\___|\__\__, | .__/ \__|
                      __/ | |
                     |___/|_|

β”Œ  DuetGPT
β”‚
β—‡  LLM and memory started
β”‚
β”Œ πŸ€– ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
β”‚                                                                                                                            β”‚
β”‚                                                                                                                            β”‚
β”‚    My mission is to collaborate with you as a developer by providing specific bash or file modification commands to help   β”‚
β”‚    you complete your development-related tasks, while effectively engaging in two-way interactions.                        β”‚
β”‚                                                                                                                            β”‚
β”‚                                                                                                                            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚
β—‡  What would you like to do?
β”‚  Add .yarn/cache to .gitignore
β”‚
β—‡  AI response received
β”‚
β”Œ πŸ€– ────────────────────────────────────────────────────────────────────────┐
β”‚                                                                            β”‚
β”‚                                                                            β”‚
β”‚    First, I need to check if .gitignore exists in the current directory.   β”‚
β”‚                                                                            β”‚
β”‚     Β§ BASH                                                                 β”‚
β”‚                                                                            β”‚
β”‚     1 ls .gitignore                                                        β”‚
β”‚                                                                            β”‚
β”‚                                                                            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚
β—‡  What would you like to do?
β”‚  Run command
β”‚
β”Œ πŸ’» ────────────┐
β”‚                β”‚
β”‚   .gitignore   β”‚
β”‚                β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚
β—‡  AI response received
β”‚
β”Œ πŸ€– ────────────────────────────────────────────────────────────────────┐
β”‚                                                                        β”‚
β”‚                                                                        β”‚
β”‚    I will now append '.yarn/cache' to your existing .gitignore file.   β”‚
β”‚                                                                        β”‚
β”‚     Β§ BASH                                                             β”‚
β”‚                                                                        β”‚
β”‚     1 echo ".yarn/cache" >> .gitignore                                 β”‚
β”‚                                                                        β”‚
β”‚                                                                        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚
β—‡  What would you like to do?
β”‚  Run command
β”‚
β”Œ πŸ’» ────┐
β”‚        β”‚
β”‚   OK   β”‚
β”‚        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚
β—†  What would you like to do?
β”‚  Not sure
β””

Known issues

  • When proposing changes to large files, the AI may return incomplete results. The gpt-4 context window is limited, DuetGPT works best with small files - one function per file is ideal.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

Author

License

MIT

More Repositories

1

ic-wall

The Wall is a crossover Ethereum/Internet Computer demo app. Use Metamask to login to Internet Computer. Then, write on the wall! ∞
TypeScript
89
star
2

ic-siwe

SIWE, Sign in with Ethereum for ICP, the Internet Computer. Build cross chain Ethereum apps on ICP!
Rust
19
star
3

holotxt

Proof of concept Holochain app showcasing simple collaborative notes editing.
JavaScript
17
star
4

holochain-todo-redux

Gatsby/React example using redux and hc-redux-middleware to communicate with holochain hApp todo-list.
JavaScript
14
star
5

react-holochain-hook

Provides React apps with easy access to Holochain using the useHolochain() hook.
JavaScript
11
star
6

holochain-logistics

A minimal but function demo app of a simple logistics system using holochain. (Work in progress)
JavaScript
11
star
7

ic-pos

Accept Bitcoin payments (ckBTC) on the Internet Computer using this simple Point of Sale (POS) application.
TypeScript
9
star
8

ic-use-internet-identity

Hook that makes it easy to integrate IC Internet Identity into your React application
TypeScript
9
star
9

ic-siwe-react-demo-rust

React/Vite/Rust demo of the ic-siwe library, allowing ethereum apps to extend to the Internet Computer using Sign In with Ethereum (SIWE)
TypeScript
8
star
10

passport-score-issuer

This project demos the use of verifiable credentials on the Internet Computer. It uses Gitcoin Passport as an example source of verifiable credentials.
Rust
6
star
11

attest-fest

Batch create onchain EAS attestations using the power of CSV and copy/paste. Supports any old ETH wallet as well as fancy new Safe multisig wallets. It's an attest fest, yaay!
TypeScript
5
star
12

dog-eats-btc

DOGE EATS BTC - A dog eats btc. A demo and a GPT-4 game creation tutorial.
JavaScript
4
star
13

ic-pos-notifications

Netlify function that sends notifications for IC-POS using Courier/Mailgun/Twilio.
TypeScript
4
star
14

ic-use-actor

React Hook and context provider to make interacting with Internet Computer canisters more fun!
TypeScript
4
star
15

ic-use-internet-identity-demo

React/Vite template and demo. Use ic-use-internet-identity to authenticate IC users easily.
TypeScript
4
star
16

hc-graphql-todo

A todo sample app for Holochain RSM that integrates GraphQL functionality on the conductor (server) level.
JavaScript
4
star
17

ic-sqlite-chat

Chat demo for ICP that uses Sqlite for storage with a "local first" approach
TypeScript
3
star
18

ic-siws-react-demo-rust

React demo and template for IC-SIWS, Sign in with Solana for ICP, the Internet Computer. Build cross chain Solana apps on ICP!
TypeScript
3
star
19

gatsby-source-discourse-topic-list

Source topic lists from the Discourse discussion forum platform and transform into Gatsby nodes.
JavaScript
3
star
20

evm-coprocessor

Support library for IC canisters to simplify EVM interactions
Rust
3
star
21

likebutton

It had to be done.
TypeScript
3
star
22

ic-siwe-react-demo-ts

React/Vite/TypeScript demo of the ic-siwe library, allowing ethereum apps to extend to the Internet Computer using Sign In with Ethereum (SIWE)
TypeScript
3
star
23

passport-score-api-proxy

Proxy ICP IPv6 calls to the Gitcoin Passport API on IPv4
Rust
2
star
24

ic-siws

SIWS, Sign in with Solana for ICP, the Internet Computer. Build cross chain Solana apps on ICP!
Rust
2
star
25

evm-coprocessor-demo

Demo use of a support library for IC canisters to simplify EVM interactions
Rust
1
star
26

ic-ogimage

Dynamically generate OG images for projects hosted by IC smart contract canisters.
Rust
1
star