Skip to content
Better PM
Esc
↑↓navigate↵open⌘Jpreview

pm up

Update dependencies

Overview

The pm up (or pm update) command updates dependencies in your project. It supports interactive mode and can update to the latest versions.

Syntax

pm up [packages...] [options]
pm update [packages...] [options]

Arguments

packages string[]

Specific packages to update. If omitted, updates all dependencies.

Options

-i boolean (default: false)

Interactive mode - prompts for each update

–latest boolean (default: false)

Update to the latest version (not restricted by semver range)

Examples

Update All Dependencies

pm up
Running: pnpm update

Update Specific Package

pm up typescript
Running: pnpm update typescript

Update Multiple Packages

pm up react react-dom
Running: pnpm update react react-dom

Interactive Update

pm up -i
Running: pnpm update -i

? Choose dependencies to update:
  ◯ typescript 5.0.0 → 5.1.0
  ◯ react 18.2.0 → 18.3.0
  ◯ vite 4.3.0 → 4.4.0

Update to Latest

pm up --latest
Running: pnpm update --latest

Combined Flags

pm up -i --latest typescript
Running: pnpm update -i --latest typescript

How It Works

From src/commands/up.ts:18-32:

const updateHandler = (args: {
  i: boolean;
  latest: boolean;
  args: ReadonlyArray<string>;
}) =>
  Effect.gen(function* () {
    const pm = yield* PackageManagerService;
    const extraArgs: Array<string> = [];
    if (args.i) extraArgs.push('-i');
    if (args.latest) extraArgs.push('--latest');
    extraArgs.push(...Array.from(args.args));
    const cmd = ShellCommand.make(pm.name, 'update', ...extraArgs);
    yield* Console.log(`Running: ${pm.name} update ${extraArgs.join(' ')}`);
    yield* runShellCommand(cmd);
  }).pipe(Effect.provide(PackageManagerLayer));

The command:

  1. Detects your package manager
  2. Builds the update command with flags
  3. Executes the update with all arguments

Update Strategies

Semantic Versioning

By default, updates respect semver ranges in package.json:

{
  "dependencies": {
    "react": "^18.2.0"  // Updates to 18.x.x
  }
}
pm up react
# Updates to latest 18.x.x version

Latest Version

With --latest, ignores semver ranges:

pm up --latest react
# Updates to latest version (e.g., 19.0.0)

Interactive Selection

With -i, choose which updates to apply:

pm up -i
# Shows interactive prompt for each available update

Package Manager Compatibility

Package Manager Command
pnpm pnpm update
bun bun update
npm npm update

Common Use Cases

Regular Maintenance

# Update all dependencies within semver ranges
pm up

Major Version Updates

# Update to latest versions interactively
pm up -i --latest

Single Package Update

# Update specific package
pm up typescript

Review Before Update

# Interactive mode to see what will change
pm up -i

Best Practices

Check Current Versions

Use pm ls to see current versions before updating

pm ls

Update Interactively

Use -i flag to review updates

pm up -i

Test After Updates

Run tests after updating dependencies

pm up && pm run test

Commit Lock File

Always commit the updated lock file

git add pnpm-lock.yaml
git commit -m "chore: update dependencies"

Was this page helpful?