Skip to main content

LunaPack configuration reference

This reference lists LunaPack project configuration, user settings, sidecars, preferences, resource limits, and environment variables. Use Configuration for the project-state overview and Environment and user settings for cache, profile, and process lookup behavior.

Project files​

FileOwnerPurpose
lunapack.ymlProject teamSources, requested packs, variables, remaps, links, preferences, policy, and trust declarations.
lunapack-lock.ymlLunaPackExact resolved graph, source provenance, effective targets, and content digests.
~/.lunapack/config.ymlCurrent userGlobal and canonical-project trust, preferences, and acknowledgements.
~/.lunapack/source-ignores.ymlCurrent userProject and source ignore state.
~/.lunapack/lifecycle-hook-policy.ymlCurrent userLifecycle environment warning names and hook timeout policy.
~/.lunapack/cache/git-sources/<project>/Current userGenerated Git catalog metadata for one canonical project.

LUNAPACK_USER_PROFILE replaces the user profile root for the user-owned files and project Git metadata cache. It does not move project documents or the platform-specific Git link content cache.

lunapack.yml​

The project configuration schema requires schemaVersion, sources, and packs.

PropertyTypeRequiredMeaning
schemaVersionInteger, only 1YesProject configuration schema version.
sourcesSource arrayYesLocal, Git, GitHub, and OCI sources available to the project.
packsRequested pack arrayYesRequested root packs and optional versions, destinations, and remaps.
linksLink mapNoLuna Link definitions keyed by exact link name.
remapRemapping objectNoProject-wide directory and file target remappings.
preferencesCLI preferencesNoProject-local CLI preference and resource-limit values.
policyPolicy objectNoPortable source, Git pinning, and script-mode governance.
trustTrust objectNoProject script denial and portable source/pack trust declarations.
variablesVariable mapNoProject string, Boolean, or string-array values.

Sources​

Every source has name and type.

TypePropertiesRequired
localpathname, type, path
giturl, ref, path, timeoutSecondsname, type, url
ociurl, path, usernamename, type, url

Git ref and path are optional when a configured ref or repository subdirectory is not needed. timeoutSeconds accepts 1 through 300 and defaults to 300. OCI url must use HTTPS and username is non-secret metadata.

schemaVersion: 1
sources:
- name: engineering
type: local
path: packs
- name: upstream
type: git
url: https://github.com/example/packs.git
ref: refs/heads/main
path: standards
- name: registry
type: oci
url: https://registry.example.com
path: engineering/packs
username: reader
packs: []

Requested packs​

PropertyTypeRequiredMeaning
idStringYesPack ID.
versionSemantic versionNoExact release. Omit for catalog resolution.
destinationProject-relative pathNoConsumer destination for this root.
remap.directoriesTarget mapNoDirectory remapping for this pack entry.
remap.filesTarget mapNoFile remapping for this pack entry.

Remapping​

remap:
directories:
docs: docs/architecture
files:
README.md: docs/README.md

Keys and values must be project-relative, non-empty, and non-escaping. The exact effective lock target has precedence over remapping state for later updates.

Variables​

Variable names match [A-Za-z_][A-Za-z0-9_]*. Values can be strings, Booleans, or arrays of strings.

variables:
companyName: Contoso
generateSamples: true
platforms:
- win
- linux
PropertyTypeRequiredMeaning
sourceSource nameYesLocal or Git source selected for this link.
includesUnique path/glob arrayYesFiles or directories selected by the link.
excludesUnique glob arrayNoPatterns excluded after includes.
pathRepository-relative pathNoSource-relative selector base.
targetProject-relative pathNoWorkspace-relative target directory.
refStringNoGit ref override.
stripPrefixRepository-relative pathNoPrefix removed from every target.
flattenBooleanNoPlace every selected file directly under target.

Project policy​

policy is optional and independently versioned. When present, version: 1 is required. Omitting policy preserves prior behavior.

PropertyTypeRequiredDefaultMeaning
versionIntegerYesNonePolicy contract version, currently 1.
enforcementreport or blockNoreportWhether findings warn or stop planning.
sources.allowSelector arrayNoUnsetSources permitted by normalized identity.
sources.denySelector arrayNoEmptySources rejected by normalized identity.
git.requireCommitPinBooleanNofalseRequire a full commit ref for Git sources.
scripts.allowedModesMode arrayNoUnsetPermitted prompt, run, and skip modes.
waiversWaiver arrayNoUnsetExact expiring exceptions for policy rules.

Selectors require type. url and path are optional constraints; a type-only selector matches every source of that type. Local selectors accept only path. Git and OCI selectors accept url and path. Source names are labels and do not participate in matching.

policy:
version: 1
enforcement: report
sources:
allow:
- type: git
url: https://github.com/example/packs.git
- type: oci
url: https://registry.example.com
path: engineering/packs
deny:
- type: local
git:
requireCommitPin: true
scripts:
allowedModes:
- prompt
- skip
waivers:
- rule: git-commit-pin-required
subject: git:github.com/example/packs#/
reason: Migrate the configured branch to a commit during the next release
expiresOn: 2027-01-31

