#! /usr/bin/env bash

# Installs Homebrew formulas (CLI tools).

set -o nounset
set -o errexit
set -o pipefail
IFS=$'\n\t'

# Ensure Homebrew is installed
install_homebrew

# Shell & Terminal
brew install atuin
brew install bash
brew install bash-completion
brew install pinentry-mac
brew tap artginzburg/tap
brew install artginzburg/tap/sudo-touchid
brew tap domt4/autoupdate

# AI
brew install gemini-cli
brew install opencode

# Media
brew install ffmpeg

# Utilities
brew install mas
brew install mole
brew install rename
brew install ykman

# Configure automatic updates
printf "\n🔧 Configuring automatic Homebrew updates...\n"
mkdir -p ~/Library/LaunchAgents
brew autoupdate start 43200 --upgrade --cleanup --immediate --sudo 2>/dev/null || printf "⚠️  Failed to configure brew autoupdate\n"

printf "\n✅ Homebrew Formulas installation complete!\n"
