Skip to content
Merged
27 changes: 27 additions & 0 deletions homebrew-scripts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Homebrew Scripts

Opinionated but safe Homebrew automation scripts for macOS.

These scripts wrap common Homebrew operations into repeatable,
readable shell commands.

## Included scripts

| Script | Purpose |
|------|--------|
| update-brew.sh | Update Homebrew and upgrade all packages |
| check-outdated.sh | Show outdated formulae |
| cleanup-brew.sh | Remove old versions and unused deps |
| install-common-tools.sh | Install common dev tools |
| install-languages.sh | Install additional languages |
| install-utilities.sh | Install CLI utilities |
| minimal-install.sh | Minimal example (Git only) |

## Running

```bash
chmod +x *.sh
./update-brew.sh
```

Homebrew must be installed beforehand.
11 changes: 11 additions & 0 deletions homebrew-scripts/check-outdated.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

# Safe Homebrew check script
# Lists outdated packages

set -e

echo "Checking for outdated Homebrew packages..."
brew outdated

echo "Check completed. Run update-brew.sh to upgrade."
16 changes: 16 additions & 0 deletions homebrew-scripts/cleanup-brew.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

# Safe Homebrew cleanup script
# Removes old versions and unused dependencies

set -e

echo "Cleaning up Homebrew..."

# Remove old versions of formulae
brew cleanup

# Remove formulae that are no longer needed
brew autoremove

echo "Homebrew cleanup completed successfully."
29 changes: 29 additions & 0 deletions homebrew-scripts/install-common-tools.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

# Safe Homebrew install script for common development tools
# Installs frequently used packages for development

set -e

echo "Installing common development tools via Homebrew..."

# Version control
brew install git

# Programming languages and runtimes
brew install python@3.12
brew install node
brew install rust
brew install go

# Package managers and tools
brew install npm
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Installing npm separately when Node.js already includes it will cause conflicts. When brew install node is executed on line 15, npm is bundled with Node.js. Installing npm again on line 20 creates a duplicate installation that can lead to version mismatches, PATH conflicts, and unpredictable behavior where commands may use the wrong npm version.

Fix: Remove line 20 entirely:

# Remove this line:
brew install npm

Node.js installation already provides npm, so this separate installation is both redundant and problematic.

Spotted by Graphite Agent

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

brew install yarn

# Development utilities
brew install jq
brew install tree
brew install wget

echo "Common development tools installed successfully."
echo "Note: Python is installed as python@3.12. Use 'python3' to run it."
15 changes: 15 additions & 0 deletions homebrew-scripts/install-languages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

# Safe Homebrew install script for programming languages
# Installs additional programming languages and runtimes

set -e

echo "Installing additional programming languages via Homebrew..."

brew install ruby
brew install php
brew install lua
brew install perl

echo "Additional programming languages installed successfully."
17 changes: 17 additions & 0 deletions homebrew-scripts/install-utilities.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

# Safe Homebrew install script for common utilities
# Installs useful command-line utilities

set -e

echo "Installing common utilities via Homebrew..."

brew install htop
brew install tmux
brew install vim
brew install neovim
brew install curl
brew install git-lfs

echo "Common utilities installed successfully."
17 changes: 17 additions & 0 deletions homebrew-scripts/minimal-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

# Minimal Homebrew Install Script
# This script demonstrates a basic, safe Homebrew installation example.
# It installs only the essential Git version control system, which is fundamental for development workflows.
# Unlike the other scripts that install multiple packages, this focuses on a single, core tool to illustrate minimal dependency management.
# In software engineering, minimalism in tooling reduces complexity, potential conflicts, and maintenance overhead.
# By starting with Git, this script ensures version control is available before adding more tools, following the principle of progressive enhancement.
# Reference: Homebrew's philosophy emphasizes simplicity and safety, aligning with this minimal approach to avoid overwhelming new users.
# This prevents "bandwidth noise" by providing a focused, educational example rather than a bloated installation.

set -e

echo "Installing minimal essential tool: Git"
brew install git

echo "Minimal installation completed. Git is now available for version control."
14 changes: 14 additions & 0 deletions homebrew-scripts/update-brew.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

# Safe Homebrew update script
# Updates Homebrew formulae and upgrades installed packages

set -e

echo "Updating Homebrew..."
brew update

echo "Upgrading installed packages..."
brew upgrade

echo "Homebrew update and upgrade completed successfully."