feat: add CLI self-upgrade command - #493
Conversation
Greptile SummaryThe PR adds self-upgrade support for standalone, npm, and Homebrew installations, including dry-run and forced same-version reinstall behavior.
Confidence Score: 5/5The PR appears safe to merge because no blocking failure is established at the current revision. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| crates/alien-cli/src/commands/upgrade.rs | Implements package-manager delegation and checksum-verified standalone replacement, including the follow-up safeguards and synchronization handling. |
| crates/alien-cli/src/lib.rs | Adds the upgrade command, visible update alias, parsing coverage, and early context-free dispatch. |
| packages/alien-cli-npm/bin/alien.js | Marks binaries launched through the npm wrapper so upgrades delegate back to npm. |
| crates/alien-cli/src/error.rs | Adds a structured error variant for upgrade failures. |
| crates/alien-cli/Cargo.toml | Enables streaming downloads and adds the semantic-versioning and executable-replacement dependencies. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[alien upgrade or update] --> B{Installation method}
B -->|npm| C[npm install -g latest]
B -->|Homebrew| D[brew upgrade alien]
B -->|Standalone| E[Fetch stable version]
E --> F{Newer or forced same version?}
F -->|No| G[Leave installation unchanged]
F -->|Yes| H[Stream release binary]
H --> I[Verify checksum]
I --> J[Execute version validation]
J --> K[Replace current executable]
K --> L[Synchronize replacement]
L --> M[Report completion]
Reviews (5): Last reviewed commit: "fix: report completed CLI replacements a..." | Re-trigger Greptile
|
Production-channel verification passed after CI: copied the locally built PR binary to a temporary path, then ran the temporary binary with |
Summary
alien upgradewith a visiblealien updatealias--dry-runand--forcesafeguardsResearch
Reviewed Alien's release workflow, stable S3/CloudFront channel, installer routes, npm wrapper, Homebrew publishing, and public installation docs. Compared Codex, Claude Code, Deno, uv, and mise update behavior. The resulting model follows the common split: standalone installs self-replace; package-managed installs delegate to their owner.
Validation
cargo check -p alien-cli --lockedcargo test -p alien-cli commands::upgrade --libcargo test -p alien-cli update_alias_parses_as_upgrade --libtarget/debug/alien upgrade --dry-runtarget/debug/alien update --dry-runALIEN_INSTALL_METHOD=npmalien 99.0.0Linear: ALIEN-577
Companion docs PR follows.