Skip to the content.

← Command reference · lean-pkg repo · CLI overview

lean-pkg repo export

export the gate-bound commit’s tree (or –from-tree SRCDIR) as a NEW single-commit repository at DIR, then move the package there (release NAME --fresh-repo DIR is the same).

Also spelled: lean-pkg lease release NAME --fresh-repo DIR, lean-pkg release NAME --fresh-repo DIR (all aliases).

Usage

lean-pkg repo export [--remote URL] [--keep-receipts] [--source-commit SHA]
                     [--from-tree SRCDIR] [--author IDENTITY] [--allow-author-email]
                     [--agent AGENT] [--reason REASON] [--dry-run] [common flags] NAME
                     DIR

[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  
DIR the new repository (must not exist, or be empty): internal files and the patterns file dropped, public-safety scanned; then the package is relocated there (repo move): evidence cleared, provenance note added
--remote URL git remote add origin URL, and set the record’s repo
--keep-receipts copy .lean-receipts/ from the source HEAD (they do not bind to the new commit)
--source-commit SHA export this commit instead of the gate-bound one
--from-tree SRCDIR export the working tree at SRCDIR (a hand-cleaned tree, not a commit; .gitignore honoured in a checkout) instead of the gate-bound commit
--author IDENTITY ‘NAME <EMAIL>’: author and committer of the export commit (default: user.name and user.email of the source repository’s local git config; the global identity is never used)
--allow-author-email accept an identity email that is not a GitHub noreply address (it enters public history)
--agent AGENT lease holder, if one is live
--reason REASON free-text reason stored with the event
--dry-run stage and scan, print the plan; nothing written

Details

Form What it does Key flags
repo export NAME DIR a fresh-history public export (unrelated to leases; see Publishing a package incubated beside private work): git archive of the gate-bound commit (the recorded gate receipt’s commit, or --source-commit SHA), package directory only, unpacked into a staging directory beside DIR without .lean-pkg-private-patterns, the public-safety internal paths (approvals/, notes/, drafts/, scratch/, *.priv, *.private) and .lean-receipts/ (copied from the source HEAD with --keep-receipts; they do not bind to the new commit), each dropped path listed; then the public-safety scan of the staged tree, of the commit message and of the author and committer identity the export commit will carry (--author 'NAME <EMAIL>', else user.name and user.email of the source repository’s local git config, git config --local; never the global identity; author and committer are the same; the plan prints commit identity: NAME <EMAIL> (author and committer; from SOURCE); a host-like address, user@hostname or a local TLD, is an export-commit-identity hit unless declared) (any blocking hit refuses, nothing written: “the exported tree of SHA12 has N public-safety hit(s); nothing written”; warn-only hits are listed in the plan as “0 blocking hit(s), N warning(s) (FAMILIES)” and do not refuse); then DIR becomes a new repository with one commit on main, message “fresh-history export of SHA12; receipts and gate must be re-run on this commit” plus source commit: and export date: lines, and origin set by --remote URL; then the registry entry is relocated as by update NAME --path DIR --reason "fresh-history release" (events relocated, status-changed; gate and comparator evidence cleared, verified-private becomes gate-pending, other private statuses unchanged) and a dated note (--append-note format, signed by --agent, else lean-pkg) keeps the old receipt paths and the source commit; --remote also sets repo (event updated). Refused: a public, upstreamed or archived package, DIR non-empty or inside the source repository, no gate receipt without --source-commit, another agent’s live lease, no identity for the export commit (“no identity for the export commit: pass –author ‘NAME <ID+LOGIN@users.noreply.github.com>’, or set user.name and user.email in the source repository’s local git config …; the global git identity is never used, since this commit is public history; nothing written”; half an identity is none), an identity email that is not a GitHub noreply address (ID+LOGIN@users.noreply.github.com or LOGIN@users.noreply.github.com) unless --allow-author-email (“the export commit’s author and committer email EMAIL (from SOURCE) is not a GitHub noreply address, and the commit is public history: pass –author …, or –allow-author-email to publish this address; nothing written”; the dry run refuses the same way), a malformed --author (usage error, exit 2); --allow-author-email allows an address, never a public-safety hit in the identity. Prints the next commands (public-safety, push, gate, lean-pkg receipt comparator --prepare, comparator, publish --dry-run --public-safety, promote). --dry-run stages and scans in a temporary directory and prints the plan (export path, dropped paths, the commit message, the registry change, the next commands); nothing is written. --json: source_commit, export_path, excluded[] {path, reason}, kept_receipts, commit_message, new_commit (null on a dry run), remote, public_safety, relocation, next_commands[], identity {author, committer, source, noreply}, public_allow {file, carried, lines[], unused, present}. The allow: lines of .lean-pkg-private-patterns that the export’s own scan used (they exempted something in the staged tree, the commit message or the identity; never a block or warn line, never an unused allow line) are carried into a committed .lean-pkg-public-allow in the export (merged with one the tree already has; the plan prints public allow: N allow line(s) ... carried and M unused allow line(s) dropped; unused counts them and present counts used lines the tree’s file already has), so the new repository’s own public-safety keeps exempting what the export scan exempted; an unused allow line is dropped, never printed (its pattern names what it allows, so it can leak), and when no line was used no .lean-pkg-public-allow is written (public allow: none of the N allow line(s) ... was used by the export's scan; none carried, no .lean-pkg-public-allow written); a carried allow line a private block pattern (the patterns file’s, a registry-derived name) matches refuses the export, naming its line number, nothing written DIR [--remote URL] [--keep-receipts] [--source-commit SHA] [--author 'NAME <EMAIL>'] [--allow-author-email] [--agent A] [--reason TEXT] [--dry-run]
repo export NAME DIR --from-tree SRCDIR as repo export NAME DIR, but exports the working tree at SRCDIR, not a commit: a tree cleaned by hand (files removed or edited) that is not a commit of the source repository, which stays untouched. In a git checkout the files are those git ls-files --cached --others --exclude-standard lists (SRCDIR’s .gitignore applies, uncommitted edits and untracked files are exported); otherwise every file but .git/ and .lake/. Same exclusions, same scan (the commit message names SRCDIR’s basename; a blocking hit refuses: “the working tree SRCDIR has N public-safety hit(s); nothing written”), same single commit, message “fresh-history export of working tree BASENAME; receipts and gate must be re-run on this commit” plus source commit: none (hand-cleaned tree), source package commit for provenance: SHA (the gate-bound commit, or none) and export date:. The package’s patterns file applies when its checkout has one, else SRCDIR’s. Without --author the identity is SRCDIR’s local git config when SRCDIR is a checkout that sets one, else the package checkout’s. Refused also: SRCDIR not a directory, DIR inside SRCDIR, nothing left to export, --source-commit. --json adds from_tree, provenance_commit; source_commit is null DIR --from-tree SRCDIR [--remote URL] [--keep-receipts] [--author 'NAME <EMAIL>'] [--allow-author-email] [--agent A] [--reason TEXT] [--dry-run]

Examples

Plan a fresh single-commit public repository from the gated tree; nothing is written.

lean-pkg repo export my-proof ../my-proof-public --dry-run

Name the export commit’s author and committer (a GitHub noreply address); without it the source repository’s local git config supplies them, never your global identity.

lean-pkg repo export my-proof ../my-proof-public --author 'Ada <12345+ada@users.noreply.github.com>'