> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI Reference

> Complete reference for jev-curate subcommands, flags, output artifacts, limits, and troubleshooting.

## Subcommands

`jev-curate` exposes one primary subcommand:

```bash theme={null}
jev-curate filter [OPTIONS] <INPUT>
```

Run `jev-curate --help` or `jev-curate filter --help` to print options, and `jev-curate --version` to print the installed version.

## Flags

| Flag | Default | Description |
| :- | :- | :- |
| `<INPUT>` | Required | Path to `.parquet` or `.jsonl`, `-` for stdin, `hf://datasets/...`, or `https://...` URL. |
| `-p, --preset` | `reasoning-math` | Built-in preset (`reasoning-math`, `anti-sycophancy`, `code-correctness`) or path to a custom `.yaml` rubric. |
| `-o, --out` | `./curated/` | Destination directory for output artifacts. |
| `-c, --concurrency` | `32` | Number of concurrent worker tasks. |
| `--dry-run` | `false` | Run host-side `secret_scan` and sanity pruning only. Makes zero API calls and requires no `TYPESAFE_API_KEY`. |
| `--model` | `jev-latest` | Jev model name. Falls back to `JEV_MODEL` env var, then `jev-latest`. |
| `--format` | `jsonl` | Output format for clean rows: `jsonl` or `parquet` (`.parquet` input required for `parquet` output). |
| `--resume` | `false` | Resume an interrupted run from existing output files without truncating them. |
| `--skip-errors` | `false` | With `--resume`, also skip rows already recorded in `errors.jsonl` instead of retrying them. |
| `--endpoint` | None | Custom API endpoint URL for offline mock testing. Falls back to `TYPESAFE_ENDPOINT` env var. |
| `--stdout` | `false` | Stream clean rows to stdout for Unix pipes. Requires `--format jsonl`. |
| `--column` | None | Single column name or comma-separated list of columns to extract text from. |
| `--rps` | `20.0` | Request rate limit in requests per second. Set `0.0` to remove the cap. Negative values are rejected. |
| `--tps` | None | Optional token rate limit in tokens per second. |
| `--allow-custom-endpoint-auth` | `false` | Send the `Authorization: Bearer` header to a custom non-loopback `--endpoint`. By default, `jev-curate` sends it only to `api.typesafe.ai` and loopback hosts. |

## Output artifacts

Every `jev-curate filter` run writes five artifacts to `--out` (default `./curated/`):

| Artifact | Purpose |
| :- | :- |
| `clean.jsonl` | Rows that passed host pre-filters and Jev rubric thresholds (or `clean.part-*.parquet` / `clean.parquet` when `--format parquet` is set). |
| `rejected.jsonl` | Rows that failed sanity pruning (`pre_filter_sanity`), `secret_scan`, or Jev rubric thresholds, with rejection reasons. |
| `errors.jsonl` | Rows that hit transport or API errors after retries, kept separate so clean and rejected counts stay exact. |
| `audit.jsonl` | Per-row evaluation audit log recording `row_id`, `row_number`, `decision`, `rejection_reasons`, `scores`, `nouls`, `choices`, `probabilities`, `input_tokens`, `output_tokens`, `truncated`, and `model`. |
| `manifest.json` | Run summary containing input metadata, preset, model, counts, token usage, and estimated cost. |

### `audit.jsonl` schema

Each line in `audit.jsonl` is a JSON object with:

* `row_id`: SHA-256 hex digest of the raw input row.
* `row_number`: 1-based output sequence number.
* `decision`: `"keep"`, `"reject"`, or `"error"`.
* `rejection_reasons`: Array of strings explaining rejections or row-level errors (empty when kept).
* `scores`: Map of `Score` question name to numeric score.
* `nouls`: Map of `Noul` question name to `[0.0, 1.0]` probability.
* `choices`: Map of `Choice` question name to selected option label.
* `probabilities`: Map of `Choice` question name to per-option probability distributions (when returned by Jev).
* `input_tokens`: Input tokens billed for the row (`0` on host pre-filter drops or `--dry-run`).
* `output_tokens`: Output tokens reported for the row (`0` on host pre-filter drops or `--dry-run`).
* `truncated`: Boolean indicating whether the row text was truncated at the `32k-char` ceiling.
* `model`: Effective Jev model identifier used for the run.

## Rate limits and input ceiling

* **Rate limit:** The built-in rate limiter defaults to `20 req/sec` with automatic `429` backoff (TypeSafe's org quota default is `80 req/sec` and `100,000 tok/sec`). Change the request rate with `--rps` and add a token rate cap with `--tps`.
* **Input ceiling:** Text payloads are subject to a `32k-char` ceiling per row.

## Exit codes

| Code | Meaning |
| :- | :- |
| `0` | Success (all rows processed with zero row-level errors). |
| `1` | Fatal CLI, auth, validation, or I/O error (missing `TYPESAFE_API_KEY` without `--dry-run`/`--endpoint`, invalid preset, missing input, or incompatible `--format parquet` / `--stdout` flags). |
| `2` | Completed with one or more row-level failures recorded in `errors.jsonl`. |
| `130` | Interrupted by Ctrl+C (partial progress flushed to output files). |

## Troubleshooting

* **`TYPESAFE_API_KEY not set`:** Export `TYPESAFE_API_KEY` before running, or pass `--dry-run` for host-only filtering.
* **`--format parquet is only supported for .parquet inputs`:** Convert JSONL input to Parquet first, or omit `--format parquet` to write `clean.jsonl`.
* **`--stdout is only supported with --format jsonl`:** Remove `--format parquet` when piping clean rows to stdout.
* **Interrupted runs:** Re-run the exact command with `--resume` to continue without truncating existing `clean`, `rejected`, and `errors` files.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.