model-boss/scripts/run/script_runner.py
2026-03-06 02:13:58 -08:00

78 lines
2 KiB
Python
Executable file

#!/usr/bin/env python3
"""
@model-boss Workspace Script Runner
Unified command runner for the @model-boss workspace.
Usage:
./run install # Install all dependencies
./run dev <service> # Start development server
./run prod <service> # Start production server
./run --help # Show all available commands
./run <command> --help # Show command-specific help
"""
import sys
from pathlib import Path
from lilith_workspace_runner import ScriptRunner, WorkspaceConfig
from lilith_workspace_runner.commands import (
create_dev_command,
create_install_command,
create_prod_command,
)
config = WorkspaceConfig(
name="@model-boss",
typescript_packages=[
"packages/core-ts",
"services/coordinator/types",
"services/coordinator/client",
"frontend",
],
python_packages=[
"packages/core-py",
"packages/loaders-py",
"services/coordinator/service",
"services/llama-http/service",
],
service_ports_file="ports.yaml",
service_ports_section="model-boss",
service_dirs={
"coordinator": "services/coordinator/service",
"llama-http": "services/llama-http/service",
},
service_apps={
"coordinator": "model_boss_coordinator:create_app",
"llama-http": "llama_http:create_app",
},
service_modules={
"coordinator": "model_boss_coordinator",
"llama-http": "llama_http",
},
service_env={
"coordinator": {"MODEL_BOSS_PORT": "{port}"},
"llama-http": {"LLAMA_HTTP_PORT": "{port}"},
},
)
def main():
"""Main entry point."""
script_path = Path(__file__).resolve()
workspace_root = script_path.parent.parent.parent
runner = ScriptRunner(workspace_root, config.name)
for register in [
create_install_command(config),
create_dev_command(config),
create_prod_command(config),
]:
register(runner)
sys.exit(runner.run())
if __name__ == "__main__":
main()