Metadata-Version: 2.5
Name: noswag-cli
Version: 0.1.4
Summary: Generate repository-native tests with NoSwag
Project-URL: Homepage, https://noswag.io
Project-URL: Repository, https://github.com/noswag/noswag
Author: NoSwag
License: MIT
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.10
Requires-Dist: keyring<27,>=25
Requires-Dist: pyyaml<7,>=6
Requires-Dist: typing-extensions<5,>=4.6
Provides-Extra: dev
Requires-Dist: mypy<3,>=1.10; extra == 'dev'
Requires-Dist: types-pyyaml<7,>=6; extra == 'dev'
Description-Content-Type: text/markdown

# NoSwag Python CLI

The `noswag` package authenticates through the NoSwag device flow, packages a
bounded snapshot of the current Git repository, requests repository-native
tests, and previews or safely writes the returned artifact.

```bash
python -m pip install noswag-cli
noswag auth login
noswag init
noswag gentest                 # repository-aware dry-run
noswag gentest --spec openapi.yaml  # contract tests from a spec
noswag gentest --write         # guarded write
```

`--spec` accepts a repository-relative JSON or YAML OpenAPI/Swagger file and
includes it even when the Git diff has no source changes. Generated contract
checks use `NOSWAG_BASE_URL` at execution time and optionally
`NOSWAG_API_TOKEN`, `NOSWAG_API_KEY`, `NOSWAG_PATH_*`, and `NOSWAG_QUERY_*`.

Tokens are stored through the operating system credential store. Set
`NOSWAG_API_URL` for staging/local use. CI can use a platform API key via
`NOSWAG_API_KEY` (or the backwards-compatible `NOSWAG_TOKEN`) without writing
a credential file. Platform keys carry their workspace, so
`NOSWAG_WORKSPACE_ID` is optional. The key can also be passed with
`--api-key`.
Interactive login stores a rotating refresh token in the OS credential store;
the short-lived access token is refreshed automatically and logout revokes the
refresh family.

Repository verification commands run only when `verify.enabled: true` is
committed in `.noswag.yml` or `--verify` is supplied, and only together with
`--write`. No detected command is executed implicitly.

Exit codes: `2` authentication, `3` quota/license, `4` generation, `5`
validation, and `6` write conflict.
