Skip to the content.

← Command reference · lean-pkg index · CLI overview

lean-pkg index add

write <index>/<name>/entry.yaml from a clone at the pin.

Usage

lean-pkg index add [--from-registry] [--repo-dir REPO_DIR] [--url URL] [--tag TAG]
                   [--lower REL] [--comparator REL] [--license SPDX]
                   [--headline 'NAME :: FILE :: SUMMARY'] [--field-tag TAG]
                   [--formalization-yaml REL] [--consent-recorded] --by BY
                   [--allow-unpushed] [--notes NOTES] [--built-on-file FILE] [--replace]
                   [--index INDEX] [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  
--from-registry start from the registry row (repo, receipts, license, palomar, doi, reservoir)
--repo-dir REPO_DIR local clone to read from (never modified)
--url URL public https URL (a GitHub ssh URL is converted) (old spelling –repo, kept working)
--tag TAG release tag at the pin or an evidence-only descendant (or a docs-only one when lean-pkg-binding.yaml at the pin opts in)
--lower REL lower-tier receipt, .lean-receipts/…json
--comparator REL comparator receipt, .lean-receipts/…json
--license SPDX  
--headline 'NAME :: FILE :: SUMMARY'  
--field-tag TAG free field tag (repeatable)
--formalization-yaml REL  
--consent-recorded every coauthor agreed to the listing (the pointer stays private)
--by BY public handle of the person adding the entry. Required.
--allow-unpushed do not verify that the pin and evidence are on the public repository (provisional entry)
--notes NOTES  
--built-on-file FILE YAML list of credits for third-party Lean code the package builds on (name, url, authors; optional license, pin, relation, note); [] for none
--replace replace an existing entry of this name (a re-pin); its built_on is carried over unless –built-on-file is given
--index INDEX index root (default: $LEAN_PKG_INDEX, else index/ beside the registry when present, else ./index)

Details

Form What it does Key flags
index add NAME write index/<name>/entry.yaml from a clone at the pin: receipts validated with the gate and comparator validators and copied verbatim, trust computed, duplicates refused, event index-added; --replace re-pins an existing entry and carries its built_on credits over, --built-on-file sets them; a headline whose claim in claims.yaml at the pin is conditional (proposal 0003) gets the derived claim keys status: conditional and open_hypotheses, judged from the sealed log at the pin (Conditional claims) --by HANDLE --headline 'NAME :: FILE :: SUMMARY' [--from-registry] [--url URL] [--repo-dir PATH] [--lower REL] [--comparator REL] [--license SPDX] [--tag T] [--field-tag T] [--formalization-yaml REL] [--consent-recorded] [--notes] [--built-on-file FILE] [--replace] [--index PATH]

Examples

Write index/my-proof/entry.yaml from the registry row (repository, receipts, license, Palomar, DOI, Reservoir), cloning the package at the pin, validating and copying its receipts and computing the trust level; refused when consent is not recorded, the entry already exists or the pin is not on a public branch.

lean-pkg index add my-proof --from-registry --by your-handle --headline 'MyProof.main_theorem :: MyProof/Main.lean :: One sentence saying what it proves.'

The same without a registry, with the repository, license and receipt paths passed as flags and every coauthor’s consent asserted.

lean-pkg index add my-proof --url https://github.com/you/my-proof --license Apache-2.0 --lower .lean-receipts/0123456789ab-slurm-4242.json --comparator .lean-receipts/0123456789ab-comparator.json --consent-recorded --by your-handle --headline 'MyProof.main_theorem :: MyProof/Main.lean :: One sentence.'

Re-pin an existing entry at a new gated commit, replacing its receipt copies and carrying its built_on credits over unless –built-on-file is given.

lean-pkg index add my-proof --from-registry --replace --by your-handle --headline 'MyProof.main_theorem :: MyProof/Main.lean :: One sentence.'