Patch Changes
-
#734
2084fd4Thanks @omeraplak! - fix: auto-detect package managers and add automatic installation tovolt updatecommandThe Problem
The
volt updateCLI command had several UX issues:- Only updated
package.jsonwithout installing packages - Required users to manually run installation commands
- Always suggested
npm installregardless of the user's actual package manager (pnpm, yarn, or bun) - No way to skip automatic installation when needed
This was inconsistent with the HTTP API's
updateSinglePackageandupdateAllPackagesfunctions, which properly detect and use the correct package manager.The Solution
Enhanced the
volt updatecommand to match the HTTP API behavior:Package Manager Auto-Detection:
- Automatically detects package manager by checking lock files:
pnpm-lock.yaml→ runspnpm installyarn.lock→ runsyarn installpackage-lock.json→ runsnpm installbun.lockb→ runsbun install
Automatic Installation:
- After updating
package.json, automatically runs the appropriate install command - Shows detected package manager and installation progress
- Works in both interactive mode and
--applymode
Optional Skip:
- Added
--no-installflag to skip automatic installation when needed - Useful for CI/CD pipelines or when manual control is preferred
Usage Examples
Default behavior (auto-install with detected package manager):
$ volt update Found 3 outdated VoltAgent packages: @voltagent/core: 1.1.34 → 1.1.35 @voltagent/server-hono: 0.1.10 → 0.1.11 @voltagent/cli: 0.0.45 → 0.0.46 ✓ Updated 3 packages in package.json Detected package manager: pnpm Running pnpm install... ⠹ Installing packages... ✓ Packages installed successfullySkip automatic installation:
$ volt update --no-install ✓ Updated 3 packages in package.json ⚠ Automatic installation skipped Run 'pnpm install' to install updated packages
Non-interactive mode:
$ volt update --apply ✓ Updates applied to package.json Detected package manager: pnpm Running pnpm install... ✓ Packages installed successfully
Benefits
- Better UX: No manual steps required - updates are fully automatic
- Package Manager Respect: Uses your chosen package manager (pnpm/yarn/npm/bun)
- Consistency: CLI now matches HTTP API behavior
- Flexibility:
--no-installflag for users who need manual control - CI/CD Friendly: Works seamlessly in automated workflows
- Only updated