Add initial CLI support

This commit is contained in:
Andrew Mulbrook 2026-03-21 22:25:32 -05:00
parent e16d67e2f8
commit 22a9c68611
14 changed files with 168 additions and 26 deletions

19
trovedb/user_env.py Normal file
View file

@ -0,0 +1,19 @@
"""Environment for Trove"""
import os
from pathlib import Path
TROVE_HOME_DIR: Path = Path.home()
TROVE_USER_CONFIG_PATH: Path = TROVE_HOME_DIR / ".trove_config"
_ENV_TROVEBASE: str|None = os.environ.get("TROVEBASE", None)
def _search_trovebase() -> Path | str | None:
if _ENV_TROVEBASE is not None:
return Path(_ENV_TROVEBASE)
for path in Path.cwd().parents:
if (path / ".trove").exists():
return path
return None
TROVEBASE: Path | str | None = _search_trovebase()