Skip to content

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

Open
erikengervall wants to merge 4 commits into
mainfrom
capy/suggest-brew-upgrade-for
Open

erikengervall wants to merge 4 commits into
mainfrom
capy/suggest-brew-upgrade-for

Conversation

@erikengervall

@erikengervall erikengervall commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

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.

Written for commit 2967425. Summary will update on new commits.

View guided diff Turn on auto-fix

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 3 files

Shadow auto-approve: would not auto-approve because issues were found.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread src/utils/update-notice.ts Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 2 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Shadow auto-approve: would auto-approve. Update notice now suggests brew upgrade only for Homebrew Cellar installs, keeping the npm hint elsewhere; adds tests and removes an uninstallable placeholder Homebrew formula. Bounded, clearly beneficial fix to incorrect update guidance.

View guided diff | Turn on auto-fix | Re-trigger cubic

@capy-ai
capy-ai Bot requested a review from nickscamara October 18, 2026 22:09
…rade-for

# Conflicts:
#	src/__tests__/utils/update-notice.test.ts
#	src/utils/update-notice.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant