feat(cli): add reasonix update self-update command#3095
Open
lanshi17 wants to merge 16 commits into
Open
Conversation
Commands now run in the project directory (c.cpRoot), not wherever the process started. Matches the bash tool's behavior where cmd.Dir is set to the workspace directory.
TUI: - Shell commands show first 10 lines after collapse instead of 'N lines' - Ctrl+B toggles between preview and full output for the most recent shell command - Input box border turns green and status shows 'Shell' mode tag when typing ! Desktop: - Shell tool cards auto-expand showing first 10 lines of output - 'show all N lines' button to reveal full output - Cmd+B / Ctrl+B toggles the most recent shell card - Composer caret changes to $ and border turns green in shell mode - ShellExpandProvider context coordinates global toggle hotkey
- toggleShellOutput now caps expanded output at shellExpandMaxLines (200) to prevent huge transcript entries from hanging the TUI or pushing the input box off-screen. - Added shellExpandMaxLines constant alongside shellPreviewLines. - Ensured innerW fallback when width is very small.
- Mouse left-click on the '… N more lines (click/Ctrl+B)' hint line toggles shell output expand/collapse - Hint text updated to mention click alongside Ctrl+B - ShellModeHint updated: 'click output to expand' / '点击输出展开' - Avoids tmux Ctrl+B conflict — mouse click works everywhere
Upstream changed App.ctrl to activeCtrl() for multi-tab support.
- TUI: check empty command before entering tuiRunning state, show usage notice directly instead of calling RunShell which would return without emitting TurnDone, leaving the TUI stuck in 'thinking' state. - Desktop: show notice directly for bare !, skip empty RunShell round-trip.
When Esc cancels a running shell command, the cancel may complete synchronously (the process is killed and runGuarded finishes before the TUI re-enters the event loop). In that case, ctrl.Running() is already false and the TUI can transition to idle immediately instead of waiting for a TurnDone event that may have already been consumed.
Add a CLI self-update command that downloads and applies the latest release from GitHub Releases: - `reasonix update` checks for a newer version and replaces the running binary in-place (SHA256-verified, atomic via minio/selfupdate) - `reasonix update --dry-run` reports availability without downloading - `reasonix upgrade` as a convenience alias The update flow: 1. Queries GitHub Releases API for the latest release 2. Compares semver against the running version 3. Downloads the platform-matching archive (.tar.gz or .zip) 4. Verifies SHA256 against the release's SHA256SUMS 5. Extracts and atomically replaces the binary Version parsing handles git-describe output (e.g. `desktop-v1.0.0-105-gf3894d6f`) by extracting the vX.Y.Z segment. Dev builds are rejected with a clear message. Proxy-aware: respects the user's network.proxy_* config via netclient. Closes esengine#3059
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a CLI self-update command (
reasonix update) that downloads and applies the latest release from GitHub Releases, addressing the lack of an in-place upgrade mechanism for direct-download users.Closes #3059
Changes
New files
internal/update/update.gominio/selfupdateinternal/update/update_test.gonormalizeVersion,parseSHA256SUMS,checkSHA256,extractFromTarGz,sumsAssetURL,assetName)internal/cli/update.go--dry-run), proxy-aware HTTP client, progress displayModified files
internal/cli/cli.go"update", "upgrade"case to the command switchinternal/i18n/i18n.goMessagesstructinternal/i18n/messages_en.goreasonix updatein usage textinternal/i18n/messages_zh.goreasonix updatein usage textgo.mod/go.sumgithub.com/minio/selfupdate v0.6.0,golang.org/x/mod v0.36.0Usage
How it works
api.github.com/repos/esengine/DeepSeek-Reasonix/releases/latestgolang.org/x/mod/semver).tar.gzfor Linux/macOS,.zipfor Windows)SHA256SUMSfilegithub.com/minio/selfupdate)Design decisions
minio/selfupdate,golang.org/x/mod/semver) already in the desktop module — now promoted to the CLI modulegit describeoutput likedesktop-v1.0.0-105-gf3894d6fby extracting thevX.Y.Zsegmentversion = "dev") are safely rejected with a clear messagenetwork.proxy_*config vianetclientTestCatalogsCompleteTesting