定制 hpbxxtr/composer-upgrade-interactive 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

hpbxxtr/composer-upgrade-interactive

Composer 安装命令:

composer require hpbxxtr/composer-upgrade-interactive

包简介

Interactive TUI for selectively upgrading Composer dependencies (yarn upgrade-interactive for PHP)

README 文档

README

composer upgrade-interactive

Packagist Version PHP License Codecov PHPStan PHP-CS-Fixer Rector brnshkr/config

Features | Requirements | Installation | Usage | Key bindings | How it works

An interactive TUI for selectively upgrading Composer dependencies

yarn upgrade-interactive for PHP!

demo

✨ Features

  • Patch / minor / major columns per package — choose exactly how far to upgrade each one
  • Full version picker — press v on any cell to browse all available stable versions in an inline multi-column list and pin an exact release
  • Live compatibility checking — conflicting versions are marked with ! as you navigate; the footer explains which dependency chain is broken and whether it originates from the current upgrade selection or from an already-installed package
  • require and require-dev sections rendered separately
  • Abandoned package warnings with replacement suggestions
  • Comparison and release URLs in the footer for whichever bump type or version is focused (GitHub, GitLab, Packagist)
  • Full keyboard navigation — arrow keys, vim (hjkl), and Emacs (Ctrl+P/N/B/F) bindings

📋 Requirements

  • PHP 8.3+
  • Composer 2.x

📦 Installation

composer global require hpbxxtr/composer-upgrade-interactive

Or as a project dev dependency:

composer require --dev hpbxxtr/composer-upgrade-interactive

Trust prompt — Composer will ask you to allow the plugin to execute code. Answer y to enable it:

Do you trust "hpbxxtr/composer-upgrade-interactive" to execute code and wish to enable it now?
(writes "allow-plugins" to composer.json) [y,n,d,?] y

🚀 Usage

composer h:ui

Aliases: composer hpbxxtr:upgrade-interactive · composer upgrade-interactive

Navigate to a package, move across the patch/minor/major columns with the arrow keys, press space to select the latest version for that bump level, or press v to open an inline picker and choose any specific stable release. Press enter to confirm and apply.

Options

Option Description
--caret Write a caret range constraint (e.g. ^1.2.3) instead of an exact version (1.2.3)

Example — pin exact versions (default):

composer h:ui
# writes: "vendor/pkg": "1.2.3"

Example — allow future minor/patch updates:

composer h:ui --caret
# writes: "vendor/pkg": "^1.2.3"

⌨️ Key bindings

Normal mode

Key Action
/ k / Ctrl+P Move up
/ j / Ctrl+N Move down
/ h / Ctrl+B Move left (previous bump column)
/ l / Ctrl+F Move right (next bump column)
space Toggle selection (latest version for focused bump)
v Open version picker for the focused cell
enter Confirm and apply upgrades
Ctrl+C Cancel

Version picker

Key Action
/ Navigate versions within the current column
/ Switch between version columns (oldest left, newest right)
space Select the highlighted version and close picker
esc / at first column Close picker without changing selection

⚙️ How it works

  1. Resolution — iterates the local Composer repository via internal Composer APIs and finds the best available patch, minor, and major target for every direct dependency.
  2. Initial compatibility check — before the TUI opens, every candidate version is checked against the currently installed package set. Conflicting versions are pre-marked with ! when the table first renders.
  3. Table — one row per outdated package, three columns for patch / minor / major. Cells marked ! indicate conflicts with the current state; the footer explains the broken dependency chain.
  4. Version picker — pressing v on any cell fetches all stable releases for that bump level from Packagist and renders them as a side-by-side column picker, grouped by series (e.g. 1.4.x, 1.3.x). Each version is checked for compatibility before the picker opens.
  5. Live conflict recheck — every time a selection changes, all visible versions are re-evaluated against the updated effective world (see below).
  6. Apply — writes updated constraints to composer.json (exact version by default, caret range with --caret) then runs composer update --with-all-dependencies for all selected packages in one pass.

Conflict detection

Compatibility is checked against an effective world that combines three layers:

Layer Description
Installed base All currently installed direct dependencies and their versions
Selection overrides Any packages you have already selected for upgrade in this session — their selected version replaces the installed one
Candidate override The specific version being evaluated replaces the installed version of that package in the world

A conflict is reported when:

  • Forward — the candidate version declares a require that is not satisfied by another package's version in the effective world (e.g. vendor/pkg 2.0 requires vendor/dep ^3.0 but vendor/dep 2.8 is installed)
  • Backward — another package in the effective world declares a require on the candidate package that the candidate's version does not satisfy (e.g. vendor/other 1.5 requires vendor/pkg ^1.0 but you are upgrading to vendor/pkg 2.0)

The conflict footer shows up to five conflicts at a time. Each line identifies the dependent package, the constraint it declares, and whether the conflicting dependency comes from a selected upgrade (selected: X) — meaning you can potentially resolve it by also upgrading that package — or from an installed package (installed: X / update available) that is not part of the current upgrade set.

📄 License

MIT — see LICENSE.

hpbxxtr/composer-upgrade-interactive 适用场景与选型建议

hpbxxtr/composer-upgrade-interactive 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 31 次下载、GitHub Stars 达 5, 最近一次更新时间为 2026 年 03 月 22 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「php」 「cli」 「composer」 「semver」 「update」 「dependencies」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 hpbxxtr/composer-upgrade-interactive 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 hpbxxtr/composer-upgrade-interactive 我们能提供哪些服务?
定制开发 / 二次开发

基于 hpbxxtr/composer-upgrade-interactive 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 31
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 32
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-22