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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mtrx-cli",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "MATRX CLI for routing Codex and Claude through Matrx",
5
5
  "homepage": "https://mtrx.so",
6
6
  "repository": {
@@ -1 +1 @@
1
- __version__ = "0.1.7"
1
+ __version__ = "0.1.8"
@@ -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