create AWS infra

This commit is contained in:
2026-05-15 10:26:43 -04:00
parent 6563b4cc4b
commit 1bc5052d22
21 changed files with 1502 additions and 0 deletions

29
src/commands/utils.py Normal file
View File

@@ -0,0 +1,29 @@
from pathlib import Path
import typer
import yaml
from rich.console import Console
from src.config import Config
CONSOLE = Console()
CONFIG_OPT = typer.Option("config.yaml", "--config", "-c", help="Path to config file")
def load_config(path: str = "config.yaml") -> Config:
config_path = Path(path)
if not config_path.exists():
raise FileNotFoundError(
f"Config file not found: {config_path}. Run 'qai-cli init' to create one."
)
with open(config_path) as f:
data = yaml.safe_load(f)
return Config.model_validate(data)
def load_cfg(path: str = "config.yaml") -> Config:
try:
return load_config(path)
except FileNotFoundError as e:
CONSOLE.print(f"[red]{e}[/red]")
raise typer.Exit(1)