kaos-cli 0.0.1__py3-none-any.whl → 0.1.0__py3-none-any.whl
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.
- kaos_cli/main.py +2 -8
- kaos_cli/ui.py +3 -18
- {kaos_cli-0.0.1.dist-info → kaos_cli-0.1.0.dist-info}/METADATA +3 -8
- kaos_cli-0.1.0.dist-info/RECORD +10 -0
- {kaos_cli-0.0.1.dist-info → kaos_cli-0.1.0.dist-info}/WHEEL +1 -1
- kaos_cli-0.0.1.dist-info/RECORD +0 -10
- {kaos_cli-0.0.1.dist-info → kaos_cli-0.1.0.dist-info}/entry_points.txt +0 -0
- {kaos_cli-0.0.1.dist-info → kaos_cli-0.1.0.dist-info}/top_level.txt +0 -0
kaos_cli/main.py
CHANGED
|
@@ -28,16 +28,10 @@ def ui(
|
|
|
28
28
|
help="Kubernetes API server URL. If not provided, uses kubeconfig.",
|
|
29
29
|
),
|
|
30
30
|
expose_port: int = typer.Option(
|
|
31
|
-
|
|
31
|
+
8080,
|
|
32
32
|
"--expose-port",
|
|
33
33
|
help="Port to expose the CORS proxy on.",
|
|
34
34
|
),
|
|
35
|
-
namespace: str = typer.Option(
|
|
36
|
-
"default",
|
|
37
|
-
"--namespace",
|
|
38
|
-
"-n",
|
|
39
|
-
help="Initial namespace to display in the UI.",
|
|
40
|
-
),
|
|
41
35
|
no_browser: bool = typer.Option(
|
|
42
36
|
False,
|
|
43
37
|
"--no-browser",
|
|
@@ -45,7 +39,7 @@ def ui(
|
|
|
45
39
|
),
|
|
46
40
|
) -> None:
|
|
47
41
|
"""Start a CORS-enabled proxy and open the KAOS UI."""
|
|
48
|
-
ui_command(k8s_url=k8s_url, expose_port=expose_port,
|
|
42
|
+
ui_command(k8s_url=k8s_url, expose_port=expose_port, no_browser=no_browser)
|
|
49
43
|
|
|
50
44
|
|
|
51
45
|
@app.command(name="install")
|
kaos_cli/ui.py
CHANGED
|
@@ -5,7 +5,6 @@ import sys
|
|
|
5
5
|
import threading
|
|
6
6
|
import time
|
|
7
7
|
import webbrowser
|
|
8
|
-
from urllib.parse import urlencode
|
|
9
8
|
|
|
10
9
|
import typer
|
|
11
10
|
import uvicorn
|
|
@@ -14,28 +13,14 @@ import uvicorn
|
|
|
14
13
|
KAOS_UI_URL = "https://axsaucedo.github.io/kaos-ui/"
|
|
15
14
|
|
|
16
15
|
|
|
17
|
-
def ui_command(k8s_url: str | None, expose_port: int,
|
|
16
|
+
def ui_command(k8s_url: str | None, expose_port: int, no_browser: bool) -> None:
|
|
18
17
|
"""Start a CORS-enabled proxy to the Kubernetes API server."""
|
|
19
18
|
from kaos_cli.proxy import create_proxy_app
|
|
20
19
|
|
|
21
20
|
app = create_proxy_app(k8s_url=k8s_url)
|
|
22
21
|
|
|
23
22
|
typer.echo(f"Starting KAOS UI proxy on http://localhost:{expose_port}")
|
|
24
|
-
|
|
25
|
-
# Build UI URL with query parameters
|
|
26
|
-
query_params = {}
|
|
27
|
-
# Only add kubernetesUrl if not using default port
|
|
28
|
-
if expose_port != 8010:
|
|
29
|
-
query_params["kubernetesUrl"] = f"http://localhost:{expose_port}"
|
|
30
|
-
# Only add namespace if not using default
|
|
31
|
-
if namespace and namespace != "default":
|
|
32
|
-
query_params["namespace"] = namespace
|
|
33
|
-
|
|
34
|
-
ui_url = KAOS_UI_URL
|
|
35
|
-
if query_params:
|
|
36
|
-
ui_url = f"{KAOS_UI_URL}?{urlencode(query_params)}"
|
|
37
|
-
|
|
38
|
-
typer.echo(f"KAOS UI: {ui_url}")
|
|
23
|
+
typer.echo(f"KAOS UI: {KAOS_UI_URL}")
|
|
39
24
|
typer.echo("Press Ctrl+C to stop")
|
|
40
25
|
|
|
41
26
|
def handle_signal(signum: int, frame: object) -> None:
|
|
@@ -49,7 +34,7 @@ def ui_command(k8s_url: str | None, expose_port: int, namespace: str, no_browser
|
|
|
49
34
|
if not no_browser:
|
|
50
35
|
def open_browser() -> None:
|
|
51
36
|
time.sleep(1.5)
|
|
52
|
-
webbrowser.open(
|
|
37
|
+
webbrowser.open(KAOS_UI_URL)
|
|
53
38
|
|
|
54
39
|
browser_thread = threading.Thread(target=open_browser, daemon=True)
|
|
55
40
|
browser_thread.start()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kaos-cli
|
|
3
|
-
Version: 0.0
|
|
3
|
+
Version: 0.1.0
|
|
4
4
|
Summary: CLI for KAOS (K8s Agent Orchestration System)
|
|
5
5
|
Requires-Python: >=3.12
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
@@ -32,16 +32,14 @@ Start a CORS-enabled proxy to the Kubernetes API server:
|
|
|
32
32
|
kaos ui
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
This starts a local proxy on port
|
|
35
|
+
This starts a local proxy on port 8080 that:
|
|
36
36
|
- Proxies requests to the Kubernetes API using your kubeconfig credentials
|
|
37
37
|
- Adds CORS headers to enable browser-based access
|
|
38
38
|
- Exposes the `mcp-session-id` header for MCP protocol support
|
|
39
39
|
|
|
40
40
|
Options:
|
|
41
41
|
- `--k8s-url`: Override the Kubernetes API URL (default: from kubeconfig)
|
|
42
|
-
- `--expose-port`: Port to expose the proxy on (default:
|
|
43
|
-
- `--namespace`, `-n`: Initial namespace to display in the UI (default: "default")
|
|
44
|
-
- `--no-browser`: Don't automatically open the browser
|
|
42
|
+
- `--expose-port`: Port to expose the proxy on (default: 8080)
|
|
45
43
|
|
|
46
44
|
Example:
|
|
47
45
|
```bash
|
|
@@ -51,9 +49,6 @@ kaos ui
|
|
|
51
49
|
# Custom port
|
|
52
50
|
kaos ui --expose-port 9000
|
|
53
51
|
|
|
54
|
-
# Start with a specific namespace
|
|
55
|
-
kaos ui --namespace kaos-system
|
|
56
|
-
|
|
57
52
|
# Custom K8s URL
|
|
58
53
|
kaos ui --k8s-url https://my-cluster:6443
|
|
59
54
|
```
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
kaos_cli/__init__.py,sha256=1Yxq51Ckr8SnrwtSuCn9JKnQIJ0CDEh5CX2-zZh3CHQ,80
|
|
2
|
+
kaos_cli/install.py,sha256=B3n0moEM3RTV62u9p7GVUQYWgz8N2tkbkfJ6LlVMdW0,3693
|
|
3
|
+
kaos_cli/main.py,sha256=MDmXTlf4WDXMTcwGlsIBiE4STUxCZmympRz7XoLsH70,2658
|
|
4
|
+
kaos_cli/proxy.py,sha256=wLfxxPGxvv9yHX2mQ-FoLiQIXVJSvb2WwgEsfRVr1Qo,3702
|
|
5
|
+
kaos_cli/ui.py,sha256=6jcQ_4Bhr7WW-Ntg_6fthbMKtVr3TwJubnNA2StZXM0,1245
|
|
6
|
+
kaos_cli-0.1.0.dist-info/METADATA,sha256=PA8wRgbSazl7bQbf4A8VKYkUFMx8t2a57bShyUG99dY,1257
|
|
7
|
+
kaos_cli-0.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
8
|
+
kaos_cli-0.1.0.dist-info/entry_points.txt,sha256=UhLExeu2qKkwddNEEm0o5TKtVqOkcIEcrWqyyt_UVl4,43
|
|
9
|
+
kaos_cli-0.1.0.dist-info/top_level.txt,sha256=33XlAB5b22FEtftzn0QyWXr6f8TNyh-XBIoRcQp0NRA,9
|
|
10
|
+
kaos_cli-0.1.0.dist-info/RECORD,,
|
kaos_cli-0.0.1.dist-info/RECORD
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
kaos_cli/__init__.py,sha256=1Yxq51Ckr8SnrwtSuCn9JKnQIJ0CDEh5CX2-zZh3CHQ,80
|
|
2
|
-
kaos_cli/install.py,sha256=B3n0moEM3RTV62u9p7GVUQYWgz8N2tkbkfJ6LlVMdW0,3693
|
|
3
|
-
kaos_cli/main.py,sha256=UpirI5tN_jgSYSfeRTQZNKzuAqv0A45LqRMLoepAyJ4,2833
|
|
4
|
-
kaos_cli/proxy.py,sha256=wLfxxPGxvv9yHX2mQ-FoLiQIXVJSvb2WwgEsfRVr1Qo,3702
|
|
5
|
-
kaos_cli/ui.py,sha256=PRXjdV58V3XM0Cyb2OuRJKXJxPigsCDvyiB5J5XAyGU,1764
|
|
6
|
-
kaos_cli-0.0.1.dist-info/METADATA,sha256=8IAz5Fk4j93JKiBA-m5WD1AA2m0sRKYad5CQdzilNRc,1462
|
|
7
|
-
kaos_cli-0.0.1.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
|
|
8
|
-
kaos_cli-0.0.1.dist-info/entry_points.txt,sha256=UhLExeu2qKkwddNEEm0o5TKtVqOkcIEcrWqyyt_UVl4,43
|
|
9
|
-
kaos_cli-0.0.1.dist-info/top_level.txt,sha256=33XlAB5b22FEtftzn0QyWXr6f8TNyh-XBIoRcQp0NRA,9
|
|
10
|
-
kaos_cli-0.0.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|