onex-cli 1.9.7__tar.gz → 1.9.8__tar.gz

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.
Files changed (98) hide show
  1. {onex_cli-1.9.7/onex_cli.egg-info → onex_cli-1.9.8}/PKG-INFO +1 -1
  2. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/__init__.py +1 -1
  3. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/__main__.py +3 -1
  4. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/commands/mcp.py +2 -1
  5. onex_cli-1.9.8/onex/commands/reload.py +116 -0
  6. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/mcp/server.py +79 -0
  7. {onex_cli-1.9.7 → onex_cli-1.9.8/onex_cli.egg-info}/PKG-INFO +1 -1
  8. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex_cli.egg-info/SOURCES.txt +1 -0
  9. {onex_cli-1.9.7 → onex_cli-1.9.8}/CHANGELOG.md +0 -0
  10. {onex_cli-1.9.7 → onex_cli-1.9.8}/LICENSE +0 -0
  11. {onex_cli-1.9.7 → onex_cli-1.9.8}/MANIFEST.in +0 -0
  12. {onex_cli-1.9.7 → onex_cli-1.9.8}/README.md +0 -0
  13. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/commands/__init__.py +0 -0
  14. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/commands/create.py +0 -0
  15. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/commands/create_e2e.py +0 -0
  16. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/commands/debug.py +0 -0
  17. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/commands/deploy.py +0 -0
  18. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/commands/dev.py +0 -0
  19. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/commands/env.py +0 -0
  20. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/commands/es.py +0 -0
  21. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/commands/init.py +0 -0
  22. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/commands/invoke.py +0 -0
  23. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/commands/login.py +0 -0
  24. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/commands/logout.py +0 -0
  25. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/commands/logs.py +0 -0
  26. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/commands/platform.py +0 -0
  27. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/commands/provision.py +0 -0
  28. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/commands/replay.py +0 -0
  29. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/commands/status.py +0 -0
  30. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/commands/switch.py +0 -0
  31. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/commands/test.py +0 -0
  32. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/commands/trace.py +0 -0
  33. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/commands/undeploy.py +0 -0
  34. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/commands/validate.py +0 -0
  35. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/commands/vpn.py +0 -0
  36. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/config.py +0 -0
  37. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/mcp/__init__.py +0 -0
  38. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/mcp/tools/__init__.py +0 -0
  39. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/runtime/__init__.py +0 -0
  40. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/runtime/local_runtime.py +0 -0
  41. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/schema/__init__.py +0 -0
  42. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/schema/service_descriptor.py +0 -0
  43. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/schema/validator.py +0 -0
  44. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/templates/crud-service/README.md.j2 +0 -0
  45. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/templates/crud-service/__init__.py.j2 +0 -0
  46. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/templates/crud-service/service.yml.j2 +0 -0
  47. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/templates/crud-service/src/__init__.py.j2 +0 -0
  48. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/templates/crud-service/src/apis/__init__.py.j2 +0 -0
  49. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/templates/crud-service/src/models/__init__.py.j2 +0 -0
  50. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/templates/crud-service/src/models/schemas.py.j2 +0 -0
  51. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/templates/crud-service/src/repositories/__init__.py.j2 +0 -0
  52. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/templates/crud-service/src/services/__init__.py.j2 +0 -0
  53. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/templates/e2e/data_service.yml.j2 +0 -0
  54. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/templates/e2e/test_service_e2e.py.j2 +0 -0
  55. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/templates/event-driven/README.md.j2 +0 -0
  56. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/templates/event-driven/__init__.py.j2 +0 -0
  57. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/templates/event-driven/service.yml.j2 +0 -0
  58. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/templates/event-driven/src/__init__.py.j2 +0 -0
  59. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/templates/event-driven/src/triggers/__init__.py.j2 +0 -0
  60. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/templates/event-driven/src/triggers/events.py.j2 +0 -0
  61. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/templates/event-driven/src/triggers/schedules.py.j2 +0 -0
  62. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/templates/go-minimal/README.md.j2 +0 -0
  63. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/templates/go-minimal/go.mod.j2 +0 -0
  64. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/templates/go-minimal/main.go.j2 +0 -0
  65. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/templates/go-minimal/service.yml.j2 +0 -0
  66. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/templates/go-rest-api/README.md.j2 +0 -0
  67. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/templates/go-rest-api/go.mod.j2 +0 -0
  68. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/templates/go-rest-api/handlers/items.go.j2 +0 -0
  69. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/templates/go-rest-api/main.go.j2 +0 -0
  70. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/templates/go-rest-api/service.yml.j2 +0 -0
  71. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/templates/minimal/README.md.j2 +0 -0
  72. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/templates/minimal/__init__.py.j2 +0 -0
  73. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/templates/minimal/service.yml.j2 +0 -0
  74. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/templates/minimal/src/__init__.py.j2 +0 -0
  75. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/templates/minimal/src/apis/__init__.py.j2 +0 -0
  76. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/templates/minimal/src/apis/hello.py.j2 +0 -0
  77. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/templates/rest-api/README.md.j2 +0 -0
  78. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/templates/rest-api/__init__.py.j2 +0 -0
  79. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/templates/rest-api/service.yml.j2 +0 -0
  80. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/templates/rest-api/src/__init__.py.j2 +0 -0
  81. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/templates/rest-api/src/apis/__init__.py.j2 +0 -0
  82. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/templates/rest-api/src/apis/handlers.py.j2 +0 -0
  83. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/utils/__init__.py +0 -0
  84. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/utils/auth.py +0 -0
  85. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/utils/crypto.py +0 -0
  86. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/utils/email.py +0 -0
  87. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/utils/helpers.py +0 -0
  88. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/vpn/__init__.py +0 -0
  89. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/vpn/platform_detector.py +0 -0
  90. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/vpn/setup_vpn.py +0 -0
  91. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex/vpn/wireguard_manager.py +0 -0
  92. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex_cli.egg-info/dependency_links.txt +0 -0
  93. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex_cli.egg-info/entry_points.txt +0 -0
  94. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex_cli.egg-info/requires.txt +0 -0
  95. {onex_cli-1.9.7 → onex_cli-1.9.8}/onex_cli.egg-info/top_level.txt +0 -0
  96. {onex_cli-1.9.7 → onex_cli-1.9.8}/setup.cfg +0 -0
  97. {onex_cli-1.9.7 → onex_cli-1.9.8}/setup.py +0 -0
  98. {onex_cli-1.9.7 → onex_cli-1.9.8}/tests/test_mcp_logs_e2e.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: onex-cli
