Skip to content

Conversation

@emcconnell
Copy link
Collaborator

@emcconnell emcconnell commented Nov 25, 2024

When the user clicks on the clone or push buttons in the UI they will be presented with the ability to launch the GitHub flow to create an auth token that will be stored in local storage. This makes cloning and pushing to private repos possible and follows best practices by GitHub. There are other enhancements that can be added to this but IMP this looks and works well.

This pull request introduces several significant changes to the app/components/chat and related files to enhance the Git cloning feature. The most important changes include the addition of a Git clone modal, updates to the GitCloneButton component, and the creation of a spinner for the cloning process.

Enhancements to Git cloning feature:

Minor improvements:

Other changes:

Setup Requirements
Create a GitHub OAuth App:

Go to GitHub Settings > Developer Settings > OAuth Apps > New OAuth App
Fill in:
Application name: "Bolt Local" (or your preferred name)
Homepage URL: Your application URL
No callback URL needed (using Device Flow)
Environment Variables:
VITE_GITHUB_CLIENT_ID=[your client id]

389336454-3f6ec46e-1058-4b55-b7a9-a0557ae60a48

@emcconnell
Copy link
Collaborator Author

emcconnell commented Nov 25, 2024

SEE NEWER VIDEO LINKED BELOW

@coleam00
Copy link
Collaborator

This is FANTASTIC, thanks @emcconnell! I'll take a look at this tonight!

@coleam00
Copy link
Collaborator

Nice implementation @emcconnell! I love it!

Could you expand more on what this will be used for? Is this more to get ready for further integrations with Git like importing repos? It seems this sets up GitHub authentication but doesn't necessarily add a new "feature" to oTToDev. Or maybe I am missing something obvious.

But either way this is super important to have so thank you!

@emcconnell
Copy link
Collaborator Author

@coleam00

Is this more to get ready for further integrations with Git like importing repos?

Yes, that's correct. To merge now may be confusing as it doesn't add anything except auth to github. Also, @thecodacus is working in this direction also and not sure where we will land. If we wanted this, I could add some functionality for now like enhancing the current github push by using this auth flow. I only had time for this part and knew we had some open ideas on how to approach but wanted to toss what I had time for into the ring. So, maybe @wonderwhy-er or @thecodacus have some input on what to do with it for now.

@thecodacus
Copy link
Collaborator

this looks great @emcconnell , the git integration i am working on also will require a authentication if we want to clone a private repo. so this will really help for cloning gihub based repos. this is great 👍

@dustinwloring1988 dustinwloring1988 added the enhancement New feature or request label Dec 2, 2024
@emcconnell
Copy link
Collaborator Author

Added this to the features as a "utility" feature. This video will explain it best: https://www.youtube.com/watch?v=envCOTYCBVI

Can we merge this? Or do we have specific comments? I realize we have a place to paste user and token in settings/connection.

@emcconnell emcconnell changed the title GitHub authentication to the application using GitHub's Device Flow O… (feat) GitHub authentication to the application using GitHub's Device Flow O… Dec 20, 2024
@emcconnell
Copy link
Collaborator Author

emcconnell commented Dec 22, 2024

@emcconnell emcconnell marked this pull request as ready for review December 22, 2024 03:44
@thecodacus
Copy link
Collaborator

thecodacus commented Jan 4, 2025

@coleam00 @wonderwhy-er @thecodacus

See latest video here: https://youtu.be/Mq_eMsKszj4?si=uVnGzxqFUlmUlH2Z

this looks great, but can we show the connection option in the settings instead of the modal. cuz if the user want to use accessToken instead of oauth, then they will be confused

@emcconnell
Copy link
Collaborator Author

@coleam00 @wonderwhy-er @thecodacus
See latest video here: https://youtu.be/Mq_eMsKszj4?si=uVnGzxqFUlmUlH2Z

this looks great, but can we show the connection option in the settings instead of the modal. cuz if the user want to use accessToken instead of oauth, then they will be confused

Thank @thecodacus! I did have it there originally. @wonderwhy-er suggested to make it mor integrate into the flow of any GitHub action by the user, so I changed it to modal. I can make the option to use one or the other in settings. Does that sound good?

@thecodacus
Copy link
Collaborator

ohh..this looks very good in-terms of UX. but my only concern is, what if user has setup the github token using PAT, and does not want to go through the oauth app setup process sinse it requires setting up oauth app. how will he then see the UI? it will not allow them to clone right?

@emcconnell
Copy link
Collaborator Author

ohh..this looks very good in-terms of UX. but my only concern is, what if user has setup the github token using PAT, and does not want to go through the oauth app setup process sinse it requires setting up oauth app. how will he then see the UI? it will not allow them to clone right?

It's a good point. Let me give this one some thought and implement a solution. I will put this back in draft. It may take until the weekend to get it back out. Thanks for the comments!

@emcconnell emcconnell marked this pull request as draft January 6, 2025 15:28
@thecodacus
Copy link
Collaborator

thecodacus commented Jan 6, 2025

sure. plus one more thing that came to my mind that the current flow allow user to pull from any git repo not only just github. but this restricting user to only use github.

@flikites
Copy link

@thecodacus thanks for brining up all these valid points.

As I am currently using PAT in my own isomorphic script to accomlish git from the Bolt terminal. And I do plan to use something other than GitHub as my git base.

I wanted to join this conversation so that I'm not bumping heads and we are all working towards the same common goal.

A worthwhile git intergration in Bolt.

I presume at this point, it is a goal of the diy project to automatically install isomorphic-git and make it available through the terminal for the end user to use? And a UI for them to set their PAT

Is their any form of democratic process in place that is used to determine which .diy features make it into the .new product?

Also ...
@thecodacus one thing I'm seeing right now in my tests on bolt.new is that the.git directory is not being persisted on browser refresh. Should I expect that same behaviour on bolt.diy?

I'm new to Bolt and Stackblitz (and their webcontainers in general) - so I'm just trying to get a lay of the land;

Browsing through the communtiy forum I came across this post;

https://thinktank.ottomator.ai/t/idea-for-github-oauth-access/624/26?u=cloutedd

And I wholeheartedly agree that this is the way it should work.

I'd like to collaborate and contribute, but first I'd hope we can all b eon the same page and have a clear plan of action ahead.

@thecodacus
Copy link
Collaborator

Is their any form of democratic process in place that is used to determine which .diy features make it into the .new product?

Also ... @thecodacus one thing I'm seeing right now in my tests on bolt.new is that the.git directory is not being persisted on browser refresh. Should I expect that same behaviour on bolt.diy?

so .new and .diy are two separate project, we are not syncing features and being developed independently. so we might bring feature from one to another but not something that will surely happen.

@flikites
Copy link

Is their any form of democratic process in place that is used to determine which .diy features make it into the .new product?
Also ... @thecodacus one thing I'm seeing right now in my tests on bolt.new is that the.git directory is not being persisted on browser refresh. Should I expect that same behaviour on bolt.diy?

so .new and .diy are two separate project, we are not syncing features and being developed independently. so we might bring feature from one to another but not something that will surely happen.

Thanks for the reply.

@Stijnus Stijnus closed this Aug 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants