homebrew

Resolved 💬 1 comment Opened Mar 12, 2025 by marafa-sugarcrm Closed Apr 7, 2025

hi
i used claude code to 100% generate this homebrew formula.

require "language/node"

class ClaudeCode < Formula
  desc "Command line interface for Claude AI by Anthropic"
  homepage "https://www.anthropic.com"
  url "https://registry.npmjs.org/@anthropic-ai/claude-code/-/claude-code-0.2.37.tgz"
  sha256 "ddf92e983a7bad6875d6436deabc32bfbbdfa75b43655c10777ae9d2a9d9a9da"
  license "MIT"

  livecheck do
    url "https://registry.npmjs.org/@anthropic-ai/claude-code/latest"
    regex(/["']version["']:\s*["']([^"']+)["']/i)
  end

  depends_on "node"

  def install
    # Install the package globally within the Homebrew prefix
    system "npm", "install", "-g", "--prefix", prefix, "@anthropic-ai/claude-code@#{version}"
  end

  test do
    system bin/"claude-code", "--help"
  end
end

and run as
brew install --build-from-source ./claude-code.rb

(works for me!)

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