Skip to content

[Brew] Document Homebrew options in brew.env - #33136

Merged
raycastbot merged 2 commits into
raycast:mainfrom
dibas-np:brew/brew-env-docs
Nov 5, 2026
Merged

raycastbot merged 2 commits into
raycast:mainfrom
dibas-np:brew/brew-env-docs

Conversation

@dibas-np

@dibas-np dibas-np commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Description

Closes #25112. Docs only.

The extension runs brew without your shell's environment, so a HOMEBREW_CASK_OPTS set in ~/.zshrc never reaches it. Casks then install to /Applications, and without admin rights the install waits on a password dialog.

As agreed in the issue, the README now points to ~/.homebrew/brew.env, which brew reads however it starts, instead of adding a preference.

Adopt Apps still reads HOMEBREW_CASK_OPTS only from Raycast's environment, so it doesn't see a brew.env setting. I can fix that in a separate PR.

Testing

  • With Raycast's environment and the README's brew.env line, brew sets the cask install folder to ~/Applications.
  • Prettier passes.

Checklist

The extension runs brew without the shell's environment, so a
HOMEBREW_CASK_OPTS set in ~/.zshrc never reaches it and casks install to
/Applications. brew reads ~/.homebrew/brew.env however it starts, so the
README points there.

Closes raycast#25112
@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: brew Issues related to the brew extension platform: macOS labels Nov 4, 2026
@raycastbot

Copy link
Copy Markdown
Collaborator

Thank you for your contribution! 🎉

🔔 @nhojb @Aayush9029 @mathieudutour @urwrstkn8mare @ashokbaruaakas @MillerApps @pernielsentikaer @jfkisafk @vpukhanov @j3lte @alexander-cato @ViGeng @ridemountainpig @chrismessina @clins1994 @alexibuild you might want to have a look.

You can use this guide to learn how to check out the Pull Request locally in order to test it.

📋 Quick checkout commands
BRANCH="brew/brew-env-docs"
FORK_URL="https://github.com/dibas-np/extensions.git"
EXTENSION_NAME="brew"
REPO_NAME="extensions"

git clone -n --depth=1 --filter=tree:0 -b $BRANCH $FORK_URL
cd $REPO_NAME
git sparse-checkout set --no-cone "extensions/$EXTENSION_NAME"
git checkout
cd "extensions/$EXTENSION_NAME"
npm install && npm run dev

We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 15 business days.

@greptile-apps

greptile-apps Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] No blocking issues were found.

Summary

Documents how users can set Homebrew options in ~/.homebrew/brew.env.

  • The Brew README explains where Homebrew options reach extension commands.

Reviews (2) · Last reviewed commit: "Update CHANGELOG.md" · Reviewed by Greptile

@nhojb nhojb 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.

LGTM!

@0xdhrv 0xdhrv self-assigned this Nov 5, 2026
@raycastbot
raycastbot merged commit a9a7c9b into raycast:main Nov 5, 2026
2 checks passed
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

@raycastbot

Copy link
Copy Markdown
Collaborator

🎉 🎉 🎉

We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag.

@dibas-np

dibas-np commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

@nhojb, before I open the Adopt Apps follow-up I mentioned, a design question.

Adopt Apps takes its install folder from HOMEBREW_CASK_OPTS in Raycast's environment, so it misses an --appdir set in ~/.homebrew/brew.env, which is where the README now points. Two ways to fix it:

  1. Ask brew. brew ruby -e 'puts Cask::Config.from_args(Homebrew::CLI::Args.new).appdir' prints the folder brew will use, with every brew.env file applied. It takes about 0.5 s and runs once per scan, beside the brew call the scan already makes. Cask::Config is internal, so a Homebrew change could break it, and the scan would then fall back to /Applications.
  2. Read the brew.env files in the extension, the way bin/brew does. There's no extra process, but it's a second copy of Homebrew's rules that can drift. A first version already got one case wrong: bash's export appends on HOMEBREW_CASK_OPTS+=….

I'd go with 1, since it keeps brew as the one source of truth. Which do you prefer?

@nhojb

nhojb commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

I'd go with 1, since it keeps brew as the one source of truth

Seems reasonable and avoids manually parsing brew.env.

Thanks for tackling this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extension: brew Issues related to the brew extension extension fix / improvement Label for PRs with extension's fix improvements platform: macOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Brew] Installing apps with custom Homebrew cask directory fails

4 participants