MCPcopy Create free account
hub / github.com/AutoForgeAI/autoforge / get_dev_command

Function get_dev_command

server/services/project_config.py:334–360  ·  view source on GitHub ↗

Get the effective dev command for a project. Returns the custom command if one is configured, otherwise returns the auto-detected default command. Args: project_dir: Path to the project directory. Returns: The effective dev command (custom if set, else detecte

(project_dir: Path)

Source from the content-addressed store, hash-verified

332
333
334def get_dev_command(project_dir: Path) -> str | None:
335 """
336 Get the effective dev command for a project.
337
338 Returns the custom command if one is configured,
339 otherwise returns the auto-detected default command.
340
341 Args:
342 project_dir: Path to the project directory.
343
344 Returns:
345 The effective dev command (custom if set, else detected),
346 or None if neither is available.
347 """
348 project_dir = Path(project_dir).resolve()
349
350 # Check for custom command first
351 config = _load_config(project_dir)
352 custom_command = config.get("dev_command")
353
354 if custom_command and isinstance(custom_command, str):
355 # Type is narrowed to str by isinstance check
356 result: str = custom_command
357 return result
358
359 # Fall back to auto-detected command
360 return get_default_dev_command(project_dir)
361
362
363def set_dev_command(project_dir: Path, command: str) -> None:

Callers 1

start_devserverFunction · 0.85

Calls 2

_load_configFunction · 0.85
get_default_dev_commandFunction · 0.85

Tested by

no test coverage detected