feat: [PR-1797] add sf migrate command and Rust CLI migration banner#266
Conversation
Show a cyan migration banner when the upgrade banner isn't being shown to nudge users toward the new Rust-based sf CLI, and add a `sf migrate` command that runs the new install script. Generated with [Indent](https://indent.com) Co-Authored-By: Indent <noreply@indent.com>
|
|
Capy auto-review is paused for this organization because the monthly auto-review limit has been reached. Increase the limit or turn it off in billing settings to resume automatic reviews. |
- Skip migrate banner when running `sf upgrade` (was showing above upgrade output because checkVersion returns false early for it) - Add SF_CLI_DISABLE_MIGRATE_BANNER opt-out, surfaced in the banner - Use process.argv[2] === "migrate" for tighter scoping, matching the existing pattern in checkVersion.ts - Handle spawn errors in handleMigrate so ENOENT/EACCES on bash surface as a clean failure instead of crashing the CLI Generated with [Indent](https://indent.com) Co-Authored-By: Indent <noreply@indent.com>
Lead with the Rust rewrite and new commands, then surface the reselling story (the most important reason to migrate, per the April 7 changelog) before the action and fallback text. Generated with [Indent](https://indent.com) Co-Authored-By: Indent <noreply@indent.com>
Per DTao. Generated with [Indent](https://indent.com) Co-Authored-By: Indent <noreply@indent.com>
joshi4
left a comment
There was a problem hiding this comment.
LGTM.
you can consider the alternative banner copy I suggested or ship as is, I leave that up to you.
The legacy installer hardcodes ~/.local/bin/sf, which clobbers the new Rust sf when running as sf-old and silently drops a duplicate when sf lives elsewhere (e.g. /usr/local/bin). Honor SF_CLI_TARGET_DIR and SF_CLI_BINARY_NAME so upgrade.ts can point the installer at process.execPath. Skip the PATH onboarding nudge for in-place upgrades since the user is already invoking the binary. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The legacy auto-upgrade and 'sf migrate' both target ~/.local/bin/sf, so running them back-to-back risks clobbering the freshly installed Rust binary. Set SF_CLI_DISABLE_AUTO_UPGRADE=1 before dispatching 'sf migrate' so the upgrade path is skipped entirely. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Banner now leads with the Rust rewrite and frames the orderbook value prop as recouping up to 20% of spend. Migration guide URL switches from the docs preview path to sfcompute.com/migrate. Inlines the install-script helpers back into the command action. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
sf migrate command and Rust CLI migration bannersf migrate command and Rust CLI migration banner
Both nudge banners now use yellow so they read as the same class of prompt rather than two competing visual treatments. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Running 'sf migrate' under IS_DEVELOPMENT_CLI_ENV now prints a short '[dev] Skipping install script execution' notice in place of the bash spawn, while still showing the spinner, install heading, and success boxen. This lets us iterate on the migrate UI copy without touching the local sf binary. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Matches the 'Docs:' label already used in the startup migrate banner. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Summary
When no upgrade banner is shown on startup, the legacy CLI now nudges users to migrate to the new Rust-based
sf(blueprint/preview docs). Adds asf migratesubcommand that runs the new install script fromhttps://cli.sfcompute.com.Motivation
sf-cli(the Rust replacement living insfcompute/sfcompute) is the path forward. We want every invocation of the legacy CLI to surface that path — but only when we're not already asking the user to upgrade the current binary, to avoid double-stacking banners.The new install script at
cli.sfcompute.comalready moves the existingsfbinary tosf-old, so users keep access to the legacy CLI during the transition. The banner andsf migrateoutput both call that out.Changes