mtrx-cli 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/matrx/__init__.py +1 -1
- package/src/matrx/cli/main.py +23 -0
package/package.json
CHANGED
package/src/matrx/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.1.
|
|
1
|
+
__version__ = "0.1.4"
|
package/src/matrx/cli/main.py
CHANGED
|
@@ -262,6 +262,26 @@ def _complete_codex_login() -> None:
|
|
|
262
262
|
raise ValueError("Codex login did not complete successfully")
|
|
263
263
|
|
|
264
264
|
|
|
265
|
+
def _complete_claude_login(state: dict) -> tuple[dict, bool]:
|
|
266
|
+
token = (read_claude_oauth_token() or "").strip()
|
|
267
|
+
if token:
|
|
268
|
+
return state, False
|
|
269
|
+
if not _is_interactive_terminal():
|
|
270
|
+
raise ValueError("Claude login required. Run: claude auth login")
|
|
271
|
+
|
|
272
|
+
print("Claude login required.")
|
|
273
|
+
if not _prompt_yes_no("Run `claude auth login` now?", default=True):
|
|
274
|
+
raise ValueError("Claude login cancelled")
|
|
275
|
+
|
|
276
|
+
executable = find_executable("claude") or "claude"
|
|
277
|
+
result = subprocess.run([executable, "auth", "login"], check=False)
|
|
278
|
+
token = (read_claude_oauth_token() or "").strip()
|
|
279
|
+
if result.returncode != 0 or not token:
|
|
280
|
+
raise ValueError("Claude login did not complete successfully")
|
|
281
|
+
|
|
282
|
+
return state, False
|
|
283
|
+
|
|
284
|
+
|
|
265
285
|
def _maybe_promote_direct_route(state: dict, tool: str, route: str | None) -> tuple[str | None, bool]:
|
|
266
286
|
if route is not None:
|
|
267
287
|
return route, False
|
|
@@ -569,6 +589,9 @@ def _cmd_launch(tool: str, route: str | None, remainder: list[str]) -> int:
|
|
|
569
589
|
auth_changed = auth_changed or login_changed
|
|
570
590
|
if tool == "codex":
|
|
571
591
|
_complete_codex_login()
|
|
592
|
+
if tool == "claude":
|
|
593
|
+
state, login_changed = _complete_claude_login(state)
|
|
594
|
+
auth_changed = auth_changed or login_changed
|
|
572
595
|
initialized = initialize_first_launch_route(state, tool, route)
|
|
573
596
|
state, changed = prepare_routed_setup(
|
|
574
597
|
state,
|