---
slug: "realvendex-pi-dep-upgrade"
source_type: "readme"
source_url: "https://cdn.jsdelivr.net/gh/ZachDreamZ/pi-dep-upgrade@master/README.md"
repo: "https://github.com/ZachDreamZ/pi-dep-upgrade"
source_file: "README.md"
branch: "master"
---
# pi-dep-upgrade

> Safe dependency upgrade automation for pi.dev extensions — dry-run, rollback, and changelog integration.

## Installation

```bash
pi install npm:@realvendex/pi-dep-upgrade
```

## What It Does

pi-dep-upgrade provides safe, automated dependency upgrades for pi.dev extensions. It's the natural companion to `pi-dep-audit` — audit finds outdated/vulnerable deps, upgrade fixes them.

Key features:
- **Dry-run mode** — preview what would change before applying
- **Automatic backup** — snapshots package.json + lockfile before every upgrade
- **One-click rollback** — restore to pre-upgrade state if something breaks
- **Risk classification** — semver-aware risk levels (low/medium/high)
- **Selective upgrades** — upgrade specific packages or sweep all

## Tools

### `dep_upgrade`

Execute safe dependency upgrades with automatic backup.

**Parameters:**
- `packageNames` (string[], optional) — Specific packages to upgrade. If omitted, upgrades all.
- `dryRun` (boolean, optional) — Preview changes without applying. Default: false.
- `includeDev` (boolean, optional) — Include devDependencies. Default: true.

**Example:**
```
Use the dep_upgrade tool with dryRun=true to preview all available upgrades
```

### `dep_upgrade_dry_run`

Preview dependency upgrades without applying any changes.

**Parameters:**
- `packageNames` (string[], optional) — Specific packages to check.
- `includeDev` (boolean, optional) — Include devDependencies. Default: true.

**Example:**
```
Use the dep_upgrade_dry_run tool to see what dependencies can be upgraded
```

### `dep_upgrade_rollback`

Roll back failed dependency upgrades by restoring a pre-upgrade snapshot.

**Parameters:**
- `backupId` (string, optional) — Specific backup ID to restore. If omitted, restores the most recent.

**Example:**
```
Use the dep_upgrade_rollback tool to restore the last backup
```

## Integration with pi-dep-audit

pi-dep-upgrade is designed to work seamlessly with [pi-dep-audit](https://www.npmjs.com/package/pi-dep-audit):

1. **Audit first:** Use `dep_outdated` from pi-dep-audit to identify outdated dependencies
2. **Preview:** Use `dep_upgrade_dry_run` to see what would change
3. **Upgrade:** Use `dep_upgrade` to apply the changes safely
4. **Rollback if needed:** Use `dep_upgrade_rollback` if something goes wrong

## Resources

- [npm](https://www.npmjs.com/package/@realvendex/pi-dep-upgrade)
- [GitHub](https://github.com/ZachDreamZ/pi-dep-upgrade)
- [pi.dev](https://pi.dev/packages/@realvendex/pi-dep-upgrade)

## License

MIT
