feat(cli): replace tale update with tale upgrade for self-upgrading CLI#1223
Conversation
Remove the ambiguous `tale update` command (which only synced project files) and introduce `tale upgrade` that unifies binary self-upgrade and project file sync into a single command. - Add self-upgrade: download latest binary from GitHub Releases, verify via --version check, replace with backup/restore on failure - Handle cross-filesystem moves via shell mv (avoids EXDEV from fs.rename), sudo fallback for permission-restricted install dirs - Support GITHUB_TOKEN/GH_TOKEN for authenticated GitHub API requests - Platform/arch allowlist with clear errors for unsupported targets - Windows support via rename-self pattern for locked executables - Extract compareVersions() utility from get-available-versions.ts for directional semver comparison (prevents false downgrades) - After binary replacement, spawn new binary with hidden --internal-sync-only flag to sync project files using new templates - Update all documentation references from tale update to tale upgrade
- Add dev-mode guard to prevent overwriting Bun runtime via process.execPath - Fix Windows `ren` bug passing full path instead of filename as second arg - Fix silent backup restore failure that lied about restoration success - Add 30s timeout to GitHub API call to prevent indefinite hangs - Add runtime validation for GitHub API tag_name response field - Add User-Agent header to GitHub API requests - Improve 403 error message to mention both rate limiting and auth issues - Fix double-header UX when upgrade delegates to update for file sync - Remove dead skipVersionCheck code path (unreachable after update removal) - Replace process.exit() with thrown error for consistent error handling - Add backward-compat alias so `tale update` still works
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
…and promptTemplates Consolidated duplicate indexes with identical fields but different names, which caused Convex push failures.
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR renames the CLI command from Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Summary
tale updatewithtale upgrade, which now downloads the latest CLI binary from GitHub Releases and then syncs project files — combining two manual steps into one commandcompareVersionsinto a shared utility and reuses it in both the upgrade action and the version registryupdateas a hidden alias for backward compatibilityTest plan
tale upgrade --dry-runon Linux/macOS and verify it prints what would happen without modifying anythingtale upgradeagainst a real release to confirm download, verification, replacement, and project file synctale updateand confirm the alias still workstale upgradeerrors gracefully when run viabun run(dev mode guard)Summary by CodeRabbit
Release Notes
New Features
Changes
updatecommand toupgrade.