Skip to content

favoyang/openupm-cli

 
 

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 command line tool installs the 3rd-party registry as a scoped registry, and maintains the Packages/manifest.json file when adding/removing packages. If the manifest file is modified, the Unity Package Manager will detect the changes and try to resolve the package dependencies.

Notice: the command line tool does not directly install/uninstall package tarballs, at least 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:...

The package itself and all dependencies that exist in the registry will be served by the scope registry.

Notice: openupm will not verify package or resolve dependencies 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.

Due to the fact that upstream unity registry doesn't support search endpoint as of December 2019, the search command will only query the current registry.

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
...

About

openupm command line interface for upm registry

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%