# scienith-openapi-contract-tooling

Scienith reusable OpenAPI contract tooling. This package is intended to replace per-system OpenAPI generation scripts after golden-output compatibility is proven.

## Install

From a private PyPI source:

```bash
pipx install scienith-openapi-contract-tooling
scienith-contract --help
```

`pip install scienith-openapi-contract-tooling` remains supported for Python environments that import or wrap the tooling. `pipx install` is the preferred CLI installation path because it isolates the command runtime from project virtual environments.

## Local Development

Use this project directory's own virtual environment. Do not install development dependencies into a business-system venv.

```bash
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip build
python -m pip install -e .
python -m compileall src
python -m unittest discover -s tests
python -m build
python -m pip install --force-reinstall dist/*.whl
scienith-contract --help
```

## CLI Surface

```bash
scienith-contract --help
scienith-contract build --help
scienith-contract build all --help
scienith-contract openapi --help
scienith-contract openapi views --help
scienith-contract openapi uml --help
scienith-contract openapi redoc --help
scienith-contract generate --help
scienith-contract generate python-models --help
scienith-contract generate ts-types --help
scienith-contract generate zod-ts --help
scienith-contract generate msw-handlers --help
```

The package provides both single-artifact OpenAPI generation commands and profile-driven full-system generation via `contract-tooling.yaml`. See `docs/contract-tooling-yaml.md`.

## Private Registry Configuration

CI/CD must read private source configuration from GitHub organization-level Secrets/Variables only:

- `SCIENITH_PRIVATE_NETRC`: required secret, written to `~/.netrc`.
- `SCIENITH_PRIVATE_NPMRC`: required secret when npm/private JS packages are needed, written to `~/.npmrc`.
- `SCIENITH_PRIVATE_PYPI_SIMPLE_URL`: required variable or secret, used as pip `index-url`.
- `SCIENITH_PRIVATE_PYPI_PUBLISH_URL`: optional variable or secret. If missing, CI may derive it from `SCIENITH_PRIVATE_PYPI_SIMPLE_URL` only when the simple URL ends in `/simple/` or `/simple`.

No private IP, domain, or fallback registry URL is hardcoded in this repository.