3
- Version: 1.9.7
3
+ Version: 1.9.8
4
4
  Summary: Official CLI for deploying and managing services on OneXEOS Platform (Windows, macOS, Linux)
5
5
  Home-page: https://github.com/onexeos/onex-cli
6
6
  Author: OneXEOS Platform Team
@@ -1,2 +1,2 @@
1
1
  # OneXEOS Services CLI
2
- __version__ = "1.9.7"
2
+ __version__ = "1.9.8"
@@ -13,6 +13,7 @@ Commands:
13
13
  debug - Run service(s) locally with platform connection checks
14
14
  logs - View service logs
15
15
  status - Check service status
16
+ reload - Force reload a service in shared runtime
16
17
  provision - Manually provision resources
17
18
  invoke - Invoke handlers directly
18
19
  trace - Track requests through platform
@@ -28,7 +29,7 @@ Environments:
28
29
  """
29
30
 
30
31
  import click
31
- from onex.commands import deploy, undeploy, dev, debug, init, logs, status, provision, invoke, trace, validate, login, logout, env, platform, vpn, switch, mcp, create, replay, es, test, create_e2e
32
+ from onex.commands import deploy, undeploy, dev, debug, init, logs, status, provision, invoke, trace, validate, login, logout, env, platform, vpn, switch, mcp, create, replay, es, test, create_e2e, reload
32
33
 
33
34
 
34
35
  # Commands that don't require authentication
@@ -82,6 +83,7 @@ cli.add_command(dev.dev)
82
83
  cli.add_command(debug.debug)
83
84
  cli.add_command(logs.logs)
84
85
  cli.add_command(status.status)
86
+ cli.add_command(reload.reload)
85
87
  cli.add_command(provision.provision)
86
88
  cli.add_command(invoke.invoke)
87
89
  cli.add_command(trace.trace)
@@ -444,11 +444,12 @@ def status():
444
444
  print_info(" Run 'onex mcp setup' to configure")
445
445
 
446
446
  click.echo()
447
- print_info("Available tools (11):")
447
+ print_info("Available tools (12):")
448
448
  print_info(" • onex_platform_check - Platform health")
449
449
  print_info(" • onex_trace - Request tracing")
450
450
  print_info(" • onex_logs - Service logs")
451
451
  print_info(" • onex_status - Deployment status")
452
+ print_info(" • onex_reload - Force reload service")
452
453
  print_info(" • onex_invoke - Invoke handlers")
453
454
  print_info(" • onex_es_reindex - ES reindex from MongoDB")
454
455
  print_info(" • onex_validate - Validate config")
@@ -0,0 +1,116 @@
1
+ """
2
+ Reload command - Force reload a service in the shared runtime
3
+
4
+ Useful when:
5
+ - Code changes aren't reflected after deployment
6
+ - Python bytecode cache is stale
7
+ - Hot-reload didn't trigger automatically
8
+ """
9
+
10
+ import click
11
+ import requests
12
+ from onex.config import get_config, get_access_token
13
+ from onex.utils import print_success, print_error, print_info, print_warning
14
+ from onex.utils.auth import auto_refresh_token
15
+
16
+
17
+ @click.command()
18
+ @click.argument('service_name')
19
+ @click.option('--env', default=None, help='Environment (local/dev/staging/prod, defaults to active)')
20
+ @click.option('--platform-url', help='Override platform URL')
21
+ def reload(service_name, env, platform_url):
22
+ """Force reload a service in the shared runtime.
23
+
24
+ Purges cached Python modules, reinstalls dependencies, and reloads
25
+ the service. Use this when code changes aren't reflected after deployment.
26
+
27
+ Example:
28
+ onex reload pricing
29
+ onex reload pricing --env dev
30
+ """
31
+ from onex.config import get_active_environment
32
+
33
+ if env is None:
34
+ env = get_active_environment()
35
+
36
+ config = get_config()
37
+ platform_base_url = platform_url or config.get_platform_url(env)
38
+
39
+ access_token = get_access_token(env)
40
+ headers = {}
41
+ if access_token:
42
+ headers['Authorization'] = f'Bearer {access_token}'
43
+
44
+ reload_url = f"{platform_base_url}/_internal/reload/{service_name}"
45
+
46
+ click.echo(f"🔄 Reloading {service_name} in shared runtime...")
47
+ click.echo()
48
+
49
+ try:
50
+ response = requests.post(reload_url, headers=headers, timeout=120)
51
+
52
+ if response.status_code == 200:
53
+ data = response.json()
54
+ success = data.get('success', False)
55
+ deps_installed = data.get('deps_installed', False)
56
+
57
+ if success:
58
+ print_success(f"Service '{service_name}' reloaded successfully")
59
+ click.echo()
60
+ click.echo(f" Dependencies: {'✅ installed' if deps_installed else '⚠️ skipped'}")
61
+ deps_details = data.get('deps_details', '')
62
+ if deps_details:
63
+ # Show first line of deps output
64
+ first_line = deps_details.strip().split('\n')[0][:100]
65
+ click.echo(f" Details: {first_line}")
66
+ else:
67
+ print_error(f"Service '{service_name}' failed to reload")
68
+ click.echo()
69
+ deps_details = data.get('deps_details', '')
70
+ if deps_details:
71
+ click.echo(f" Details: {deps_details[:300]}")
72
+ print_info("Check shared-runtime logs: onex logs shared-runtime")
73
+
74
+ elif response.status_code == 401 and env != "local":
75
+ print_warning("Token expired, refreshing...")
76
+ if auto_refresh_token(env, silent=False):
77
+ access_token = get_access_token(env)
78
+ headers['Authorization'] = f'Bearer {access_token}'
79
+ response = requests.post(reload_url, headers=headers, timeout=120)
80
+ if response.status_code == 200:
81
+ data = response.json()
82
+ if data.get('success'):
83
+ print_success(f"Service '{service_name}' reloaded successfully")
84
+ else:
85
+ print_error(f"Service '{service_name}' failed to reload")
86
+ return
87
+ print_error("Authentication failed - could not refresh token")
88
+ print_info(f"Please login again: onex login --env {env}")
89
+
90
+ elif response.status_code == 404:
91
+ print_error(f"Service '{service_name}' not found")
92
+ print_info("Check deployed services with: onex status")
93
+
94
+ elif response.status_code == 500:
95
+ detail = ''
96
+ try:
97
+ detail = response.json().get('detail', response.text[:300])
98
+ except Exception:
99
+ detail = response.text[:300]
100
+ print_error(f"Reload failed: {detail}")
101
+ print_info("Fix the issue and redeploy, or check logs: onex logs shared-runtime")
102
+
103
+ else:
104
+ print_error(f"Unexpected response: HTTP {response.status_code}")
105
+ print_info(response.text[:200])
106
+
107
+ except requests.exceptions.ConnectionError:
108
+ print_error(f"Cannot connect to platform at {platform_base_url}")
109
+ print_info("Make sure platform is running")
110
+
111
+ except requests.exceptions.Timeout:
112
+ print_error("Reload request timed out (120s)")
113
+ print_info("The service may still be reloading. Check: onex status " + service_name)
114
+
115
+ except Exception as e:
116
+ print_error(f"Error reloading service: {e}")
@@ -717,6 +717,85 @@ async def onex_status(
717
717
  return f"Error checking status: {e}"
718
718
 
719
719
 
720
+ @mcp.tool()
721
+ async def onex_reload(
722
+ service_name: str,
723
+ env: str = None
724
+ ) -> str:
725
+ """Force reload a service in the shared runtime.
726
+
727
+ Purges cached Python modules, reinstalls dependencies, and reloads the service.
728
+ Use this when code changes aren't reflected after deployment, or when Python
729
+ bytecode cache is stale.
730
+
731
+ Args:
732
+ service_name: Name of the service to reload (e.g. "pricing", "product")
733
+ env: Environment (local/dev/staging/prod). Default: active environment
734
+
735
+ Returns:
736
+ Reload result with dependency and service load status
737
+
738
+ Examples:
739
+ User: "Pricing service code isn't updating after deploy"
740
+ → onex_reload(service_name="pricing")
741
+
742
+ User: "Force reload product service on dev"
743
+ → onex_reload(service_name="product", env="dev")
744
+ """
745
+ if env is None:
746
+ env = get_active_environment()
747
+
748
+ platform_url = _get_platform_url(env)
749
+ headers = _auth_headers(env)
750
+
751
+ try:
752
+ async with httpx.AsyncClient(timeout=120) as client:
753
+ resp = await client.post(
754
+ f"{platform_url}/_internal/reload/{service_name}",
755
+ headers=headers
756
+ )
757
+
758
+ if resp.status_code == 200:
759
+ data = resp.json()
760
+ success = data.get('success', False)
761
+ deps_installed = data.get('deps_installed', False)
762
+ deps_details = data.get('deps_details', '')
763
+
764
+ lines = []
765
+ if success:
766
+ lines.append(f"Service '{service_name}' reloaded successfully")
767
+ lines.append(f"Dependencies: {'installed' if deps_installed else 'skipped'}")
768
+ else:
769
+ lines.append(f"Service '{service_name}' FAILED to reload")
770
+ lines.append(f"Dependencies: {'installed' if deps_installed else 'failed'}")
771
+ if deps_details:
772
+ lines.append(f"Details: {deps_details[:300]}")
773
+ lines.append("Check logs: onex logs shared-runtime")
774
+
775
+ return "\n".join(lines)
776
+
777
+ elif resp.status_code == 401:
778
+ return f"Authentication required. Run: onex login --env {env}"
779
+ elif resp.status_code == 404:
780
+ return f"Service '{service_name}' not found. Check deployed services with: onex status"
781
+ elif resp.status_code == 500:
782
+ detail = ''
783
+ try:
784
+ detail = resp.json().get('detail', resp.text[:300])
785
+ except Exception:
786
+ detail = resp.text[:300]
787
+ return f"Reload failed: {detail}\nFix the issue and redeploy."
788
+ else:
789
+ return f"Unexpected response: HTTP {resp.status_code} - {resp.text[:200]}"
790
+
791
+ except httpx.ConnectError:
792
+ return f"Cannot connect to platform at {platform_url}. Make sure platform is running."
793
+ except httpx.TimeoutException:
794
+ return f"Reload timed out (120s). Service may still be reloading. Check: onex status {service_name}"
795
+ except Exception as e:
796
+ return f"Error reloading service: {e}"
797
+
798
+
720
799
  # =============================================================================
721
800
  # INVOCATION TOOLS
722
801
  # =============================================================================
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: onex-cli
3
- Version: 1.9.7
3
+ Version: 1.9.8
4
4
  Summary: Official CLI for deploying and managing services on OneXEOS Platform (Windows, macOS, Linux)
5
5
  Home-page: https://github.com/onexeos/onex-cli
6
6
  Author: OneXEOS Platform Team
@@ -22,6 +22,7 @@ onex/commands/logs.py
22
22
  onex/commands/mcp.py
23
23
  onex/commands/platform.py
24
24
  onex/commands/provision.py
25
+ onex/commands/reload.py
25
26
  onex/commands/replay.py
26
27
  onex/commands/status.py
27
28
  onex/commands/switch.py
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes