[PR #89] [MERGED] feat(cli): add self-upgrade command #1826

Closed
opened 2026-10-16 21:11:30 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/89
Author: @morluto
Created: 7/13/2026
Status: ✅ Merged
Merged: 7/13/2026
Merged by: @morluto

Base: main ← Head: feat/cli-upgrade


📝 Commits (2)

  • 0d77a9f feat(cli): add self-upgrade command
  • 8a24088 docs: list upgrade in CLI reference

📊 Changes

5 files changed (+358 additions, -0 deletions)

View changed files

📝 README.md (+12 -0)
📝 scripts/verify-package.mjs (+1 -0)
➕ src/application/Upgrade.ts (+197 -0)
📝 src/cli.ts (+12 -0)
➕ tests/upgrade.test.ts (+136 -0)

📄 Description

Description

Adds rea upgrade for global npm installations. The command checks the npm registry, identifies the prefix that owns the running REA package, and runs the equivalent of npm install --global rea-agents@latest against that prefix.

The ownership check prevents source, local, and npx executions from updating a different global package. It also recognizes the ~/.local/lib/node_modules layout used by the curl installer. If the registry check is unavailable, the command can still install the npm latest tag and reports that the version check was unavailable.

Explicit structured output keeps stdout machine-readable by routing npm progress to stderr.

Suggested review order:

  1. src/application/Upgrade.ts — version lookup, installation ownership, and subprocess policy
  2. tests/upgrade.test.ts — outcomes and prefix-detection coverage
  3. src/cli.ts — command wiring and structured-output selection
  4. scripts/verify-package.mjs and README.md — package surface and usage

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Performance improvement
  • Refactoring (no functional change)
  • Tool contract change (MCP schema modification)

Testing Performed

  • Unit tests added or updated
  • TypeScript typecheck passes (npm run typecheck)
  • Linting passes (npm run lint)
  • Full test suite passes (npm test)
  • Real Hopper verification performed (npm run verify:hopper) — not applicable; Hopper behavior is unchanged
  • Linux real Hopper verification performed (npm run verify:hopper:linux) — not applicable; Hopper behavior is unchanged
  • Package verification performed (npm run verify:package)
  • Package contents checked (npm pack --dry-run)
  • Dead-code check passes (npm run knip)
  • Autoreview reports no actionable findings

Tool Contract Impact

None. The 68-tool MCP inventory is unchanged.

No directly related open issue was found.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/89 **Author:** [@morluto](https://github.com/morluto) **Created:** 7/13/2026 **Status:** ✅ Merged **Merged:** 7/13/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `feat/cli-upgrade` --- ### 📝 Commits (2) - [`0d77a9f`](https://github.com/morluto/rea/commit/0d77a9f1350056a7d2c43771d579e0461029f5b5) feat(cli): add self-upgrade command - [`8a24088`](https://github.com/morluto/rea/commit/8a24088c2bffd34050ea6f6f0e103f64a3f67a64) docs: list upgrade in CLI reference ### 📊 Changes **5 files changed** (+358 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+12 -0) 📝 `scripts/verify-package.mjs` (+1 -0) ➕ `src/application/Upgrade.ts` (+197 -0) 📝 `src/cli.ts` (+12 -0) ➕ `tests/upgrade.test.ts` (+136 -0) </details> ### 📄 Description ## Description Adds `rea upgrade` for global npm installations. The command checks the npm registry, identifies the prefix that owns the running REA package, and runs the equivalent of `npm install --global rea-agents@latest` against that prefix. The ownership check prevents source, local, and `npx` executions from updating a different global package. It also recognizes the `~/.local/lib/node_modules` layout used by the curl installer. If the registry check is unavailable, the command can still install the npm `latest` tag and reports that the version check was unavailable. Explicit structured output keeps stdout machine-readable by routing npm progress to stderr. Suggested review order: 1. `src/application/Upgrade.ts` — version lookup, installation ownership, and subprocess policy 2. `tests/upgrade.test.ts` — outcomes and prefix-detection coverage 3. `src/cli.ts` — command wiring and structured-output selection 4. `scripts/verify-package.mjs` and `README.md` — package surface and usage ## Type of Change - [ ] Bug fix - [x] New feature - [x] Documentation update - [ ] Performance improvement - [ ] Refactoring (no functional change) - [ ] Tool contract change (MCP schema modification) ## Testing Performed - [x] Unit tests added or updated - [x] TypeScript typecheck passes (`npm run typecheck`) - [x] Linting passes (`npm run lint`) - [x] Full test suite passes (`npm test`) - [ ] Real Hopper verification performed (`npm run verify:hopper`) — not applicable; Hopper behavior is unchanged - [ ] Linux real Hopper verification performed (`npm run verify:hopper:linux`) — not applicable; Hopper behavior is unchanged - [x] Package verification performed (`npm run verify:package`) - [x] Package contents checked (`npm pack --dry-run`) - [x] Dead-code check passes (`npm run knip`) - [x] Autoreview reports no actionable findings ## Tool Contract Impact None. The 68-tool MCP inventory is unchanged. ## Related Issues No directly related open issue was found. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:11:30 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#1826
No description provided.