Skip to content

openupm/openupm-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

29494ec · Jan 8, 2020

History

45 Commits
Jan 5, 2020
Dec 1, 2019
Jan 8, 2020
Jan 8, 2020
Dec 1, 2019
Dec 1, 2019
Dec 1, 2019
Dec 2, 2019
Dec 7, 2019
Jan 5, 2020
Jan 8, 2020
Nov 30, 2019
Jan 8, 2020
Dec 7, 2019
Jan 5, 2020
Jan 5, 2020

Repository files navigation

openupm-cli

npm NPM npm

The command line tool to maintain the Unity manifest file for 3rd-party upm registries, offering a similar but lighter experience like npm or yarn for NodeJS.

The tool is designed to work with the OpenUPM registry, but can also work with any upm registries, including the official unity registry.

How it works

The cli adds the 3rd-party registry as a scoped registry, and maintain the scopes and dependencies fields when adding/removing packages. If manifest file is modified, unity package manager will detect it and try to resolve the changes.

Notice that the cli does not directly resolve dependencies or install/uninstall package tarballs, at least not for now.

Installation

Required nodejs 12, then

npm install -g openupm-cli

If you prefer yarn, then

yarn global add openupm-cli

Windows platform troubleshooting

If npm is not available in your cmd/powershell/git-bash, please configure your environment variables.

# for npm
c:\Program Files\nodejs

# for npm global bin
C:\Users\{yourName}\AppData\Roaming\npm

Commands

Add packages

openupm add <pkg> [otherPkgs..]
openupm add <pkg>@<version>
openupm add <pkg>@[email protected]:...
openupm add <pkg>@https://github.com/...
openupm add <pkg>@file:...

Notice: openupm will not verify package name for git, https and file protocol.

Remove packages

openupm remove <pkg> [otherPkgs...]

Search packages

openupm search <keyword>

If the registry doesn't support the new search endpoint, it will fall back to old /-/all endpoint. If no package was found, it will search unity official registry instead.

However the search behavior may still performance various for different registries. As of December 2019, unity official registry won't return any results unless the full package name was provided. Make it useless.

View package information

openupm view <pkg>

View package dependencies

open deps <pkg>

Using option --deep to view dependencies recursively

open deps <pkg> --deep

Command options

The cli assumes current working directory (cwd) is the root of an Unity project (the parent of Assets folder). However you can specify the cwd.

openupm --chdir <unity-project-path>

Specify other 3rd-party registry (defaults to openupm registry)

openupm --registry <registry-url>

i.e.
openupm --registry http://127.0.0.1:4873

Turn off unity official (upstream) registry

openupm --no-upstream ...

Turn on debug logging

openupm --verbose ...

Work with unity official (upstream) registry

Most commands can fallback to unity upstream registry if necessary, to make it easier to mix official registry with 3rd-party registry. i.e.

$ openupm add com.unity.addressables com.littlebigfun.addressable-importer
added: [email protected]                # from unity registry
added: [email protected] # from openupm registry
...