1010
1111from codegen .cli .commands .start .docker_container import DockerContainer
1212from codegen .cli .commands .start .docker_fleet import CODEGEN_RUNNER_IMAGE
13+ from codegen .configs .models .repository import RepositoryConfig
1314from codegen .configs .models .secrets import SecretsConfig
1415from codegen .git .repo_operator .local_git_repo import LocalGitRepo
15- from codegen .git .schemas .repo_config import RepoConfig
1616from codegen .shared .network .port import get_free_port
1717
1818_default_host = "0.0.0.0"
2626def start_command (port : int | None , detached : bool = False , skip_build : bool = False , force : bool = False ) -> None :
2727 """Starts a local codegen server"""
2828 repo_path = Path .cwd ().resolve ()
29- repo_config = RepoConfig . from_repo_path ( str ( repo_path ) )
29+ repo_config = LocalGitRepo ( repo_path = repo_path ). get_repo_config ( )
3030 if (container := DockerContainer .get (repo_config .name )) is not None :
3131 if force :
3232 rich .print (f"[yellow]Removing existing runner { repo_config .name } to force restart[/yellow]" )
@@ -50,7 +50,7 @@ def start_command(port: int | None, detached: bool = False, skip_build: bool = F
5050 raise click .Abort ()
5151
5252
53- def _handle_existing_container (repo_config : RepoConfig , container : DockerContainer ) -> None :
53+ def _handle_existing_container (repo_config : RepositoryConfig , container : DockerContainer ) -> None :
5454 if container .is_running ():
5555 rich .print (
5656 Panel (
@@ -122,20 +122,20 @@ def _get_platform() -> str:
122122 return "linux/amd64"
123123
124124
125- def _run_docker_container (repo_config : RepoConfig , port : int , detached : bool ) -> None :
125+ def _run_docker_container (repo_config : RepositoryConfig , port : int , detached : bool ) -> None :
126126 rich .print ("[bold blue]Starting Docker container...[/bold blue]" )
127127 container_repo_path = f"/app/git/{ repo_config .name } "
128128 name_args = ["--name" , f"{ repo_config .name } " ]
129129 envvars = {
130- "REPOSITORY_LANGUAGE" : repo_config .language . value ,
131- "REPOSITORY_OWNER" : LocalGitRepo (repo_config .repo_path ).owner ,
130+ "REPOSITORY_LANGUAGE" : repo_config .language ,
131+ "REPOSITORY_OWNER" : LocalGitRepo (repo_config .path ).owner ,
132132 "REPOSITORY_PATH" : container_repo_path ,
133- "GITHUB_TOKEN" : SecretsConfig ().github_token ,
133+ "GITHUB_TOKEN" : SecretsConfig (root_path = repo_config . path ).github_token ,
134134 "PYTHONUNBUFFERED" : "1" , # Ensure Python output is unbuffered
135135 "CODEBASE_SYNC_ENABLED" : "True" ,
136136 }
137137 envvars_args = [arg for k , v in envvars .items () for arg in ("--env" , f"{ k } ={ v } " )]
138- mount_args = ["-v" , f"{ repo_config .repo_path } :{ container_repo_path } " ]
138+ mount_args = ["-v" , f"{ repo_config .path } :{ container_repo_path } " ]
139139 entry_point = f"uv run --frozen uvicorn codegen.runner.servers.local_daemon:app --host { _default_host } --port { port } "
140140 port_args = ["-p" , f"{ port } :{ port } " ]
141141 detached_args = ["-d" ] if detached else []
0 commit comments