A CLI tool to create .unitypackage files without needing Unity itself.
- C# 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| .forgejo/workflows | ||
| .gitignore | ||
| CHANGELOG.md | ||
| global.json | ||
| LICENSE.md | ||
| PackageBuilder.cs | ||
| Program.cs | ||
| README.md | ||
| UnityPackager.csproj | ||
| UnityPackager.sln | ||
UnityPackager
A CLI tool to create and extract .unitypackage files without needing Unity itself.
Tested with Unity 2021, 2023, and Unity 6. Might not import in older Unity versions.
Usage
Pack
UnityPackager pack <PathToFiles> <UnityRootDirectory> <OutputPath>
- PathToFiles : Local directory containing the assets and their .meta files
- UnityRootDirectory : Where those assets live in a Unity project, e.g.
Assets/Shaders. Must start withAssets/orPackages/ - OutputPath : Package file to create (folders are created if missing).
.unitypackageis appended if missing
Unpack
UnityPackager unpack <PackagePath> <OutputFolder>
- PackagePath : The
.unitypackageto extract - OutputFolder : Directory to extract into (created if missing)
Files are extracted the way Unity would import them: real paths like Assets/Shaders/MyShader.shader with their .meta files next to them, instead of GUID folders.
Examples
UnityPackager pack ./UnityScripts "Assets/Packages/MyScriptPack" ./Staging/MyScriptPack
UnityPackager pack ./ShaderStuff "Assets/Shaders/" ./MyShaderPack.unitypackage
UnityPackager unpack ./Staging/MyScriptPack ./UnpackedFiles
UnityPackager unpack ./MyShaderPack.unitypackage ./UnpackedFiles