Skip to the content.

← Command reference · CLI overview

lean-pkg report

read-only: a redacted bug report in the repository’s issue format; dry run unless –yes (files it with gh issue create).

Usage

lean-pkg report [--command ARGS] [--body TEXT] [--from-log FILE[:N]] [--package NAME]
                [--title TITLE] [--enhancement] [--target-repo OWNER/NAME] [--dry-run]
                [--yes] [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
--command ARGS the lean-pkg arguments to capture, quoted as one string (“status NAME”); re-run in a subprocess (with –json when the subcommand has it) unless it would write; a value starting with ‘-‘ needs –command=VALUE
--body TEXT free text for What happened, nothing re-run (before the re-run when –command is given too); redacted like everything else
--from-log FILE[:N] the last N lines (default 200) of a stage log, under Log excerpt in What happened; redacted like everything else; a missing file is a usage error
--package NAME add the package’s registry record (status, lease, receipt commits); its .lean-pkg-private-patterns joins the redaction
--title TITLE issue title (default: report: <the command>, else report: lean-pkg <version>)
--enhancement label enhancement instead of bug
--target-repo OWNER/NAME repository to file on (default lean-pkg/lean-pkg) (old spelling –repo, kept working)
--dry-run print title, labels and body; file nothing (default)
--yes file it with gh issue create and print the URL (needs gh auth login)

Details

Form What it does Key flags
report read-only: assemble a bug report in the shape of .github/ISSUE_TEMPLATE/bug_report.md (same section headings, same order) and, with --yes, file it on lean-pkg/lean-pkg with gh issue create --label bug (--label enhancement with --enhancement; --repo OWNER/NAME for a fork) and print the issue URL. Filled automatically: Version (the --version line, Python version, platform; the ok/warn lines of doctor --json; the comparator host-check --json verdict); Command and What happened with --command "ARGS" (the lean-pkg arguments as one string; a value starting with - needs --command=ARGS): the command re-run in a subprocess, with --json appended when it is not there and the subcommand has the flag, its exit code, stdout and stderr (a long stream keeps its first 150 and last 50 lines); a command that would write (the registry or event log, wiki --out, formalization --write/--out, comparator config, index render/migrate, claims migrate) is not re-run and the body says so; --body TEXT (free text, nothing re-run) and --from-log FILE[:N] (the last N lines, default 200, of a stage log, under a Log excerpt line with the redacted path) go first in What happened, before the re-run when --command is given too; at least one of --command, --body, --from-log is required; Minimal registry or receipt with --package NAME: the record’s status, visibility, lean_toolchain, lease fields with expires_at, and the gate and comparator receipt paths with the commits they bind; Checklist ticked from what is known (--json used, validate passes). Redaction is mandatory and applies to every captured text, the title, body text and log excerpt included, in this order: the registry file to <registry>, its directory to <registry-dir>, every record’s checkout (stored, $HOME-joined and resolved) to <checkout>, the user-level default registry, when another one, to <user-default-registry>/<user-default-registry-dir>; the home directory to ~; then the public-safety scanner (its built-in families, the --package checkout’s and the registry directory’s .lean-pkg-private-patterns, the names derived from every record’s local_path, agent, workspace and lease; email addresses always), each match […]. The finished title and body are scanned again: a blocking hit left refuses, exit 1, the hit families listed (--json families[]), nothing filed. Default is a dry run: print the title, labels, repository, redaction count and body, exit 0. --yes refuses, exit 1 with the gh auth login hint, when gh is not on PATH or gh auth status fails. --json: ok, filed, url (null unless filed), title, labels[], body, redactions (replacements made), and log_excerpt {path (redacted), lines (included)} with --from-log. Usage errors (none of --command/--body/--from-log, an empty or unsplittable --command, an empty --body, a missing --from-log file or an N that is not a positive integer, --repo not OWNER/NAME, an empty --title, --dry-run with --yes) exit 2 [--command ARGS] [--body TEXT] [--from-log FILE[:N]] [--package NAME] [--title T] [--enhancement] [--repo OWNER/NAME] [--dry-run\|--yes]

Exit codes

0 success (dry runs and no-ops included), 1 refused or failed, 2 usage error; see Exit codes.

Exit 1 is also a negative answer here: