mtrx-cli 0.1.17 → 0.1.19

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.17",
3
+ "version": "0.1.19",
4
4
  "description": "MATRX CLI for routing Codex, Claude, and Cursor through Matrx",
5
5
  "homepage": "https://mtrx.so",
6
6
  "repository": {
@@ -1 +1 @@
1
- __version__ = "0.1.16"
1
+ __version__ = "0.1.19"
@@ -475,13 +475,16 @@ def _build_codex_env(
475
475
  proxy_base = ensure_v1_url(matrx.get("base_url"))
476
476
  mx_key, matrx_auth_source = _resolve_matrx_route_key(state, env)
477
477
  direct_key = (openai.get("key") or "").strip()
478
+ env_openai_key = (env.get("OPENAI_API_KEY") or "").strip()
478
479
 
479
480
  if route == "matrx":
480
481
  if not mx_key:
481
482
  raise ValueError("No Matrx key available. Run: mtrx login matrx --key mx_... or set MTRX_KEY")
482
- access_token = read_codex_access_token()
483
- if not access_token:
484
- raise ValueError("Codex login required. Run: codex login")
483
+ provider_bearer = env_openai_key or direct_key or read_codex_access_token()
484
+ if not provider_bearer:
485
+ raise ValueError(
486
+ "Codex login required. Run: codex login or configure an OpenAI API key."
487
+ )
485
488
  for key in MATRX_ENV_KEYS:
486
489
  env.pop(key, None)
487
490
  env_snap = _capture_env_snapshot()
@@ -493,7 +496,7 @@ def _build_codex_env(
493
496
  or _runtime_agent_basename("codex")[0]
494
497
  )
495
498
  header_parts = [
496
- f'"Authorization" = "Bearer {access_token}"',
499
+ f'"Authorization" = "Bearer {provider_bearer}"',
497
500
  f'"X-Matrx-Key" = "{mx_key}"',
498
501
  f'"X-Matrx-Agent-Id" = "{runtime_agent_id}"',
499
502
  '"X-Matrx-Provider" = "codex"',
@@ -78,6 +78,10 @@ def main(argv: list[str] | None = None) -> int:
78
78
  return _cmd_launch(args.command, args.route, remainder)
79
79
  if args.command == "cursor":
80
80
  return _cmd_cursor(args)
81
+ if args.command == "init":
82
+ from matrx.cli.bootstrap import run_init
83
+ run_init()
84
+ return 0
81
85
 
82
86
  parser.print_help()
83
87
  return 1
@@ -104,6 +108,7 @@ def _build_parser() -> argparse.ArgumentParser:
104
108
  subparsers.add_parser("version")
105
109
  subparsers.add_parser("status")
106
110
  subparsers.add_parser("doctor")
111
+ subparsers.add_parser("init", help="Initialize Matrx for an existing project (seeds system registry)")
107
112
 
108
113
  personal = subparsers.add_parser("personal")
109
114
  personal_subparsers = personal.add_subparsers(dest="personal_command")