MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / _run_tui_subcommand

Function _run_tui_subcommand

src/cli.py:192–212  ·  view source on GitHub ↗

``clawcodex tui`` — the explicit form of the default interactive entry. Unlike the lean ``mcp`` / ``doctor`` / ``daemon`` fast-paths, this launches the tool-executing agent-server, so it runs the SAME interactive bootstrap (``run_pre_action`` — config-env application + trust seeding) an

(rest: list[str])

Source from the content-addressed store, hash-verified

190
191
192def _run_tui_subcommand(rest: list[str]) -> int:
193 """``clawcodex tui`` — the explicit form of the default interactive entry.
194
195 Unlike the lean ``mcp`` / ``doctor`` / ``daemon`` fast-paths, this launches
196 the tool-executing agent-server, so it runs the SAME interactive bootstrap
197 (``run_pre_action`` — config-env application + trust seeding) and
198 folder-trust gate as the default ``clawcodex`` entry before handing off to
199 the Ink client. Without this, ``clawcodex tui`` would reach the backend with
200 no trust prompt and without the project env the child inherits.
201 """
202 from types import SimpleNamespace
203
204 from src.init import run_pre_action
205
206 # ``print=False`` => treated as an interactive session by run_pre_action.
207 run_pre_action(SimpleNamespace(print=False))
208 if not _gate_folder_trust():
209 return 1
210 from src.entrypoints.tui_launcher import run_tui_launcher
211
212 return run_tui_launcher(rest)
213
214
215def _prompt_folder_trust() -> bool:

Callers 1

mainFunction · 0.85

Calls 3

run_pre_actionFunction · 0.90
run_tui_launcherFunction · 0.90
_gate_folder_trustFunction · 0.85

Tested by

no test coverage detected