Set up the Unity Package Manager command-line interface (UPM CLI) so you can pack and sign custom packages from the command line or continuous integration (CI) environment.
Before you can use UPM CLI to pack and sign packages, you need to install the tool and configure your environment with the required credentials. You need to install the tool only once, then each time a newer version of the tool is available. The following sections describe the prerequisites, the installation process, and how to verify your installation.
The install script runs locally. It doesn’t send private data to Unity.
For background information about UPM CLI, refer to Unity Package Manager CLI workflow.
Before you install and use UPM CLI, complete the following steps.
Important: These prerequisites require you to interact with the Unity Cloud Dashboard. If you belong to multiple organizations, make sure you’re signed in to the dashboard with the organization you want to sign packages with. Use the account menu in the dashboard to check your organization or change to another one.
UPM_SERVICE_ACCOUNT_KEY_ID: The key ID that you generated when you created the service account.UPM_SERVICE_ACCOUNT_KEY_SECRET: The secret key that you generated when you created the service account.To check if UPM CLI is already installed:
Open a terminal window (macOS or Linux) or a PowerShell window (Windows).
Run one of the following commands:
upm --version
upm -v
command not found or 'upm' is not recognized, UPM CLI isn’t installed. Proceed to Install UPM CLI.
You can install or update to the latest version of UPM CLI with one command, or you can run multiple commands if you want to inspect the script.
Both methods install UPM CLI and add it to the PATH environment variable, so you can run upm commands from any directory.
To download and install the latest version of UPM CLI without inspecting the script, run the command that matches your operating system:
macOS or Linux:
curl -fsSL https://cdn.packages.unity.com/upm-cli/install.sh | bash
Tip: To install a specific version instead of the latest version, append -s -- v#.#.# to the install command, replacing v#.#.# within the actual number. For example, to install v9.24.0, append -s -- v9.24.0.
Windows (PowerShell):
irm https://cdn.packages.unity.com/upm-cli/install.ps1 | iex
Tip: To install a specific version instead of the latest version, refer to Install with multiple commands.
When the install command completes, make sure you restart your terminal session for the changes to take effect.
To install or update to the latest version of UPM CLI with the option to inspect the script:
Open a terminal window (macOS or Linux) or a PowerShell window (Windows).
macOS or Linux:
curl -fsSL https://cdn.packages.unity.com/upm-cli/install.sh -o install.sh
Windows (PowerShell):
Invoke-WebRequest https://cdn.packages.unity.com/upm-cli/install.ps1 -OutFile install.ps1
macOS or Linux:
less install.sh
Type q to return to the terminal prompt.
Windows (PowerShell):
Get-Content install.ps1 | more
Type q to return to the PowerShell prompt.
macOS or Linux:
bash install.sh
Windows (PowerShell):
. .\install.ps1
Note: If PowerShell blocks the script due to execution policy settings, temporarily allow it with the following commands:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
.\install.ps1
Tip: To install a specific version instead of the latest version, append v#.#.# to the install command, replacing v#.#.# within the actual number. For example, to install v9.24.0, append v9.24.0.
When the install script completes, make sure you restart your terminal session for the changes to take effect.
Restart your Terminal or PowerShell session for the changes to take effect.
On macOS or Linux, you can also run a shell-specific command within the current session:
source ~/.zshrc
source ~/.bashrc
With UPM CLI installed, you’re ready to pack and sign a package with UPM CLI.