Skip to content

Commit

Permalink
Add option to improve code outside workspace
Browse files Browse the repository at this point in the history
This commit introduces a new option "--improve-plus" that allows the user to improve code from an existing project that is located outside of the workspace folder. This is useful when the user wants to work on a codebase that is not in the default workspace. The workspace path is now set based on whether this new option is used or not.
  • Loading branch information
rminchev1 committed Oct 6, 2023
1 parent 8d07074 commit ad8c96d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion gpt_engineer/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ def main(
"-i",
help="Improve code from existing project.",
),
improve_mode_plus: bool = typer.Option(
False,
"--improve-plus",
"-ip",
help="Improve code from existing project outside of the workspace folder",
),
lite_mode: bool = typer.Option(
False,
"--lite",
Expand Down Expand Up @@ -68,6 +74,9 @@ def main(
if steps_config == StepsConfig.DEFAULT:
steps_config = StepsConfig.LITE

if improve_mode is not True:
improve_mode = True if improve_mode_plus else False

if improve_mode:
assert (
steps_config == StepsConfig.DEFAULT
Expand All @@ -85,7 +94,7 @@ def main(
input_path = Path(project_path).absolute()
print("Running gpt-engineer in", input_path, "\n")

workspace_path = input_path #/ "workspace" running with -i is causing issues b/c it can't work on a existing code base
workspace_path = input_path if improve_mode_plus else input_path / "workspace"
project_metadata_path = input_path / ".gpteng"
memory_path = project_metadata_path / "memory"
archive_path = project_metadata_path / "archive"
Expand Down

0 comments on commit ad8c96d

Please sign in to comment.