
# Commands

## Run a package manager

After `jup enable`, run npm, pnpm, or Yarn as usual:

```sh
pnpm install
yarn add lodash
npm test
```

To use jup without installing shims, put `jup` before the command:

```sh
jup pnpm install
```

Add a version to override the project pin for that command:

```sh
jup yarn@4.9.0 --version
```

`jup yarn --version` prints the Yarn version. `jup --version` prints the jup version.

## Set the project version

```sh
jup use pnpm@11
```

`use` resolves the selector, downloads and verifies the package manager, writes an exact pin to the project, and runs the package manager's setup command when one is required.

The selector may be a name, exact version, range, or registry tag. See [Projects and workspaces](./projects-and-workspaces) for examples.

## Update the project version

```sh
jup up
```

For an exact pin, `up` selects a newer release within the current major version. If `devEngines.packageManager.version` allows a wider set of releases, that range is used instead.

If `packageManager` itself contains a range, `up` keeps the range in the manifest and refreshes its exact resolution in `.corepack.lock`.

Both `use` and `up` accept:

- `--here` to edit `package.json` in the current directory;
- `--pin-style=suffix` to keep the digest in `packageManager` (the default); and
- `--pin-style=sidecar` to put the digest in `devEngines.packageManager.integrity`.

## Download the current project's version

```sh
jup install
```

This downloads and caches the version required by the current project. It does not change the project pin. Run it while building a container image or preparing a machine that will later work offline.

## Install a global fallback

```sh
jup install -g pnpm@11.1.2
```

A **global fallback** is the version jup uses when the current project has no package manager pin. This command downloads the requested release and records it as that manager's fallback.

To fill the cache without changing the fallback, add `--cache-only`:

```sh
jup install -g --cache-only pnpm@11.1.2
```

## Create or import an offline archive

Create an archive containing a package manager:

```sh
jup pack -o package-managers.tgz pnpm@11.1.2
```

`pack` also records the packed release as the global fallback. Import the archive on another machine with:

```sh
jup install -g package-managers.tgz
```

See [CI and offline use](./ci-and-offline) for CI and container examples.

## Inspect the cache

```sh
jup cache list
jup cache list --json
```

Remove downloaded package manager versions:

```sh
jup cache clean
```

This keeps global fallback records. To remove both cached versions and fallback records, run:

```sh
jup cache clean --all
```

jup prints the cache path and whether anything was removed.

## Explain the current setup

```sh
jup info
jup info --json
```

`info` does not contact the network. It reports invalid project settings instead of failing immediately, which makes it useful when jup selects the wrong manifest or version.

The JSON object contains a top-level `version` field for consumers. New fields may be added without changing that version, so readers should ignore fields they do not recognize.

## Install or remove shims

```sh
jup enable
jup disable
```

Common options include:

```sh
jup enable --exclude npm
jup enable --install-directory "$HOME/bin"
jup enable --force
jup disable --install-directory "$HOME/bin"
```

With no package manager names, these commands handle every supported shim. You can also name only the managers you want, such as `jup enable yarn pnpm`.

## Deprecated Corepack commands

`prepare` and `hydrate` remain available for Corepack compatibility, but jup prints a deprecation warning. Use `pack` and `install -g` in new scripts.

::note
The current `jup --help` output uses the name `corepack` in its usage examples because the CLI preserves Corepack-compatible output. Substitute `jup` when running those examples.
::
