← Command reference · lean-pkg claims · CLI overview
lean-pkg claims check
re-validate cached claims; exit 0/1 (–file: a working-copy file).
Usage
lean-pkg claims check [--file PATH] [common flags] [NAME]
[common flags]: --json, --commit, --push, --no-commit, also accepted before the command name; see the CLI overview.
Arguments and flags
| Argument or flag | Description |
|---|---|
NAME |
|
--file PATH |
schema-check this claims file (e.g. claims.yaml before you commit it) instead of the registry cache; schema only (no checkout, so declarations are not looked up: claims sync and gate do that); reads no registry; NAME, if given, must be its package |
Details
| Form | What it does | Key flags |
|---|---|---|
claims check [NAME] |
re-validate cached claims (schema, unique ids, acyclic supersession, declarations at the synced commit); exit 0 or 1. --file PATH instead schema-checks a working-copy claims file (schema only: there is no checkout, so declarations are not looked up; validate claims.yaml before the commit you will gate): no registry is read, NAME is optional and, if given, must be the file’s package; PASS/FAIL first, exit 0 or 1, --json {ok, path, claims, errors[]}. With NAME, coverage none (no cached claims, no claims.yaml at HEAD) or unsynced (claims.yaml committed, nothing cached) is a failure (exit 1): no coverage is not ok. --json adds coverage, cached_claims, claims_yaml (present, absent, unknown), legacy_claims[] and hint per package. Without NAME, packages with no claims are skipped as before. A NAME that is an existing .yaml, .yml or .json file is a usage error naming --file (exit 2) |
[--file PATH] |
Exit codes
Exit 1 is also a negative answer here:
claims check [NAME]: invalid claims, or none synced
JSON output
Top-level keys of --json, as recorded in the golden contract (tests/golden/json-keys.json):
claims-check(exit 1):ok,packages,warnings
Examples
Schema-check a working-copy claims.yaml without the registry.
lean-pkg claims check --file claims.yaml