Let's test custom GPT that can create git repositories
Tags: ai, chatgpt, openai
Published: 2024-02-09 11:53:00

---
title: Let's test custom GPT that can create git repositories
published: true
description: Custom GPT + GitHub API might be powerful combination
tags: #ai #chatgpt #openai
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vmaw0xolucn39o61hp1g.png
published_at: 2024-02-09 11:53 +0000
---


Recently Open AI introduced custom GPTs, and the feature that made me exited was actions. According to their [docs](https://platform.openai.com/docs/actions/introduction):
> Actions allow GPTs to integrate external data or interact with the real-world, such as connecting GPTs to databases, plugging them into your emails, or making them your shopping assistant, all through APIs.

What if we make GPT to interact with GitHub repositories with GitHub API? 
Here's the list of actions that could be useful: 
1. Create a repository
2. Read files from a repository
3. Create or update files in a repository

Probably, such custom GPT can open new possibilities in our developer's workflow.

So I've created a custom GPT. Here's the [link](https://chat.openai.com/g/g-Qg5HJDeCu-programmer)

In order to enable this GPT to interact with your GitHub, you should provide access token. Here's how to generate it:

1. Go to GitHub and open Settings
2. Click Developer Settings in the sidebar menu
3. Click Personal access token menu
4. You can generate Fine grained tokens or classic tokens. 
Please take into account, that if you want this GPT to create repo, you should give bigger scope. 

Let's open our [custom GPT](https://chat.openai.com/g/g-Qg5HJDeCu-programmer): 
![Custom GPT](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xt56jm2svtdr8nhre6np.png)

Let's put this prompt: 
> You should create Vanilla JS project without dependencies. 
I will open index.html, and I will see there one button called "Increase". Each item I press the button, I see the big number above the button which is incremented. Each time I press the button, the number is incremented and can be seen in the UI. Button should be also big. Both button and number should be at the center of the page. Button is below the number. 
You can generate files and upload them to GitHub right away.

![Custom GPT prompt](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ob373wnum9y8gogixb08.png)

GPT responded showing the understanding of what it should do. It requested an auth token from me, to interact with GitHub from my account. 

![Custom GPT answer](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/begf6t5zijc2fyeuwmbz.png)

It performed two actions, and gave me the link to the repository

![Custom GPT answer](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/83bylwz65oxm2pet5pn0.png)

Here's the result when I've opened `index.html` file:

![Gif of the result](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hcqju538zet416irow84.gif)


[Link to the AI generated repository](https://github.com/adambaialiev/vanilla-js-increment-project) 
[Link to the custom GPT](https://chat.openai.com/g/g-Qg5HJDeCu-programmer)

I think in the near future we will have very capable GPTs, that will be able to do the work for us, developers. And our role will come to the following: 
1. Generate prompts according to requirements/specifications of stakeholders
2. Feed this prompts to custom GPTs, and receive git commits as outputs.
3. Check the work, making sure that everything is working as expected. Do some small changes in code if necessary.

Please let me know what do you think.
In the next post I will provide a more complicated use case.