add claude-code

This commit is contained in:
YuanHui
2025-07-16 18:48:10 +08:00
parent 1b8fd2a1bb
commit 7dfc3a82ee

25
Formula/claude-code.rb Normal file
View File

@@ -0,0 +1,25 @@
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-1.0.53.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