gpt-pilot icon indicating copy to clipboard operation
gpt-pilot copied to clipboard

[Enhancement]: Using GPT Pilot for existing projects

Open saleh-mir opened this issue 1 year ago • 11 comments

Congratulation on the amazing project. It is exactly what I've been thinking project generation should be.

Is it possible to use GPT-Pilot inside a project that already has a certain amount of code in it?

Preferably, is it possible for GPT-Pilot to make the other code similar to the existing code? For example, in a web application, if I have implemented a certain number of endpoints, I need GPT-Pilot to implement the remaining functionalities similar to the previous ones.

saleh-mir avatar Dec 21 '23 21:12 saleh-mir

I second this feature request. It would be great to have "Create New Project" or "Import Existing Project". By pointing GPT-Pilot to a package.json file, it could understand the project details. When scanning, it could ignore certain folders like "/node_modules" to save time.

roscoevanderboom avatar Dec 24 '23 03:12 roscoevanderboom

or allow cloning a git repo into the project, indexing it, learning of the technologies used and taking from there. Probably you will want to fill in the information about the features, point to the implementation of each feature and the corresponding test cases... Could be quite a bit of work to get started with a large project.

Have you considered bootstrapping this project with gpt-pilot?

evgenyfadeev avatar Dec 24 '23 16:12 evgenyfadeev

I believe this should be handled by using aider

They are focused on understanding existing codebases and trying to solve that issue for large ones

In fact, maybe a merger or deeper collaboration between both projects could generate a de facto standard for coding agents

svallory avatar Dec 31 '23 13:12 svallory

Great suggestion - would love something like this to be able to handle projects that have been going on for many years - would streamline a lot of work going forward on projects that already exist.

outrank-james avatar Jan 29 '24 16:01 outrank-james

any updates on this?

cranyy avatar Mar 10 '24 05:03 cranyy

Is anyone implementing this feature?

zkewind avatar May 07 '24 09:05 zkewind

please god implement this feature PLEAAAAAAAAAAAAAAAAAAASE

IncomeStreamSurfer avatar May 11 '24 19:05 IncomeStreamSurfer

i feel literally stuck on a massive project i am working on because the bot considers it finished and won't let me work on it, and i have now changed the code myself beyond its recognition. it's proving super hard to do anything. I'd love to just be able to open my code as it is currently working and then run gpt pilot. Just add a .gptpilot.ignore or whatever for all the node modules etc... plsplsplslsp do this

IncomeStreamSurfer avatar May 11 '24 19:05 IncomeStreamSurfer

Some ideas about implementing this feature:

Based on my current understanding of the codebase, the following fields are required to form a valid project:

  • name (just simply ask user)
  • project description (just simply ask user)
  • user stories (can be inferred from project description, add a confirm step for this?)
  • architecture (just simply ask user)
  • dependencies (extract from package.json?)
  • previous features (filter implemented features from project tasks)
  • future features (sort unimplemented features reasonably?)

If these can be generated, we can theoretically integrate on existing project.

How does it look?

5eqn avatar May 21 '24 11:05 5eqn

Some ideas about implementing this feature:

Based on my current understanding of the codebase, the following fields are required to form a valid project:

  • name (just simply ask user)
  • project description (just simply ask user)
  • user stories (can be inferred from project description, add a confirm step for this?)
  • architecture (just simply ask user)
  • dependencies (extract from package.json?)
  • previous features (filter implemented features from project tasks)
  • future features (sort unimplemented features reasonably?)

If these can be generated, we can theoretically integrate on existing project.

How does it look?

Whatever you need to do do it - thank you

IncomeStreamSurfer avatar May 21 '24 11:05 IncomeStreamSurfer

It's done. See PR #952.

Since it may take a long time for the review and release of the new version of the program, you can manually copy the two files from the PR to the project source code directory for use. Refer to the header of ./pilot/load_exist.py for usage instructions. The other file is pilot/prompts/documentation/summary_codebase.prompt.

Please note that due to the context limitations of large language models (LLMs) and the implementation of the program, there is a limit on the number of source code files that can be loaded. This depends on the token limit of the LLM and the size of the source files. It is recommended to use an LLM API that supports a larger context token count if possible. You can experiment with the Example_Project that comes with the gpt-pilot project.

Or ,https://github.com/zkewind/gpt-pilot-cn/tree/load_exits_project

zkewind avatar May 24 '24 16:05 zkewind

First, props to @zkewind for doing this!

We had the feature in our sights for a long time (too long!), and while we were working on it for 0.2 (which we just released in tandem with the VSCode extension today), I love how Jack just went ahead and did it. It really shows the power of open source and I appreciate the effort and initiative!

While we're not making changes to our 0.1 version any more it's still available (in version-0.1 branch) and some people may not want or be able to switch and @zkewind 's PR will be very useful for them.

Now for the announcement: as of today, loading existing project is supported out-of-the-box in gpt-pilot 0.2.x (and if you're using our VSCode extension, in Pythagora 0.2.x). It's still experimental and also has similar limitations (and in fact works similarly to his, although we've been able to to take advantage of some of the things we reworked in our 0.2 rewrite to make it seem easy), but we do hope it'll be useful.

As can be seen from when this issue was opened, it's a long standing bug and it gives me great satisfaction to hit the "Close as complete" button on this one. I hope you'll like what we did (and if you encounter problems, file a bug or even better join us on Discord).

senko avatar Jun 04 '24 21:06 senko