When both allow and deny match, deny wins. When allow is present, a source must match at least one entry. Git pinning requires the configured input ref to be a 40- or 64-character hexadecimal commit; resolving a branch or tag to a commit does not satisfy the rule.

Each waiver requires rule, subject, reason, and an ISO expiresOn date. A waiver matches one exact canonical subject and rule. It remains active through the expiration date in UTC and does not cover another rule, a differently spelled subject, or a later date.

Supported rules and subjects are:

RuleSubject
source-deniedlocal:<path>, git:<normalized-repository>#/<path>, or oci:<normalized-origin>#<repository-path>
source-not-allowedThe same location subject as source-denied.
git-commit-pin-requiredThe Git location subject used by source-denied.
script-mode-not-allowedscript-mode:prompt, script-mode:run, or script-mode:skip.

Source identities use the same normalization as LunaPack's configured sources. Git subjects omit the URL scheme and mutable source name; the repository root is represented by /. OCI subjects retain the HTTPS origin and use / when the repository path is omitted.

Start with enforcement: report, run planning and luna audit --strict, then resolve or waive every active finding before changing to block. Strict audit uses loaded configuration and lock provenance and performs no network resolution. Report-only and active waived findings do not change a clean strict audit exit. An unwaived blocking finding returns the strict-audit integrity code.

Policy is additive to version-1 lunapack.yml. Older LunaPack binaries ignore the optional property and therefore cannot enforce it; run a policy-aware CLI version in local and automated workflows that rely on blocking policy. Organization-wide inheritance is not part of policy version 1.

Preferences​

Boolean preference values use true or false.

KeyDefaultEffect
discover.only-compositesfalseDiscover only composite packs.
search.only-compositesfalseSearch only composite packs.
git.allow-insecure-transportfalseAllow http:// and git:// Git sources.
next-steps.enabledtrueShow contextual next-step guidance.

Preferences in project YAML use this shape:

preferences:
discover:
onlyComposites: true
search:
onlyComposites: false
git:
allowInsecureTransport: false
nextSteps:
enabled: true
resourceLimits:
filesPerPack: 5000

Use luna config set|list|remove instead of hand-editing project settings.

Resource limits​

Byte limits count raw bytes. Project settings can lower built-in defaults but cannot raise a stricter user-project or global setting.

Config keyUnitDefault/project maximumUser ceiling
resource-limits.project-manifest-bytesbytes1 MiB16 MiB
resource-limits.pack-manifest-bytesbytes1 MiB64 MiB
resource-limits.lock-file-bytesbytes64 MiB1 GiB
resource-limits.pack-document-bytesbytes16 MiB256 MiB
resource-limits.pack-snapshot-bytesbytes2 GiB16 GiB
resource-limits.rendered-file-bytesbytes64 MiB256 MiB
resource-limits.rendered-total-bytesbytes512 MiB4 GiB
resource-limits.dependency-depthedges64128
resource-limits.dependency-nodesnodes1,024100,000
resource-limits.dependency-referencesreferences100,0001,000,000
resource-limits.files-per-packfiles/directories10,000100,000
resource-limits.files-per-graphfiles/directories100,0001,000,000
resource-limits.oci-archive-entriesentries100,0001,000,000
resource-limits.oci-download-bytesbytes512 MiB16 GiB
resource-limits.oci-entry-bytesbytes512 MiB4 GiB
resource-limits.oci-expanded-bytesbytes2 GiB16 GiB

Zero and negative values are invalid. The user ceiling is also a finite upper bound. The CLI retains additional compiled bootstrap ceilings for project configuration and user settings.

Project settings are stored under:

preferences:
resourceLimits:
packManifestBytes: 2097152
filesPerPack: 5000

Global and user-project settings use the matching camel-case names under preferences.resourceLimits in ~/.lunapack/config.yml.

Trust and script policy​

Project script denial:

trust:
deny:
scripts: true

Portable source and pack trust:

trust:
sources:
- engineering
packs:
- id: dotnet-project
source: engineering
scripts:
allowedEnvironmentVariables:
- CUSTOM_TOOL_HOME
timeoutSeconds: 120

Omit trust.scripts when the default warning allow-list and 300-second timeout are sufficient. A project script timeout uses the smallest configured project, project-user, or global-user value.

Global and project-local user policy and trust live in ~/.lunapack/config.yml, <profile>/.lunapack/lifecycle-hook-policy.yml, and the source-ignore sidecar. See Lifecycle hooks and script trust.

lunapack-lock.yml​

The lock file is generated and should not be edited. Its top-level fields are:

PropertyMeaning
schemaVersionLock schema version, currently 1.
packsExact resolved root and dependency pack records.
linksResolved Luna Link records.

Pack records retain source identity, exact release, resolved Git or OCI provenance, effective targets, dependencies, managed-file SHA-256 digests, and external-source locks. Link records retain source identity, resolved commit, selected paths, effective targets, and definition digest.

See Lock file reference for every lock property.