fix(update-notice): suggest brew upgrade for Homebrew installs

ER
10h ago
+88-55

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() in src/utils/update-notice.ts picks the upgrade command from where the CLI is installed. When the module lives under a Homebrew keg (.../Cellar/firecrawl-cli/...), the notice says brew upgrade firecrawl-cli; every other install keeps npm install -g firecrawl-cli. It reads __dirname, which Node resolves through the bin symlink, so /opt/homebrew/bin/firecrawl maps to the Cellar path. A plain npm install -g with Homebrew's Node lives in /opt/homebrew/lib/node_modules and still gets the npm hint.
  • formatUpdateNotice and the shared colorizeUpdateNotice take the chosen command, and maybeShowUpdateNotice accepts an installPaths override for tests.
  • Removes the old homebrew/firecrawl-cli.rb draft. 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 a bin/ symlink), and ran firecrawl status in a TTY with a cached newer version. The notice printed Run 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:check and pnpm run build pass. The one failing test in a full local run (parse.test.ts, "without auth ... no key") also fails on main when FIRECRAWL_API_KEY is set in the shell, so it is unrelated.

Open in Capy


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.rb formula, which was pinned to 1.10.0 with placeholder checksums and was never installable.