mtrx-cli 0.1.7 → 0.1.8
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 +4 -4
package/package.json
CHANGED
package/src/matrx/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.1.
|
|
1
|
+
__version__ = "0.1.8"
|
package/src/matrx/cli/main.py
CHANGED
|
@@ -226,9 +226,9 @@ def _run_matrx_browser_login(
|
|
|
226
226
|
return result
|
|
227
227
|
|
|
228
228
|
|
|
229
|
-
def _complete_matrx_login(state: dict) -> tuple[dict, bool]:
|
|
229
|
+
def _complete_matrx_login(state: dict, *, force: bool = False) -> tuple[dict, bool]:
|
|
230
230
|
auth_cfg = state.setdefault("auth", {}).setdefault("matrx", {})
|
|
231
|
-
if _has_matrx_login(state, env=os.environ):
|
|
231
|
+
if not force and _has_matrx_login(state, env=os.environ):
|
|
232
232
|
return state, False
|
|
233
233
|
if not _is_interactive_terminal():
|
|
234
234
|
raise ValueError("Login required. Run: mtrx login matrx --key mx_... or set MTRX_KEY")
|
|
@@ -334,12 +334,12 @@ def _cmd_login(args) -> int:
|
|
|
334
334
|
None,
|
|
335
335
|
base_url=state["auth"]["matrx"].get("base_url"),
|
|
336
336
|
)
|
|
337
|
-
if not key:
|
|
337
|
+
if args.web or not key:
|
|
338
338
|
if not args.web and not _is_interactive_terminal():
|
|
339
339
|
print("--key is required for non-interactive Matrx login", file=sys.stderr)
|
|
340
340
|
return 1
|
|
341
341
|
try:
|
|
342
|
-
state, changed = _complete_matrx_login(state)
|
|
342
|
+
state, changed = _complete_matrx_login(state, force=args.web)
|
|
343
343
|
except ValueError as exc:
|
|
344
344
|
print(str(exc), file=sys.stderr)
|
|
345
345
|
return 1
|