fix: --yes flag now skips room confirmation in init

Pass yes flag through to detect_rooms_local so init --yes
skips both entity detection AND room approval prompts.
Agents and CI can now run init without interactive input.

Fixes #8
This commit is contained in:
bensig
2026-04-07 12:16:46 -07:00
parent 01a21dd60f
commit caa1169f04
2 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -59,7 +59,7 @@ def cmd_init(args):
print(" No entities detected — proceeding with directory-based rooms.")
# Pass 2: detect rooms from folder structure
detect_rooms_local(project_dir=args.dir)
detect_rooms_local(project_dir=args.dir, yes=getattr(args, "yes", False))
MempalaceConfig().init()
+5 -2
View File
@@ -274,7 +274,7 @@ def save_config(project_dir: str, project_name: str, rooms: list):
print(f"\n{'=' * 55}\n")
def detect_rooms_local(project_dir: str):
def detect_rooms_local(project_dir: str, yes: bool = False):
"""Main entry point for local setup."""
project_path = Path(project_dir).expanduser().resolve()
project_name = project_path.name.lower().replace(" ", "_").replace("-", "_")
@@ -303,5 +303,8 @@ def detect_rooms_local(project_dir: str):
source = "fallback (flat project)"
print_proposed_structure(project_name, rooms, len(files), source)
approved_rooms = get_user_approval(rooms)
if yes:
approved_rooms = rooms
else:
approved_rooms = get_user_approval(rooms)
save_config(project_dir, project_name, approved_rooms)