# Python CI integration

> Run quell ci in GitHub Actions, GitLab CI or CircleCI to fail Python builds below a requirement-coverage threshold. Threshold units, exit codes and tips.

Canonical page: https://quelltest.com/docs/guides/ci-integration

Add `quell ci` to a Python CI pipeline to fail the build when too few of the requirements read from docstrings and type annotations have a test. It is a single command with one threshold and two exit codes, so it works in any CI system. For GitHub pull-request comments and inline annotations, use the workflow in the [GitHub Actions guide](https://quelltest.com/docs/guides/github-actions.md). For JavaScript and TypeScript, see the [npm CI guide](https://quelltest.com/docs/npm/ci.md).

## What is the basic command?

```bash
quell ci src/ --threshold 0.75
```

The threshold is a fraction from 0.0 to 1.0 (0.75 means 75%), and the default 0.0 never fails. The command prints the score and either `PASS` (exit 0) or `FAIL: ... threshold` (exit 1). It does not read a threshold from `pyproject.toml`. See [quell ci](https://quelltest.com/docs/cli/ci.md).

## How do I run it in GitHub Actions?

```yaml
name: Quell
on: [push, pull_request]
jobs:
  quell:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.11"
      - run: pip install quelltest
      - run: quell ci src/ --threshold 0.75
```

## How do I run it in GitLab CI or CircleCI?

```yaml
# .gitlab-ci.yml
quell:
  image: python:3.11
  script:
    - pip install quelltest
    - quell ci src/ --threshold 0.75
```

```yaml
# .circleci/config.yml
jobs:
  quell:
    docker:
      - image: cimg/python:3.11
    steps:
      - checkout
      - run: pip install quelltest
      - run: quell ci src/ --threshold 0.75
```

## What threshold should I choose?

Start where your project is today and ratchet up. Check the current score locally first:

```bash
quell ci src/ --threshold 0.0
```

then set the threshold slightly below it and raise it as you add tests. The goal is to never go backwards.

## Which other commands help in CI?

- `quell find src/ --format github` prints GitHub Actions annotations for untested guard clauses and exits 0.
- `quell score src/ --json` prints the Production Readiness Score as JSON for dashboards.
- `quell install --pr` writes a ready-made workflow; see [quell install](https://quelltest.com/docs/cli/install.md).
- `quell find --fix` asks for confirmation per test, so run it locally rather than in CI.

Optional LLM keys are never needed for `quell ci`; the rule-based path makes no network calls.
