Metadata-Version: 2.5
Name: charisma-cli
Version: 0.1.2
Summary: CLI tool that watches allure-results and streams test results + attachments to Charisma.
Author: Charisma Team
License-Expression: MIT
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.10
Requires-Dist: click<9.0,>=8.0
Requires-Dist: httpx<1.0,>=0.24
Requires-Dist: watchdog<5.0,>=3.0
Provides-Extra: dev
Requires-Dist: hypothesis; extra == 'dev'
Requires-Dist: pytest<10.0,>=7.0; extra == 'dev'
Requires-Dist: respx; extra == 'dev'
Description-Content-Type: text/markdown

# charisma-cli

CLI tool that watches an `allure-results` directory during test execution and streams results + attachments to the Charisma ingestion API in real time.

## Installation

```bash
pip install charisma-cli
```

No token, no index URL — works on any laptop and in any CI. The package is published to public PyPI; the Charisma repo itself stays private (only this client wheel is public).

For local development from a checkout of the repo:

```bash
pip install -e packages/charisma-cli
```

<details>
<summary>Alternative: install from the GitHub Packages registry (PyOCI)</summary>

Also published to GitHub Packages via [PyOCI](https://pyoci.com) (requires a GitHub token with `read:packages`) — useful for a build not yet on PyPI:

```bash
pip install charisma-cli \
  --index-url "https://__token__:$GITHUB_TOKEN@pyoci.com/ghcr.io/align-QCOE/"
```

</details>

## Publishing (maintainers)

Releases publish to public PyPI automatically from the merge-queue workflow using a **PyPI API token**.

> Trusted publishing (OIDC) is not used because this repo runs on **GitHub Enterprise Server**, whose OIDC issuer PyPI does not trust. A stored API token is required instead.

One-time setup (done once by a PyPI project owner):

1. Sign in to [PyPI](https://pypi.org) with the team-owned account (2FA enabled).
2. Go to **Account settings → API tokens → Add API token**. Scope it to the `charisma-cli` project once the project exists; for the very first publish use an account-scoped token, then re-scope it to the project afterward.
3. Copy the token (starts with `pypi-`).
4. In the GitHub Enterprise repo, add it as an Actions secret named **`PYPI_API_TOKEN`** (org-level secret recommended so both packages share it).
5. Bump `version` in `pyproject.toml` and merge — the workflow builds and publishes on the next release.

Rotate the token periodically and store it in the team secret manager.

## Usage

```bash
export CHARISMA_ENDPOINT=https://charisma.company.com
export CHARISMA_TOKEN=<your-service-token>
export CHARISMA_PROJECT_ID=my-project

charismactl watch --results allure-results -- uv run pytest -n 4 tests/
```

## Environment Variables

| Variable              | Required | Description                                        |
| --------------------- | -------- | -------------------------------------------------- |
| `CHARISMA_ENDPOINT`   | Yes      | Base URL of the Charisma API                       |
| `CHARISMA_TOKEN`      | Yes      | Service or CI bearer token                         |
| `CHARISMA_PROJECT_ID` | Yes      | Project alias for result routing                   |
| `CHARISMA_RESULTS`    | No       | Path to allure-results (default: `allure-results`) |

## Flags

| Flag             | Description                                  |
| ---------------- | -------------------------------------------- |
| `--results PATH` | Allure results directory (overrides env var) |
| `--project ID`   | Project alias (overrides env var)            |
| `--silent`       | Don't fail pipeline if upload errors occur   |
| `--skip-too-big` | Skip result files larger than 2MB            |
