feat: add built-in upgrade command for self-update (#898)
Adds a new `agent-browser upgrade` command that automatically detects the installation method (npm, Homebrew, or Cargo) and runs the appropriate update command. **Changes:** - Added new `upgrade.rs` module with upgrade logic - Updated `main.rs` to handle the `upgrade` command - Added upgrade help text in `output.rs` - Updated README.md and documentation with upgrade instructions - Updated SKILL.md to mention the upgrade command **Implementation details:** - Fetches latest version from npm registry to show version diff - Auto-detects installation method by checking Homebrew, Cargo paths, and npm global packages - Provides fallback instructions if installation method cannot be determined - Uses existing color module for consistent styled output - Gracefully handles network failures and continues with upgrade Fixes #895
This commit is contained in:
@@ -2266,6 +2266,22 @@ Examples:
|
||||
"##
|
||||
}
|
||||
|
||||
// === Upgrade ===
|
||||
"upgrade" => {
|
||||
r##"
|
||||
agent-browser upgrade - Upgrade to the latest version
|
||||
|
||||
Usage: agent-browser upgrade
|
||||
|
||||
Detects the current installation method (npm, Homebrew, or Cargo) and runs
|
||||
the appropriate update command. Displays the version change on success, or
|
||||
informs you if you are already on the latest version.
|
||||
|
||||
Examples:
|
||||
agent-browser upgrade
|
||||
"##
|
||||
}
|
||||
|
||||
// === Connect ===
|
||||
"connect" => {
|
||||
r##"
|
||||
@@ -2572,6 +2588,7 @@ Sessions:
|
||||
Setup:
|
||||
install Install browser binaries
|
||||
install --with-deps Also install system dependencies (Linux)
|
||||
upgrade Upgrade to the latest version
|
||||
|
||||
Snapshot Options:
|
||||
-i, --interactive Only interactive elements
|
||||
|
||||
Reference in New Issue
Block a user