Metadata-Version: 2.4
Name: hac-client-cli
Version: 0.3.2
Summary: CLI for SAP Commerce HAC (Hybris Administration Console)
Author: SapCommerceTools
License-Expression: MIT
Project-URL: Homepage, https://github.com/SapCommerceTools/hac-client-cli
Project-URL: Documentation, https://sapcommercetools.github.io/hac-client-cli/
Project-URL: Repository, https://github.com/SapCommerceTools/hac-client-cli
Project-URL: Issues, https://github.com/SapCommerceTools/hac-client-cli/issues
Project-URL: Changelog, https://github.com/SapCommerceTools/hac-client-cli/blob/main/CHANGELOG.md
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: System :: Systems Administration
Classifier: Typing :: Typed
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: hac-client-core>=0.1.0
Requires-Dist: typer>=0.9.0
Requires-Dist: rich>=13.0.0
Provides-Extra: dev
Requires-Dist: pyinstaller>=6.0; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Dynamic: license-file

# HAC Client CLI

Command-line interface for the SAP Commerce HAC (Hybris Administration Console).

## Features

- **Groovy** — execute scripts inline or from files, with optional commit mode
- **FlexibleSearch** — run queries with CSV, JSON, or table output
- **Impex** — import data with configurable validation
- **System updates** — list patches, run updates, follow logs
- **Multi-environment** — manage multiple HAC instances and endpoints
- **Secure sessions** — passwords never stored; token-based session cache

---

## Installation

| Method | Startup | Requires Python | Best for |
|--------|---------|-----------------|----------|
| **pipx** | **~100 ms** ⚡ | Yes (3.12+) | Daily use, best performance |
| **Native binary** | ~290 ms | **No** | Quick start, CI, no Python available |
| **pip** | **~100 ms** ⚡ | Yes (3.12+) | Integrating into Python projects |

### pipx — recommended for daily use

Installs in an isolated environment, manages PATH automatically, ~100 ms startup:

```bash
pipx install hac-client-cli
```

> 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.

### Native binary — zero dependencies

No Python required. Download → run. Startup is ~290 ms (the binary unpacks a bundled Python runtime on each launch).

| Platform | Download |
|----------|----------|
| Linux x86_64 | [`hac-linux-x86_64`](https://github.com/SapCommerceTools/hac-client-cli/releases/latest/download/hac-linux-x86_64) |
| macOS Apple Silicon | [`hac-macos-arm64`](https://github.com/SapCommerceTools/hac-client-cli/releases/latest/download/hac-macos-arm64) |
| macOS Intel | [`hac-macos-x86_64`](https://github.com/SapCommerceTools/hac-client-cli/releases/latest/download/hac-macos-x86_64) |
| Windows x86_64 | [`hac-windows-x86_64.exe`](https://github.com/SapCommerceTools/hac-client-cli/releases/latest/download/hac-windows-x86_64.exe) |

```bash
# Linux / macOS
curl -Lo hac https://github.com/SapCommerceTools/hac-client-cli/releases/latest/download/hac-linux-x86_64
chmod +x hac
sudo mv hac /usr/local/bin/
```

### pip

```bash
pip install hac-client-cli
```

---

## Quick Start

```bash
# 1. Add an environment
hac env add local
hac endpoint add local hac --url https://localhost:9002 --ignore-ssl --set-default

# 2. Authenticate
echo "nimda" | hac session start local --username admin

# 3. Use it
hac groovy "return 'Hello World'"
hac flexsearch "SELECT {pk}, {code} FROM {Product}" --max-count 10
hac impex -f data.impex
```

---

## Security

- Passwords are **never** stored in configuration files
- Authentication requires explicit `hac session start`
- Passwords cleared from memory after use
- Supports env vars, stdin, and interactive prompt for credentials

## Architecture

This CLI is a thin adapter over [`hac-client-core`](https://github.com/SapCommerceTools/hac-client-core):

- Maps command-line arguments to core library calls
- Handles configuration loading and output formatting
- No business logic — safe for automation and scripting

## Documentation

Full documentation: [sapcommercetools.github.io/hac-client-cli](https://sapcommercetools.github.io/hac-client-cli/)

## License

[MIT](https://github.com/SapCommerceTools/hac-client-cli/blob/main/LICENSE)
