Semantic diffs for UnityYAML assets.
30
stars
368
commits
Zig
primary language
Sep 7, 2026
updated
PrefabLens shows semantic diffs of UnityYAML assets. It shows changes to GameObjects, components, and fields.
Use the Chrome extension, Unity Editor package, or CLI. Try the live demo.
The extension shows semantic diffs on GitHub pull requests. It works on github.com only.
Install the extension from the Chrome Web Store.
You can sign in from the diff panel with GitHub Device Flow. You do not need to set a token.
The package requires Unity 2022.3 or later.
Install from OpenUPM:
openupm add com.hashiiiii.prefablens
If you do not use openupm-cli, follow the scoped registry instructions on the package page. Alternatively, install the package from this git URL in the Package Manager:
https://github.com/hashiiiii/PrefabLens.git?path=editor
Open Window > PrefabLens.
The left pane lists every UnityYAML asset that differs from the Git reference in Base. The window uses HEAD if Base is empty. The right pane shows the semantic diff for the selected asset.
The window refreshes when it gains focus. Click Refresh to refresh it manually.
On first use, the package downloads a pinned CLI archive from GitHub Releases.
The package extracts only prefablens into Library/PrefabLens/.
On Windows, the file name is prefablens.exe.
Git does not track this directory.
To use a local CLI:
prefablens.Alternatively, set the PrefabLens.CliPath EditorPrefs key to an absolute path.
The CLI must run and report its version. A local CLI can use a version other than the pinned version. If the override is invalid, PrefabLens uses a valid downloaded CLI or offers a download.
brew install hashiiiii/tap/prefablens
scoop bucket add hashiiiii https://github.com/hashiiiii/scoop-bucket
scoop install prefablens
mise use -g github:hashiiiii/PrefabLens
Download the zip for your platform from GitHub Releases.
Each zip contains one native prefablens executable and the git-merge-prefablens script.
Git needs the script name to select the PrefabLens merge strategy.
Git for Windows reads the script's first line (the shebang) and runs the script with sh.
If you replace an older manual installation on Windows, remove git-merge-prefablens.exe.
Git can run the old executable instead of the new script.
Scoop removes its old git-merge-prefablens shim during scoop update prefablens.
prefablens # HEAD vs working tree, all changed Unity files
prefablens Assets/Foo.prefab # HEAD vs working tree, one file
prefablens main # ref vs working tree, all changed Unity files
prefablens HEAD~1 HEAD Assets/Foo.prefab # ref vs ref, one file
prefablens before.prefab after.prefab # plain two files compare
prefablens --json before.prefab after.prefab
prefablens --html main # self contained HTML report on stdout
prefablens --open main # write the report to a temp file and open it
Operands with a UnityYAML extension (.prefab, .unity, .asset, and more) are paths.
All other operands are Git references (refs).
PrefabLens uses Git 2.39 or later to resolve UnityYAML conflicts during git merge.
Install prefablens and the packaged git-merge-prefablens script on PATH.
The script runs prefablens merge-strategy.
For one clone, run:
prefablens setup-merge
This command adds local Git configuration for the repository.
It also adds UnityYAML attributes to .git/info/attributes.
For a team, use shared attributes instead:
prefablens setup-merge --team
Commit the generated .gitattributes.
Each clone requires this setup command once. Setup keeps existing attributes and unrelated Git configuration.
Use the normal merge command:
git merge origin/main
PrefabLens merges independent UnityYAML changes automatically. If a UnityYAML conflict remains and a terminal is available, the merge UI opens.
Resolve the values. Then select Complete.
Install mise. The toolchain is Zig 0.16, Node 24, pnpm 12, and .NET 10.
Install the toolchain from the repository root:
mise install
| Directory | Description |
|---|---|
core/ | Zig diff engine for the CLI and WASM |
cli/ | prefablens CLI tool |
extension/ | Chrome extension for semantic diffs on GitHub pull requests |
editor/ | Unity Editor package for semantic diffs |
site/ | Live demo on Cloudflare Workers, using CLI and extension artifacts |
Run the commands in each code block from the repository root.
zig build test
zig build run -- before.prefab after.prefab
Build the WASM module for the extension:
zig build wasm
The build and test commands run zig build wasm when needed.
(cd extension && pnpm install && pnpm run build && pnpm test)
These tests run on .NET and call the native CLI. They do not require Unity.
zig build test-installation-binaries -Doptimize=ReleaseSafe
PREFABLENS_TEST_BIN_DIR="$PWD/zig-out/bin" \
PREFABLENS_TEST_ALT_BIN_DIR="$PWD/zig-out/test-alternate-bin" \
dotnet test editor/DotNetTests~/Tests
First, build the CLI, WASM module, and extension demo bundle.
Run pnpm run demo in extension/ to build the demo bundle.
(cd site && node build.mjs)
Open an issue first.
If the issue does not have the approved label, do not open a pull request.
Read CONTRIBUTING.md.
Zig
64.4%
TypeScript
21.8%
C#
10.9%
JavaScript
1.0%
Semantic diffs for UnityYAML assets.
30
stars
368
commits
Zig
primary language
Sep 7, 2026
updated
PrefabLens shows semantic diffs of UnityYAML assets. It shows changes to GameObjects, components, and fields.
Use the Chrome extension, Unity Editor package, or CLI. Try the live demo.
The extension shows semantic diffs on GitHub pull requests. It works on github.com only.
Install the extension from the Chrome Web Store.
You can sign in from the diff panel with GitHub Device Flow. You do not need to set a token.
The package requires Unity 2022.3 or later.
Install from OpenUPM:
openupm add com.hashiiiii.prefablens
If you do not use openupm-cli, follow the scoped registry instructions on the package page. Alternatively, install the package from this git URL in the Package Manager:
https://github.com/hashiiiii/PrefabLens.git?path=editor
Open Window > PrefabLens.
The left pane lists every UnityYAML asset that differs from the Git reference in Base. The window uses HEAD if Base is empty. The right pane shows the semantic diff for the selected asset.
The window refreshes when it gains focus. Click Refresh to refresh it manually.
On first use, the package downloads a pinned CLI archive from GitHub Releases.
The package extracts only prefablens into Library/PrefabLens/.
On Windows, the file name is prefablens.exe.
Git does not track this directory.
To use a local CLI:
prefablens.Alternatively, set the PrefabLens.CliPath EditorPrefs key to an absolute path.
The CLI must run and report its version. A local CLI can use a version other than the pinned version. If the override is invalid, PrefabLens uses a valid downloaded CLI or offers a download.
brew install hashiiiii/tap/prefablens
scoop bucket add hashiiiii https://github.com/hashiiiii/scoop-bucket
scoop install prefablens
mise use -g github:hashiiiii/PrefabLens
Download the zip for your platform from GitHub Releases.
Each zip contains one native prefablens executable and the git-merge-prefablens script.
Git needs the script name to select the PrefabLens merge strategy.
Git for Windows reads the script's first line (the shebang) and runs the script with sh.
If you replace an older manual installation on Windows, remove git-merge-prefablens.exe.
Git can run the old executable instead of the new script.
Scoop removes its old git-merge-prefablens shim during scoop update prefablens.
prefablens # HEAD vs working tree, all changed Unity files
prefablens Assets/Foo.prefab # HEAD vs working tree, one file
prefablens main # ref vs working tree, all changed Unity files
prefablens HEAD~1 HEAD Assets/Foo.prefab # ref vs ref, one file
prefablens before.prefab after.prefab # plain two files compare
prefablens --json before.prefab after.prefab
prefablens --html main # self contained HTML report on stdout
prefablens --open main # write the report to a temp file and open it
Operands with a UnityYAML extension (.prefab, .unity, .asset, and more) are paths.
All other operands are Git references (refs).
PrefabLens uses Git 2.39 or later to resolve UnityYAML conflicts during git merge.
Install prefablens and the packaged git-merge-prefablens script on PATH.
The script runs prefablens merge-strategy.
For one clone, run:
prefablens setup-merge
This command adds local Git configuration for the repository.
It also adds UnityYAML attributes to .git/info/attributes.
For a team, use shared attributes instead:
prefablens setup-merge --team
Commit the generated .gitattributes.
Each clone requires this setup command once. Setup keeps existing attributes and unrelated Git configuration.
Use the normal merge command:
git merge origin/main
PrefabLens merges independent UnityYAML changes automatically. If a UnityYAML conflict remains and a terminal is available, the merge UI opens.
Resolve the values. Then select Complete.
Install mise. The toolchain is Zig 0.16, Node 24, pnpm 12, and .NET 10.
Install the toolchain from the repository root:
mise install
| Directory | Description |
|---|---|
core/ | Zig diff engine for the CLI and WASM |
cli/ | prefablens CLI tool |
extension/ | Chrome extension for semantic diffs on GitHub pull requests |
editor/ | Unity Editor package for semantic diffs |
site/ | Live demo on Cloudflare Workers, using CLI and extension artifacts |
Run the commands in each code block from the repository root.
zig build test
zig build run -- before.prefab after.prefab
Build the WASM module for the extension:
zig build wasm
The build and test commands run zig build wasm when needed.
(cd extension && pnpm install && pnpm run build && pnpm test)
These tests run on .NET and call the native CLI. They do not require Unity.
zig build test-installation-binaries -Doptimize=ReleaseSafe
PREFABLENS_TEST_BIN_DIR="$PWD/zig-out/bin" \
PREFABLENS_TEST_ALT_BIN_DIR="$PWD/zig-out/test-alternate-bin" \
dotnet test editor/DotNetTests~/Tests
First, build the CLI, WASM module, and extension demo bundle.
Run pnpm run demo in extension/ to build the demo bundle.
(cd site && node build.mjs)
Open an issue first.
If the issue does not have the approved label, do not open a pull request.
Read CONTRIBUTING.md.
Zig
64.4%
TypeScript
21.8%
C#
10.9%
JavaScript
1.0%