Repository navigation
Description
Problem
Installing via the documented Homebrew path does not set up shell completions or the agent skill, even though the formula's post-install runs sentry cli setup. The docs state the Homebrew install does this:
apps/cli-docs/src/content/docs/agentic-usage.md: "The curl installer and Homebrew runsentry cli setup, which installs agent skills into detected agent root directories (~/.claude,~/.agents)."apps/cli-docs/src/content/docs/getting-started.mdx(Installation → Package Managers): "Unlike the install script and Homebrew, package manager installs don't set up shell completions or agent skills."
Both are false for the Homebrew path: on a fresh install neither ~/.local/share/zsh/site-functions/_sentry nor ~/.agents/skills/sentry-cli/SKILL.md exists.
Reproduction
brew install getsentry/tools/sentry
ls ~/.agents/skills/sentry-cli/SKILL.md # ENOENT
ls ~/.local/share/zsh/site-functions/_sentry # ENOENT
# Running the formula's own command by hand (same flags) works and installs everything:
sentry cli setup --method brew --no-modify-path
# Recorded installation method: brew
# Completions: Installed to /Users/<me>/.local/share/zsh/site-functions/_sentry
# Agent skills: Installed to /Users/<me>/.agents/skills/sentry-cli/SKILL.mdCause
The formula template in getsentry/toolkit (.craft.yml, lines 80-82) defines:
def post_install
system bin/"sentry", "cli", "setup", "--method", "brew", "--no-modify-path"
endHomebrew runs post_install under an isolated temporary HOME that it deletes afterwards, so anything written there is discarded. Library/Homebrew/formula.rb → run_post_install:
Dir.mktmpdir("#{name}-postinstall-", HOMEBREW_TEMP) do |home|
postinstall_home = Pathname(home)
new_env.merge!(common_sandbox_env(postinstall_home))
setup_home postinstall_home
...common_sandbox_env sets HOME (and XDG_CONFIG_HOME) to that temp dir. Three distinct effects follow:
- Completions are written but thrown away.
sentry cli setupwrites$HOME/.local/share/zsh/site-functions/_sentryinto the tempHOME, which is deleted on exit. - Agent skills are never written at all. Skill install only targets
~/.agents/~/.claude, and agent-root detection (packages/cli/src/lib/agent-skills.ts) finds neither inside the empty tempHOME, so it skips. - The install-method record is lost too.
setInstallInfo({ method: "brew" })writes$XDG_CONFIG_HOME/sentry/cli.db, also under the temp dir.
sentry cli setup is not at fault — it faithfully writes to the HOME it is given.
Impact
- Documented behavior is broken: Homebrew users silently get no completions and no agent skill, and must know to run
sentry cli setupmanually (undocumented for this path). - When users upgrade the standard Homebrew way (
brew upgrade), the same sandboxedpost_installruns, so completions and skills are never created or refreshed.
Evidence
-
Homebrew post-install log
~/Library/Logs/Homebrew/sentry/post_install.01.sentry.logshows a temp home:Completions: Installed to /private/tmp/s-XXXXXX/sentry-postinstall-.../.local/share/zsh/site-functions/_sentry Add to your .zshrc: fpath=("/private/tmp/.../site-functions" $fpath)(no "Agent skills" line — detection found no agent root in the temp
HOME). -
On the same machine, the Cellar install is timestamped
17:39, while~/.agents/skills/sentry-cli/SKILL.mdand~/.local/share/zsh/site-functions/_sentryare stamped17:44:57— i.e. they appeared only after the manualsentry cli setup. -
brewalso emitsWarning: Calling post_install is deprecated! Use post_install_steps instead. -
Environment: macOS Apple Silicon, Homebrew 7.0.10-14-g1bb6afa, sentry 0.47.0, formula
getsentry/tools/sentry.
Possible fixes
-
Completions: install them Homebrew-natively from inside
install, which places them in Homebrew's shared completion dirs (already on users'fpath) and needs no$HOME:generate_completions_from_executable(bin/"sentry", "cli", "completion", shells: [:bash, :zsh, :fish])
-
Agent skills + install metadata: these must live in
$HOME, sopost_installcannot do it. Drop it and add adef caveatsblock telling users to runsentry cli setup(and to re-run it afterbrew upgrade). Updateapps/cli-docs/.../agentic-usage.mdandgetting-started.mdxto reflect the manual step for the Homebrew path. -
Migrating
post_install→post_install_stepswould silence the deprecation warning but not fix the behavior, since those steps run under the same tempHOME.
Activity
linear-code commentedon Oct 19, 2026
MCP-1094
fix(cli): Install Homebrew completions from the formula (getsentry#1555)