Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions trobz_local/main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import subprocess
import urllib.request
from enum import Enum
Expand Down Expand Up @@ -621,6 +622,24 @@ def ensure_db_user(ctx: typer.Context):
}


@app.command()
def edit_config():
"""Open config.toml in your editor."""
code_root = get_code_root()
config_path = code_root / "config.toml"

if not config_path.exists():
typer.secho(f"Config file not found: {config_path}", fg=typer.colors.YELLOW)
typer.echo("Generate one first with: tlc generate-config <profile>")
raise typer.Exit(code=1)

editor = os.environ.get("EDITOR", "vi")
result = subprocess.run([editor, str(config_path)]) # noqa: S603
if result.returncode != 0:
typer.secho(f"Editor exited with code {result.returncode}", fg=typer.colors.RED)
raise typer.Exit(code=1)


@app.command()
def doctor():
"""Check the health of your local development environment."""
Expand Down
Loading