Skip to content

Install the CodeRabbit CLI and link it as cr - #215

Merged
haacked merged 2 commits into
mainfrom
haacked/code-rabbit-cli
Sep 21, 2026
Merged

haacked merged 2 commits into
mainfrom
haacked/code-rabbit-cli

Conversation

@haacked

@haacked haacked commented Sep 21, 2026

Copy link
Copy Markdown
Owner

PostHog's reviewing-with-coderabbit skill runs a CodeRabbit pass over the branch before gh pr create, but the binary only existed inside the posthog flox env at ~/.config/posthog/tools/coderabbit/<version>/coderabbit. Agents running outside that env reported the CLI as missing and opened PRs without a local review pass.

  • Installs the coderabbit homebrew cask.
  • Links ~/.local/bin/cr. The cask links only coderabbit, and the skill calls cr.

~/.local/bin is the right home for the link: zshenv.symlink puts it on PATH in every shell context, while ~/.dotfiles/bin is added in zshrc, which the non-interactive zsh -lc that coding agents shell out through never sources.

The link points at $(brew --prefix)/bin/coderabbit rather than whatever coderabbit PATH resolves to. Run from an activated posthog shell the latter is the worktree venv copy, which would leave a dangling link once that worktree is removed.

Two versions coexist after this. Flox pins 0.7.6 inside the posthog env and that copy wins there; brew tracks latest, currently 0.7.8, everywhere else.

Test plan

  • brew install --cask coderabbit links /opt/homebrew/bin/coderabbit, and coderabbit --version prints 0.7.8.
  • /bin/zsh -lc 'command -v cr' prints /Users/haacked/.local/bin/cr, the path PostHog Desktop agents search.
  • cr auth status --agent returns one JSON line and opens no browser.
  • Re-running the installer on a machine that already has the cask skips the install and rewrites the same link.

https://claude.ai/code/session_011M4DkeAnSqEYd7RDxiaGFQ

The homebrew cask links only `coderabbit`. PostHog's
reviewing-with-coderabbit skill calls `cr`, so link that name into
~/.local/bin, which zshenv puts on PATH in every shell context.

Claude-Session: https://claude.ai/code/session_011M4DkeAnSqEYd7RDxiaGFQ

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The change is straightforward and low-risk, with only a minor maintainability nit noted.

Review effort: Lite
Findings: 1 Low severity

Open (1)
What changed in this PR

This PR updates the dotfiles Homebrew bootstrap script to ensure the CodeRabbit CLI is available outside the PostHog flox environment by installing the coderabbit cask and providing a stable cr alias via ~/.local/bin/cr.

Changes:

  • Install the coderabbit Homebrew cask as part of homebrew/install.sh.
  • Create/overwrite ~/.local/bin/cr as a symlink to $(brew --prefix)/bin/coderabbit when present.
File Description
homebrew/​install.sh Installs CodeRabbit and adds a cr symlink in ~/.local/bin for agent-friendly PATH resolution.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread homebrew/install.sh Outdated
@haacked
haacked marked this pull request as ready for review September 21, 2026 23:11
@haacked
haacked merged commit c69d62b into main Sep 21, 2026
1 check passed
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.

2 participants