Creating and sharing overlays
Create an overlay from existing files. Share it so others can apply it.
Creating an overlay
Section titled “Creating an overlay”The create command puts files from your current repository into an overlay. It saves them to your overlay repository:
# Auto-detect org/repo from git remoterepoverlay create my-overlay
# Explicit target pathrepoverlay create microsoft/vscode/ai-configSelecting files
Section titled “Selecting files”Use --include to specify which files to include:
repoverlay create my-overlay --include .claude/ --include CLAUDE.md --include .envrcWithout --include, repoverlay opens a file selection menu. It suggests AI configuration files, files that git ignores, and untracked files.
Preview and overwrite
Section titled “Preview and overwrite”# See what would be created without writing anythingrepoverlay create my-overlay --dry-run
# Overwrite an existing overlayrepoverlay create my-overlay --forceLocal output
Section titled “Local output”Use --output to create an overlay in a local directory. You do not need an overlay repository:
repoverlay create --output ./my-overlayrepoverlay create --output ./output --include .envrc --include .claude/create --output performs two actions:
- It writes overlay files to the specified directory.
- It applies the overlay to your repository. Symlinks replace the original files. repoverlay saves the state and updates
.git/info/exclude.
Preview without applying
Section titled “Preview without applying”To preview the overlay without changes to your repository, use --dry-run:
# Preview: see what files would be created and appliedrepoverlay create --output ./my-overlay --dry-runThis command shows the overlay contents and the planned changes. It does not write files or change your repository.
Overlay configuration (advanced)
Section titled “Overlay configuration (advanced)”Create repoverlay.ccl in the root of your overlay directory to control how repoverlay applies files:
overlay = name = my-config description = Shared editor and environment config
/= Rename files when applyingmappings = .envrc.template = .envrc vscode-settings.json = .vscode/settings.json
/= Symlink entire directories as a unitdirectories = = .claude = scratchOverlay name and description
Section titled “Overlay name and description”The overlay.name field sets the name for status, remove, and other commands. If you omit it, repoverlay uses the directory name. Use the optional overlay.description field to explain the purpose of the overlay.
Mappings
Section titled “Mappings”The mappings section renames files when you apply the overlay. Each entry maps a source filename to a target path. Use this when the overlay filenames differ from those the target repository needs.
One source file can map to multiple target paths. Repeat the key with a different target path each time:
mappings = config.json = .vscode/settings.json config.json = .zed/settings.jsonDirectories
Section titled “Directories”The directories section lists directories to symlink or copy as a unit instead of as individual files. Use this for directories such as .claude/ when repoverlay must manage the full directory tree as one unit.
Configuration format
Section titled “Configuration format”repoverlay uses CCL (Categorical Configuration Language) for configuration files. CCL uses = for key-value pairs and indentation for nesting. Lines starting with /= are comments.
Composing overlays
Section titled “Composing overlays”Overlays in the in-repo library can reuse files from other overlays. Two keys in repoverlay.ccl control this:
extends
Section titled “extends”Inherit every file from a single parent overlay:
extends = overlay = base-configThe overlay inherits all files, mappings, and directories from its parent. The parent can also extend another overlay. repoverlay detects cycles in this chain.
includes
Section titled “includes”Select specific files from other overlays:
includes = = overlay = tools files = = .editorconfig = scripts/lint.shYou can list several includes entries. Included overlays can also use extends or includes. repoverlay resolves them recursively.
Precedence
Section titled “Precedence”If multiple files have the same target path, repoverlay uses this priority order:
- The overlay's own files
- Files from
extends - Files from
includes(later entries override earlier ones)
Overlay repository structure
Section titled “Overlay repository structure”An overlay repository organizes overlays by target project:
my-overlays/├── microsoft/│ └── FluidFramework/│ ├── claude-config/│ │ ├── CLAUDE.md│ │ └── .claude/│ └── dev-tools/│ └── .envrc└── tylerbutler/ └── tools-monorepo/ └── ai-config/ └── CLAUDE.mdThe structure is <target-org>/<target-repo>/<overlay-name>/. When someone runs repoverlay apply org/repo/overlay-name, repoverlay resolves the overlay from this directory structure.
Global overlays
Section titled “Global overlays”A global overlay applies to any repository, regardless of its git remote. Store global overlays in the reserved @global/ namespace beside the project-specific <org>/<repo>/ directories:
my-overlays/├── microsoft/│ └── FluidFramework/│ └── claude-config/└── @global/ └── dotfiles/ └── .gitconfigTo create one, use --global with the overlay name alone. This skips git remote detection:
repoverlay create dotfiles --globalrepoverlay browse lists global overlays for every repository under the Global heading. It shows each overlay as */<name>. Apply it with the name alone:
repoverlay apply dotfilesIf a global overlay and a repository-specific overlay have the same name, repoverlay prefers the repository-specific overlay within that source. It checks org/repo/name before @global/name. It still checks sources in priority order.
You can apply any overlay to any repository. repoverlay checks file paths and conflicts, not the repository for which you created the overlay. The @global namespace marks an overlay for use in all repositories. It lets repoverlay find the overlay without an org/repo match.
Sharing overlays
Section titled “Sharing overlays”After you create overlays in a repository, push the repository to GitHub:
cd ~/my-overlaysgit push origin mainOthers can then apply your overlays using your GitHub username:
# Interactive selectionrepoverlay apply tylerbutlerA three-part reference uses the target organization, target repository, and overlay name: <target-org>/<target-repo>/<overlay-name>. repoverlay resolves this reference against configured sources. Users must first add your overlay repository as a source:
repoverlay source add tylerbutler/my-overlays
# Applies the ai-config overlay defined for tylerbutler/tools-monoreporepoverlay apply tylerbutler/tools-monorepo/ai-configOr browse without applying:
repoverlay browse tylerbutler