diff --git a/HomebrewFormula/clive.rb b/HomebrewFormula/clive.rb new file mode 100644 index 0000000..5737f0d --- /dev/null +++ b/HomebrewFormula/clive.rb @@ -0,0 +1,34 @@ +class Clive < Formula + desc "macOS menu bar app that displays Claude Code usage statistics at a glance" + homepage "https://github.com/StuartCameronCode/clive" + url "https://github.com/StuartCameronCode/clive/releases/download/v1.0.6/Clive-1.0.6.zip" + version "1.0.6" + sha256 "9d70de26bd1930ee118515de97c035f73a69027ea26f0418344686e2340a2266" + + depends_on :macos + + def install + prefix.install "Clive.app" + end + + def caveats + <<~EOS + Clive has been installed to: + #{prefix}/Clive.app + + To use Clive, you can either: + 1. Open it directly: open #{prefix}/Clive.app + 2. Create a symlink to /Applications: + ln -s #{prefix}/Clive.app /Applications/Clive.app + + Note: Clive requires the Claude Code CLI to be installed at: + /opt/homebrew/bin/claude + + You can add Clive to Login Items in System Settings to start it automatically. + EOS + end + + test do + assert_predicate prefix/"Clive.app/Contents/MacOS/clive", :exist? + end +end diff --git a/README.md b/README.md index ef8c267..90d9f7d 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,28 @@ Clive is just a hobby project and the releases are unsigned. You've got two opti 3. Build and run (⌘R) 4. Optionally, add to Login Items for auto-start +### 3. Install via Homebrew +```bash +brew install https://raw.githubusercontent.com/StuartCameronCode/clive/main/HomebrewFormula/clive.rb +``` + +After installation, you can open Clive with: +```bash +open $(brew --prefix)/Clive.app +``` + +Or create a symlink to Applications: +```bash +ln -s $(brew --prefix)/Clive.app /Applications/Clive.app +``` + +To upgrade to a newer version: +```bash +brew upgrade clive +``` + +> **Note:** Once you create the symlink, it automatically points to the latest version after upgrades—no need to recreate it. + ## Usage Once running, Clive appears in your menu bar showing your Claude Code usage. Click the icon to see: diff --git a/update_clive_sha256.sh b/update_clive_sha256.sh new file mode 100644 index 0000000..223dcb3 --- /dev/null +++ b/update_clive_sha256.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +# Script to update clive.rb Homebrew formula with new version and SHA256 hash +# Usage: ./update_clive_sha256.sh + +set -e + +if [ $# -eq 0 ]; then + echo "Error: Version argument required" + echo "Usage: $0 " + echo "Example: $0 1.0.6" + exit 1 +fi + +VERSION="$1" +FORMULA_FILE="HomebrewFormula/clive.rb" +GITHUB_URL="https://github.com/StuartCameronCode/clive/releases/download/v${VERSION}/Clive-${VERSION}.zip" + +echo "Calculating SHA256 for version ${VERSION}..." +SHA256=$(curl -sL "${GITHUB_URL}" | shasum -a 256 | awk '{print $1}') + +if [ -z "$SHA256" ]; then + echo "Error: Failed to calculate SHA256. Please verify the version exists." + exit 1 +fi + +echo "SHA256: ${SHA256}" +echo "Updating ${FORMULA_FILE}..." + +# Update version +sed -i '' "s/version \".*\"/version \"${VERSION}\"/" "${FORMULA_FILE}" + +# Update URL +sed -i '' "s|url \".*\"|url \"${GITHUB_URL}\"|" "${FORMULA_FILE}" + +# Update SHA256 +sed -i '' "s/sha256 \".*\"/sha256 \"${SHA256}\"/" "${FORMULA_FILE}" + +echo "Successfully updated ${FORMULA_FILE} with version ${VERSION} and SHA256 ${SHA256}" +