feat(cli): add self-update command#641
Conversation
Add completion command supporting bash, zsh, and fish shells. Completes issue NVIDIA#155.
- Add 'nemoclaw update' command to check for updates - Add 'nemoclaw update --yes' to update without prompting - Add 'nemoclaw update --force' to force update even if current - Fetches latest version from npm registry and GitHub releases - Detects running from source and suggests 'git pull' instead - Adds shell completion support for new commands
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughA new self-update mechanism is being added to the NemoClaw CLI. The implementation includes a dedicated update module that checks version availability from npm and GitHub releases, a new Changes
Sequence DiagramsequenceDiagram
actor User
participant CLI as nemoclaw CLI
participant UpdateMod as Update Module
participant npm as npm Registry
participant gh as GitHub Releases
participant Install as install.sh Script
User->>CLI: nemoclaw update [--force] [--yes]
CLI->>UpdateMod: runUpdate({force, yes})
UpdateMod->>UpdateMod: getCurrentVersion()
UpdateMod->>npm: fetch latest version
npm-->>UpdateMod: version info
UpdateMod->>gh: fetch latest release
gh-->>UpdateMod: version info
UpdateMod->>UpdateMod: compare versions
alt Update Available
alt --yes flag present
UpdateMod->>Install: download install.sh
Install-->>UpdateMod: script received
else Interactive
UpdateMod->>User: prompt for confirmation
User-->>UpdateMod: confirm
UpdateMod->>Install: download install.sh
Install-->>UpdateMod: script received
end
UpdateMod->>Install: execute via bash
Install->>Install: install new version
Install-->>UpdateMod: completion status
UpdateMod->>UpdateMod: cleanup temp files
else No Update Available
UpdateMod->>User: display current/latest versions
end
UpdateMod-->>CLI: success/failure
CLI-->>User: output result
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Summary
nemoclaw updatecommand to check for CLI updatesnemoclaw update --yesto automatically update to latest versionnemoclaw update --forceto force update even if already currentgit pullinsteadUsage
Testing
Closes #642
Summary by CodeRabbit
New Features
nemoclaw updatecommand to check and install the latest CLI updates from npm and GitHub releasesnemoclaw completioncommand to generate shell completion scripts for Bash, Zsh, and Fish--yesflag enables non-interactive updates without user confirmation--forceflag allows re-checking for updates even when already on the latest version