33
44The `gpt-engineer.toml` file is a TOML file that contains project-specific configuration used by the GPT Engineer CLI and gptengineer.app.
55"""
6-
76from dataclasses import asdict , dataclass , field
87from pathlib import Path
98
1211default_config_filename = "gpt-engineer.toml"
1312
1413example_config = """
15- [paths]
16- base = "./frontend" # base directory to operate in (for monorepos)
17- src = "./src" # source directory (under the base directory) from which context will be retrieved
18-
1914[run]
2015build = "npm run build"
2116test = "npm run test"
2217lint = "quick-lint-js"
2318
19+ [paths]
20+ base = "./frontend" # base directory to operate in (for monorepos)
21+ src = "./src" # source directory (under the base directory) from which context will be retrieved
22+
2423[gptengineer-app] # this namespace is used for gptengineer.app, may be used for internal experiments
2524project_id = "..."
2625
3332
3433
3534@dataclass
36- class _ProjectConfig :
37- base_dir : str | None = None
38- src_dir : str | None = None
35+ class _PathsConfig :
36+ base : str | None = None
37+ src : str | None = None
3938
4039
4140@dataclass
@@ -74,7 +73,7 @@ def filter_none(d: dict) -> dict:
7473class Config :
7574 """Configuration for the GPT Engineer CLI and gptengineer.app via `gpt-engineer.toml`."""
7675
77- project : _ProjectConfig = field (default_factory = _ProjectConfig )
76+ paths : _PathsConfig = field (default_factory = _PathsConfig )
7877 run : _RunConfig = field (default_factory = _RunConfig )
7978 gptengineer_app : _GptEngineerAppConfig | None = None
8079
@@ -87,8 +86,8 @@ def from_toml(cls, config_file: Path | str):
8786
8887 @classmethod
8988 def from_dict (cls , config_dict : dict ):
90- project = _ProjectConfig (** config_dict .get ("project" , {}))
9189 run = _RunConfig (** config_dict .get ("run" , {}))
90+ paths = _PathsConfig (** config_dict .get ("paths" , {}))
9291
9392 # load optional gptengineer-app section
9493 gptengineer_app_dict = config_dict .get ("gptengineer-app" , {})
@@ -107,7 +106,7 @@ def from_dict(cls, config_dict: dict):
107106 or None ,
108107 )
109108
110- return cls (project = project , run = run , gptengineer_app = gptengineer_app )
109+ return cls (paths = paths , run = run , gptengineer_app = gptengineer_app )
111110
112111 def to_dict (self ) -> dict :
113112 d = asdict (self )
0 commit comments