fix(update-notice): suggest brew upgrade for Homebrew installs
ER
10h ago+88+88+01234567890123456789-55-55-01234567890123456789
The startup update notice always tells people to run npm install -g firecrawl-cli. For a Homebrew install that is the wrong fix: it installs a second copy through npm and leaves the brew keg stale.
What changed
updateCommand()insrc/utils/update-notice.tspicks the upgrade command from where the CLI is installed. When the module lives under a Homebrew keg (.../Cellar/firecrawl-cli/...), the notice saysbrew upgrade firecrawl-cli; every other install keepsnpm install -g firecrawl-cli. It reads__dirname, which Node resolves through the bin symlink, so/opt/homebrew/bin/firecrawlmaps to the Cellar path. A plainnpm install -gwith Homebrew's Node lives in/opt/homebrew/lib/node_modulesand still gets the npm hint.formatUpdateNoticeand the sharedcolorizeUpdateNoticetake the chosen command, andmaybeShowUpdateNoticeaccepts aninstallPathsoverride for tests.- Removes the old
homebrew/firecrawl-cli.rbdraft. It was pinned to 1.10.0 with placeholder checksums and was never installable; a tap formula built from the npm tarball replaces it.
detectPackageManager is unchanged, so firecrawl init behaves as before.
Testing
- New unit tests cover the macOS and Linux Cellar paths, a Homebrew-Node npm global path, and the full notice under a Cellar install.
- Packed this branch, installed it into a Homebrew-style keg (
Cellar/firecrawl-cli/1.26.9/libexec, linked from abin/symlink), and ranfirecrawl statusin a TTY with a cached newer version. The notice printedRun brew upgrade firecrawl-cli to update.; the same package under a plain npm global prefix printed the npm command. pnpm run type-check,pnpm run format:checkandpnpm run buildpass. The one failing test in a full local run (parse.test.ts, "without auth ... no key") also fails onmainwhenFIRECRAWL_API_KEYis set in the shell, so it is unrelated.
Summary by cubic
Fixes the startup update notice so Homebrew installs are told to run brew upgrade firecrawl-cli instead of npm install -g firecrawl-cli, which previously installed a second copy through npm and left the brew keg stale.
- Detects a Homebrew install by checking whether the module lives under a Cellar keg path or, for compiled binaries, whether the executable path points into one; all other installs keep the npm hint.
- Removes the draft
homebrew/firecrawl-cli.rbformula, which was pinned to 1.10.0 with placeholder checksums and was never installable.