Skip to the content.

← Command reference · lean-pkg registry · CLI overview

lean-pkg registry init

bootstrap an empty registry and its event log.

Also spelled: lean-pkg init (all aliases).

Usage

lean-pkg registry init [--force] [common flags]

[common flags]: --json, --commit, --push, --no-commit, also accepted before the command name; see the CLI overview.

Arguments and flags

Argument or flag Description
--force re-create only if the existing registry is empty

Details

Form What it does Key flags
init bootstrap an empty registry file and its event log; refuses an existing registry unless --force and it holds no packages; the registry-created event records the registry file name and schema version (no host path), and "forced": true after --force [--force]

Examples

Create the registry and its event log once, at the default location (~/.lean-pkg/registry, or $LEAN_PKG_REGISTRY).

lean-pkg registry init

Sample output:

registry created: ~/.lean-pkg/registry/lean-packages.yaml (version 3); events: ~/.lean-pkg/registry/lean-package-events.jsonl

The same with the registry file named explicitly; the global –registry flag goes before the command.

lean-pkg --registry ~/.lean-pkg/registry/lean-packages.yaml init