Skip to content

Installation mechanism besides npm? #80

Closed

Description

@alex

For those of us who aren't JS users, and thus don't already have npm on our systems, it'd be great to have an alternative installation mechanism.

For me personally, providing a brew tap (or even better, an upstream brew formula) would be wunderbar!

Thanks

Activity

  1. added
    enhancement
    on Feb 25, 2025
  2. djsavvy commented on Mar 7, 2025

    @djsavvy

    Great idea! this would be really nice since I don't think npm tools are the best-equipped to self-update, as evidenced by the admonition I'm getting every startup :D

  3. marked homebrew #454 as a duplicate of this issue on Apr 7, 2025
  4. marafa-sugarcrm commented on Apr 8, 2025

    @marafa-sugarcrm

    as per my comment in #454 i used this for the 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

  5. alex commented on Apr 8, 2025

    @alex
    Author

    Have you considered submitting that to homebrew itself? (I haven't checked if it complies with the rules)

  6. added a commit that references this issue on May 9, 2025
  7. Dentrax commented on May 24, 2025

    @Dentrax

    Any updates on this? I found claude on Homebrew: https://formulae.brew.sh/cask/claude but suspect if its claude-code.

    brew install --cask claude-code
    

    This would be great to have.

  8. Moulick commented on May 24, 2025

    @Moulick
  9. Moulick commented on May 26, 2025

    @Moulick

    Not possible in homebrew core unfortunately, It need to be under any of the ~opensource licenses.

  10. RichardoC commented on May 26, 2025

    @RichardoC

    You could maintain your own tap so folks would just need to do brew install anthropics/claude-code/claude-code or similar

  11. Moulick commented on May 27, 2025

    @Moulick

    I'll be happy to write the brew file but someone from Anthropic (@bcherny ?) needs to make the repo, it should be anthropics/homebrew-claude-code or maybe even anthropics/homebrew-claude to cover all in one

  12. 5 remaining items

  13. wolffiex commented on Jul 7, 2025

    @wolffiex
    Collaborator

    Oh yes, we are starting testing of our new native install! If you are brave and you're willing to solve potential problems with alpha software, try this:

    curl -fsSL claude.ai/install.sh | bash
    

    let us know how it goes!

  14. xshapira commented on Jul 7, 2025

    @xshapira

    Oh yes, we are starting testing of our new native install! If you are brave and you're willing to solve potential problems with alpha software, try this:

    curl -fsSL claude.ai/install.sh | bash
    

    let us know how it goes!

    @wolffiex Thanks!

    Installed, but I can't update Claude to the latest version:

    Image

  15. wolffiex commented on Jul 7, 2025

    @wolffiex
    Collaborator

    you will have to figure out why you're picking up the wrong claude
    could be an alias hanging around, or failed uninstall of the global npm version
    the native install is a symlink at ~/.local/bin/claude
    please let us know how you resolve and we'll continue to work on our auto-detection

  16. Jarvvski commented on Jul 11, 2025

    @Jarvvski

    Does the closure mean the brew file is done? Or do you just refer to the binary installation from your website

  17. wolffiex commented on Jul 11, 2025

    @wolffiex
    Collaborator

    brew tap is not done but we will work on it
    for now, use curl -fsSL claude.ai/install.sh | bash

  18. azat-io commented on Jul 13, 2025

    @azat-io

    Are there any plans to support brew?

  19. Jarvvski commented on Jul 13, 2025

    @Jarvvski

    I've opened a PR for adding a cask that just refers to the installer you're providing @wolffiex

    Homebrew/homebrew-cask#219840

    IMO, would be better to move the checksum verification and arch detection inside of the ruby formulae, but I didn't want to mess with your current deployments where you're checking all of that inside the install.sh

    Checking the installer, we could handle all of the installation in the ruby script. But again, not sure what your other plans are

    Am i missing other files for the uninstallation other than the binary over in .local/bin/claude and .claude/? The script doesn't provide any uninstall method, so I had to make some assumptions

  20. timfallmk commented on Jul 14, 2025

    @timfallmk

    @Jarvvski You may want to deconstruct the install.sh and move the logic inside the .rb. Depending on what's available upstream you may be able to do some version/arch parsing logic there.

  21. wolffiex commented on Jul 15, 2025

    @wolffiex
    Collaborator

    Wow, this is awesome @Jarvvski thank you. I was worried we were going to have to push my ruby slop to create a homebrew cask. Could this be called claude instead of claude-code? We are slowly consolidating around that naming for the package.

    The auto-updater is very important to us and we want that to be the default—that is the main benefit of claude install over handling everything directly in homebrew. We can definitely provide claude uninstall but we also want to be good homebrew citizens and observe the local customs, so happy to take some input if you want to give it.

  22. nihaals commented on Jul 19, 2025

    @nihaals

    A Homebrew cask has now been added (Homebrew/homebrew-cask#219994, brew.sh).

  23. xshapira commented on Jul 19, 2025

    @xshapira

    A Homebrew cask has now been added (Homebrew/homebrew-cask#219994, brew.sh).

    @nihaals Works like a charm! Thank you 💪

  24. mieubrisse commented on Jul 21, 2025

    @mieubrisse

    Working for me too! Thanks everyone; you guys are awesome 🥳

  25. github-actions commented on Jul 29, 2025

    @github-actions

    This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

  26. locked as resolved and limited conversation to collaborators on Jul 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions