Skip to content

Enhancement: Add Homebrew install option #2

Closed

Description

@fettpl

As initially discussed via Reddit, I propose the addition of Homebrew as install method.

Numerous CLI coding tools support it and it would be great to have such an option to keep nanocoder up to date easily.

Activity

  1. added
    enhancement
    on Aug 15, 2025
  2. will-lamerton commented on Aug 16, 2025

    @will-lamerton
    Member

    Homebrew Installation Specification

    Overview

    Add official Homebrew support for nanocoder to provide a standardized installation and update mechanism for macOS and Linux users.

    Implementation Approach

    Include the Homebrew formula directly in the main repository:

    • Location: Formula/nanocoder.rb in main repo
    • Installation: brew install Nano-Collective/nanocoder/nanocoder
    • Benefits: Single repository to maintain, simpler workflow, automated updates with releases

    Technical Requirements

    Formula Specification

    class Nanocoder < Formula
      desc "Local-first AI coding agent with multi-provider support"
      homepage "https://github.com/Nano-Collective/nanocoder"
      url "https://github.com/Nano-Collective/nanocoder/archive/v#{version}.tar.gz"
      sha256 "..." # Auto-generated for each release
      license "MIT" # Confirm license
    
      depends_on "node@18" => :build
      depends_on "npm" => :build
    
      def install
        system "npm", "install"
        system "npm", "run", "build"
        libexec.install Dir["*"]
        bin.install_symlink libexec/"dist/index.js" => "nanocoder"
      end
    
      test do
        assert_match version.to_s, shell_output("#{bin}/nanocoder --version")
      end
    end

    Repository Structure

    nanocoder/
    ├── Formula/
    │   └── nanocoder.rb
    ├── .github/
    │   └── workflows/
    │       ├── release.yml (existing)
    │       └── update-formula.yml (new)
    └── ... (existing project files)
    

    Automated Updates

    Add to existing release workflow or create new workflow:

    name: Update Homebrew Formula
    on:
      release:
        types: [published]
    jobs:
      update-formula:
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v4
          - name: Update formula version and SHA
            run: |
              VERSION=${GITHUB_REF#refs/tags/v}
              SHA=$(curl -s "https://api.github.com/repos/Nano-Collective/nanocoder/tarball/v${VERSION}" | sha256sum | cut -d' ' -f1)
              sed -i "s/version \".*\"/version \"${VERSION}\"/" Formula/nanocoder.rb
              sed -i "s/sha256 \".*\"/sha256 \"${SHA}\"/" Formula/nanocoder.rb
          - name: Commit formula update
            run: |
              git config --local user.email "[email protected]"
              git config --local user.name "GitHub Action"
              git add Formula/nanocoder.rb
              git commit -m "Update Homebrew formula to v${VERSION}"
              git push

    User Experience

    Installation

    # Direct install from main repo
    brew install Nano-Collective/nanocoder/nanocoder

    Updates

    # Update to latest version
    brew upgrade nanocoder
    
    # Update all packages
    brew upgrade

    Uninstallation

    brew uninstall nanocoder

    Documentation Updates

    README.md

    Add Homebrew installation section:

    ## Installation
    
    ### Homebrew (macOS/Linux)
    
    ```bash
    brew install Nano-Collective/nanocoder/nanocoder
    ```

    npm (All platforms)

    npm install -g nanocoder

    Documentation

    • Add Homebrew as primary installation method for macOS users
    • Include troubleshooting section for common Homebrew issues
    • Document version compatibility requirements

    Testing Strategy

    Local Testing

    # Test formula locally
    brew install --build-from-source ./Formula/nanocoder.rb
    brew test nanocoder
    brew audit --strict ./Formula/nanocoder.rb

    CI Testing

    • Test installation on multiple macOS versions
    • Verify binary works after installation
    • Test upgrade path from previous versions

    Maintenance Considerations

    Formula Updates

    • Automatically triggered by new GitHub releases
    • Manual updates for dependency changes
    • Version compatibility testing

    Support Channels

    • Add Homebrew-specific troubleshooting to documentation
    • Monitor Homebrew-related issues in GitHub
    • Provide clear error messages for common installation failures
  3. will-lamerton commented on Sep 9, 2025

    @will-lamerton
    Member

    @fettpl has offered to take this on 👌🏼

  4. spinualexandru commented on Oct 6, 2025

    @spinualexandru
    Collaborator

    @fettpl - You still up for it or should we hop on it?

  5. will-lamerton commented on Oct 7, 2025

    @will-lamerton
    Member

    Hey @spinualexandru - @fettpl dips in and out, we can take this on I think.

  6. will-lamerton commented on Nov 5, 2025

    @will-lamerton
    Member

    In progress :)

  7. will-lamerton commented on Nov 6, 2025

    @will-lamerton
    Member

    On the main branch - waiting to be bundled with the next release. Will close once done :)

  8. will-lamerton commented on Nov 6, 2025

    @will-lamerton
    Member

    Finally - this is now in Release 1.15.0 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions