hac-client-cli 0.3.0__tar.gz → 0.3.2__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.
- {hac_client_cli-0.3.0/src/hac_client_cli.egg-info → hac_client_cli-0.3.2}/PKG-INFO +21 -12
- {hac_client_cli-0.3.0 → hac_client_cli-0.3.2}/README.md +20 -11
- {hac_client_cli-0.3.0 → hac_client_cli-0.3.2}/pyproject.toml +1 -1
- {hac_client_cli-0.3.0 → hac_client_cli-0.3.2}/src/hac_client_cli/app.py +9 -6
- {hac_client_cli-0.3.0 → hac_client_cli-0.3.2}/src/hac_client_cli/commands_env.py +0 -1
- {hac_client_cli-0.3.0 → hac_client_cli-0.3.2}/src/hac_client_cli/commands_session.py +24 -22
- {hac_client_cli-0.3.0 → hac_client_cli-0.3.2}/src/hac_client_cli/config_loader.py +0 -1
- {hac_client_cli-0.3.0 → hac_client_cli-0.3.2}/src/hac_client_cli/environment_manager.py +21 -0
- {hac_client_cli-0.3.0 → hac_client_cli-0.3.2/src/hac_client_cli.egg-info}/PKG-INFO +21 -12
- {hac_client_cli-0.3.0 → hac_client_cli-0.3.2}/LICENSE +0 -0
- {hac_client_cli-0.3.0 → hac_client_cli-0.3.2}/setup.cfg +0 -0
- {hac_client_cli-0.3.0 → hac_client_cli-0.3.2}/src/hac_client_cli/__init__.py +0 -0
- {hac_client_cli-0.3.0 → hac_client_cli-0.3.2}/src/hac_client_cli/commands_endpoint.py +0 -0
- {hac_client_cli-0.3.0 → hac_client_cli-0.3.2}/src/hac_client_cli/commands_update.py +0 -0
- {hac_client_cli-0.3.0 → hac_client_cli-0.3.2}/src/hac_client_cli.egg-info/SOURCES.txt +0 -0
- {hac_client_cli-0.3.0 → hac_client_cli-0.3.2}/src/hac_client_cli.egg-info/dependency_links.txt +0 -0
- {hac_client_cli-0.3.0 → hac_client_cli-0.3.2}/src/hac_client_cli.egg-info/entry_points.txt +0 -0
- {hac_client_cli-0.3.0 → hac_client_cli-0.3.2}/src/hac_client_cli.egg-info/requires.txt +0 -0
- {hac_client_cli-0.3.0 → hac_client_cli-0.3.2}/src/hac_client_cli.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hac-client-cli
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.2
|
|
4
4
|
Summary: CLI for SAP Commerce HAC (Hybris Administration Console)
|
|
5
5
|
Author: SapCommerceTools
|
|
6
6
|
License-Expression: MIT
|
|
@@ -48,9 +48,25 @@ Command-line interface for the SAP Commerce HAC (Hybris Administration Console).
|
|
|
48
48
|
|
|
49
49
|
## Installation
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
| Method | Startup | Requires Python | Best for |
|
|
52
|
+
|--------|---------|-----------------|----------|
|
|
53
|
+
| **pipx** | **~100 ms** ⚡ | Yes (3.12+) | Daily use, best performance |
|
|
54
|
+
| **Native binary** | ~290 ms | **No** | Quick start, CI, no Python available |
|
|
55
|
+
| **pip** | **~100 ms** ⚡ | Yes (3.12+) | Integrating into Python projects |
|
|
52
56
|
|
|
53
|
-
|
|
57
|
+
### pipx — recommended for daily use
|
|
58
|
+
|
|
59
|
+
Installs in an isolated environment, manages PATH automatically, ~100 ms startup:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
pipx install hac-client-cli
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
> Don't have pipx? See the [full installation guide](https://sapcommercetools.github.io/hac-client-cli/docs/installation) for step-by-step setup on Linux, macOS, and Windows.
|
|
66
|
+
|
|
67
|
+
### Native binary — zero dependencies
|
|
68
|
+
|
|
69
|
+
No Python required. Download → run. Startup is ~290 ms (the binary unpacks a bundled Python runtime on each launch).
|
|
54
70
|
|
|
55
71
|
| Platform | Download |
|
|
56
72
|
|----------|----------|
|
|
@@ -59,21 +75,14 @@ Download the latest release for your platform from [GitHub Releases](https://git
|
|
|
59
75
|
| macOS Intel | [`hac-macos-x86_64`](https://github.com/SapCommerceTools/hac-client-cli/releases/latest/download/hac-macos-x86_64) |
|
|
60
76
|
| Windows x86_64 | [`hac-windows-x86_64.exe`](https://github.com/SapCommerceTools/hac-client-cli/releases/latest/download/hac-windows-x86_64.exe) |
|
|
61
77
|
|
|
62
|
-
**Linux / macOS:**
|
|
63
|
-
|
|
64
78
|
```bash
|
|
79
|
+
# Linux / macOS
|
|
65
80
|
curl -Lo hac https://github.com/SapCommerceTools/hac-client-cli/releases/latest/download/hac-linux-x86_64
|
|
66
81
|
chmod +x hac
|
|
67
82
|
sudo mv hac /usr/local/bin/
|
|
68
83
|
```
|
|
69
84
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
```powershell
|
|
73
|
-
Invoke-WebRequest -Uri "https://github.com/SapCommerceTools/hac-client-cli/releases/latest/download/hac-windows-x86_64.exe" -OutFile "$env:LOCALAPPDATA\hac.exe"
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
### pip (requires Python 3.12+)
|
|
85
|
+
### pip
|
|
77
86
|
|
|
78
87
|
```bash
|
|
79
88
|
pip install hac-client-cli
|
|
@@ -15,9 +15,25 @@ Command-line interface for the SAP Commerce HAC (Hybris Administration Console).
|
|
|
15
15
|
|
|
16
16
|
## Installation
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
| Method | Startup | Requires Python | Best for |
|
|
19
|
+
|--------|---------|-----------------|----------|
|
|
20
|
+
| **pipx** | **~100 ms** ⚡ | Yes (3.12+) | Daily use, best performance |
|
|
21
|
+
| **Native binary** | ~290 ms | **No** | Quick start, CI, no Python available |
|
|
22
|
+
| **pip** | **~100 ms** ⚡ | Yes (3.12+) | Integrating into Python projects |
|
|
19
23
|
|
|
20
|
-
|
|
24
|
+
### pipx — recommended for daily use
|
|
25
|
+
|
|
26
|
+
Installs in an isolated environment, manages PATH automatically, ~100 ms startup:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pipx install hac-client-cli
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
> Don't have pipx? See the [full installation guide](https://sapcommercetools.github.io/hac-client-cli/docs/installation) for step-by-step setup on Linux, macOS, and Windows.
|
|
33
|
+
|
|
34
|
+
### Native binary — zero dependencies
|
|
35
|
+
|
|
36
|
+
No Python required. Download → run. Startup is ~290 ms (the binary unpacks a bundled Python runtime on each launch).
|
|
21
37
|
|
|
22
38
|
| Platform | Download |
|
|
23
39
|
|----------|----------|
|
|
@@ -26,21 +42,14 @@ Download the latest release for your platform from [GitHub Releases](https://git
|
|
|
26
42
|
| macOS Intel | [`hac-macos-x86_64`](https://github.com/SapCommerceTools/hac-client-cli/releases/latest/download/hac-macos-x86_64) |
|
|
27
43
|
| Windows x86_64 | [`hac-windows-x86_64.exe`](https://github.com/SapCommerceTools/hac-client-cli/releases/latest/download/hac-windows-x86_64.exe) |
|
|
28
44
|
|
|
29
|
-
**Linux / macOS:**
|
|
30
|
-
|
|
31
45
|
```bash
|
|
46
|
+
# Linux / macOS
|
|
32
47
|
curl -Lo hac https://github.com/SapCommerceTools/hac-client-cli/releases/latest/download/hac-linux-x86_64
|
|
33
48
|
chmod +x hac
|
|
34
49
|
sudo mv hac /usr/local/bin/
|
|
35
50
|
```
|
|
36
51
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
```powershell
|
|
40
|
-
Invoke-WebRequest -Uri "https://github.com/SapCommerceTools/hac-client-cli/releases/latest/download/hac-windows-x86_64.exe" -OutFile "$env:LOCALAPPDATA\hac.exe"
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
### pip (requires Python 3.12+)
|
|
52
|
+
### pip
|
|
44
53
|
|
|
45
54
|
```bash
|
|
46
55
|
pip install hac-client-cli
|
|
@@ -98,13 +98,12 @@ def create_client(environment: Optional[str] = None, endpoint: Optional[str] = N
|
|
|
98
98
|
)
|
|
99
99
|
|
|
100
100
|
# Also set cookies in the http_session so they're sent with requests
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
client.http_session.cookies.set('JSESSIONID', session.session_id, domain=domain, path='/')
|
|
101
|
+
# Note: don't pass domain= to cookies.set() — requests won't send cookies
|
|
102
|
+
# for bare hostnames (e.g. "commerce-server") due to domain-matching rules
|
|
103
|
+
client.http_session.cookies.set('JSESSIONID', session.session_id)
|
|
105
104
|
if session.route_cookie:
|
|
106
105
|
route_value = session.route_cookie.split('=', 1)[1] if '=' in session.route_cookie else session.route_cookie
|
|
107
|
-
client.http_session.cookies.set('ROUTE', route_value
|
|
106
|
+
client.http_session.cookies.set('ROUTE', route_value)
|
|
108
107
|
|
|
109
108
|
return client
|
|
110
109
|
|
|
@@ -235,7 +234,11 @@ def impex_command(
|
|
|
235
234
|
result = client.import_impex(impex_content, validation_mode=validation)
|
|
236
235
|
|
|
237
236
|
if not result.success:
|
|
238
|
-
|
|
237
|
+
lines = [f"ERROR: Impex import failed: {result.error}"]
|
|
238
|
+
if result.validation_errors:
|
|
239
|
+
for ve in result.validation_errors:
|
|
240
|
+
lines.append(f" {ve}")
|
|
241
|
+
print("\n".join(lines), file=sys.stderr)
|
|
239
242
|
raise typer.Exit(1)
|
|
240
243
|
|
|
241
244
|
if json_output:
|
|
@@ -306,25 +306,23 @@ def list_sessions(
|
|
|
306
306
|
@session_app.command("show")
|
|
307
307
|
def show_session(
|
|
308
308
|
environment: str = typer.Argument(..., help="Environment name"),
|
|
309
|
+
endpoint: Optional[str] = typer.Option(None, "--endpoint", "-n", help="Endpoint name (uses default if not specified)"),
|
|
309
310
|
json_output: bool = typer.Option(False, "--json", help="Output as JSON")
|
|
310
311
|
):
|
|
311
312
|
"""Show details of a specific session."""
|
|
312
313
|
try:
|
|
313
|
-
from hac_client_cli.
|
|
314
|
+
from hac_client_cli.config_loader import get_endpoint_config
|
|
314
315
|
from hac_client_core.session import SessionManager
|
|
315
316
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
if not env:
|
|
320
|
-
print(f"ERROR: Environment '{environment}' not found", file=sys.stderr)
|
|
321
|
-
raise typer.Exit(1)
|
|
322
|
-
|
|
317
|
+
env_name, endpoint_name, ep_config = get_endpoint_config(environment, endpoint)
|
|
318
|
+
session_id = f"{env_name}/{endpoint_name}"
|
|
319
|
+
|
|
323
320
|
session_manager = SessionManager()
|
|
324
|
-
|
|
321
|
+
sessions = session_manager.list_sessions()
|
|
322
|
+
session = next((s for s in sessions if s.environment == session_id), None)
|
|
325
323
|
|
|
326
324
|
if not session:
|
|
327
|
-
print(f"No active session for environment '{
|
|
325
|
+
print(f"No active session for environment '{session_id}'")
|
|
328
326
|
return
|
|
329
327
|
|
|
330
328
|
if json_output:
|
|
@@ -367,24 +365,28 @@ def show_session(
|
|
|
367
365
|
|
|
368
366
|
@session_app.command("clear")
|
|
369
367
|
def clear_session(
|
|
370
|
-
environment: str = typer.Argument(..., help="Environment name")
|
|
368
|
+
environment: str = typer.Argument(..., help="Environment name"),
|
|
369
|
+
endpoint: Optional[str] = typer.Option(None, "--endpoint", "-n", help="Endpoint name (uses default if not specified)")
|
|
371
370
|
):
|
|
372
371
|
"""Clear session for a specific environment."""
|
|
373
372
|
try:
|
|
374
|
-
from hac_client_cli.
|
|
373
|
+
from hac_client_cli.config_loader import get_endpoint_config
|
|
375
374
|
from hac_client_core.session import SessionManager
|
|
376
375
|
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
if not env:
|
|
381
|
-
print(f"ERROR: Environment '{environment}' not found", file=sys.stderr)
|
|
382
|
-
raise typer.Exit(1)
|
|
383
|
-
|
|
376
|
+
env_name, endpoint_name, ep_config = get_endpoint_config(environment, endpoint)
|
|
377
|
+
session_id = f"{env_name}/{endpoint_name}"
|
|
378
|
+
|
|
384
379
|
session_manager = SessionManager()
|
|
385
|
-
session_manager.
|
|
386
|
-
|
|
387
|
-
|
|
380
|
+
sessions = session_manager.list_sessions()
|
|
381
|
+
session = next((s for s in sessions if s.environment == session_id), None)
|
|
382
|
+
|
|
383
|
+
if not session:
|
|
384
|
+
print(f"No active session for environment '{session_id}'")
|
|
385
|
+
return
|
|
386
|
+
|
|
387
|
+
session_manager.remove_session(session.base_url, session.username, session_id)
|
|
388
|
+
|
|
389
|
+
print(f"Session cleared for environment '{session_id}'")
|
|
388
390
|
|
|
389
391
|
except Exception as e:
|
|
390
392
|
print(f"ERROR: {e}", file=sys.stderr)
|
|
@@ -324,6 +324,21 @@ class EnvironmentManager:
|
|
|
324
324
|
Raises:
|
|
325
325
|
ValueError: If environment doesn't exist or endpoint already exists
|
|
326
326
|
"""
|
|
327
|
+
# Validate arguments to catch common mistakes
|
|
328
|
+
if "://" in endpoint_name:
|
|
329
|
+
raise ValueError(
|
|
330
|
+
f"Endpoint name cannot be a URL: '{endpoint_name}'\n"
|
|
331
|
+
f"Did you mean: hac endpoint add {env_name} <name> --url \"{endpoint_name}\"?\n"
|
|
332
|
+
f"Note: endpoint name comes BEFORE --url option"
|
|
333
|
+
)
|
|
334
|
+
|
|
335
|
+
if "://" not in url:
|
|
336
|
+
raise ValueError(
|
|
337
|
+
f"URL must be a valid URL (should contain '://'): '{url}'\n"
|
|
338
|
+
f"Did you swap the endpoint name and URL?\n"
|
|
339
|
+
f"Expected: hac endpoint add {env_name} {url} --url <actual-url>"
|
|
340
|
+
)
|
|
341
|
+
|
|
327
342
|
config = self._load_config()
|
|
328
343
|
|
|
329
344
|
if env_name not in config.get("environments", {}):
|
|
@@ -369,6 +384,12 @@ class EnvironmentManager:
|
|
|
369
384
|
Raises:
|
|
370
385
|
ValueError: If environment or endpoint doesn't exist
|
|
371
386
|
"""
|
|
387
|
+
# Validate URL if provided
|
|
388
|
+
if url is not None and "://" not in url:
|
|
389
|
+
raise ValueError(
|
|
390
|
+
f"URL must be a valid URL (should contain '://'): '{url}'"
|
|
391
|
+
)
|
|
392
|
+
|
|
372
393
|
config = self._load_config()
|
|
373
394
|
|
|
374
395
|
if env_name not in config.get("environments", {}):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hac-client-cli
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.2
|
|
4
4
|
Summary: CLI for SAP Commerce HAC (Hybris Administration Console)
|
|
5
5
|
Author: SapCommerceTools
|
|
6
6
|
License-Expression: MIT
|
|
@@ -48,9 +48,25 @@ Command-line interface for the SAP Commerce HAC (Hybris Administration Console).
|
|
|
48
48
|
|
|
49
49
|
## Installation
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
| Method | Startup | Requires Python | Best for |
|
|
52
|
+
|--------|---------|-----------------|----------|
|
|
53
|
+
| **pipx** | **~100 ms** ⚡ | Yes (3.12+) | Daily use, best performance |
|
|
54
|
+
| **Native binary** | ~290 ms | **No** | Quick start, CI, no Python available |
|
|
55
|
+
| **pip** | **~100 ms** ⚡ | Yes (3.12+) | Integrating into Python projects |
|
|
52
56
|
|
|
53
|
-
|
|
57
|
+
### pipx — recommended for daily use
|
|
58
|
+
|
|
59
|
+
Installs in an isolated environment, manages PATH automatically, ~100 ms startup:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
pipx install hac-client-cli
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
> Don't have pipx? See the [full installation guide](https://sapcommercetools.github.io/hac-client-cli/docs/installation) for step-by-step setup on Linux, macOS, and Windows.
|
|
66
|
+
|
|
67
|
+
### Native binary — zero dependencies
|
|
68
|
+
|
|
69
|
+
No Python required. Download → run. Startup is ~290 ms (the binary unpacks a bundled Python runtime on each launch).
|
|
54
70
|
|
|
55
71
|
| Platform | Download |
|
|
56
72
|
|----------|----------|
|
|
@@ -59,21 +75,14 @@ Download the latest release for your platform from [GitHub Releases](https://git
|
|
|
59
75
|
| macOS Intel | [`hac-macos-x86_64`](https://github.com/SapCommerceTools/hac-client-cli/releases/latest/download/hac-macos-x86_64) |
|
|
60
76
|
| Windows x86_64 | [`hac-windows-x86_64.exe`](https://github.com/SapCommerceTools/hac-client-cli/releases/latest/download/hac-windows-x86_64.exe) |
|
|
61
77
|
|
|
62
|
-
**Linux / macOS:**
|
|
63
|
-
|
|
64
78
|
```bash
|
|
79
|
+
# Linux / macOS
|
|
65
80
|
curl -Lo hac https://github.com/SapCommerceTools/hac-client-cli/releases/latest/download/hac-linux-x86_64
|
|
66
81
|
chmod +x hac
|
|
67
82
|
sudo mv hac /usr/local/bin/
|
|
68
83
|
```
|
|
69
84
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
```powershell
|
|
73
|
-
Invoke-WebRequest -Uri "https://github.com/SapCommerceTools/hac-client-cli/releases/latest/download/hac-windows-x86_64.exe" -OutFile "$env:LOCALAPPDATA\hac.exe"
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
### pip (requires Python 3.12+)
|
|
85
|
+
### pip
|
|
77
86
|
|
|
78
87
|
```bash
|
|
79
88
|
pip install hac-client-cli
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hac_client_cli-0.3.0 → hac_client_cli-0.3.2}/src/hac_client_cli.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|