#!/usr/bin/env bash # # Instalace Hermes Agent na macOS # - vyzaduje Homebrew a Fish shell # - nainstaluje Hermes CLI # - prida aliasy do Fish # set -euo pipefail if [[ "$(uname)" != "Darwin" ]]; then echo "Tento skript je pouze pro macOS" >&2 exit 1 fi # Kontrola Homebrew if ! command -v brew &>/dev/null; then echo "Instaluji Homebrew..." /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" fi # Kontrola Fish if ! command -v fish &>/dev/null; then echo "Instaluji Fish..." brew install fish fi # Instalace Hermes (pres pip) echo "Instaluji Hermes pres pip..." python3 -m pip install --user hermes-agent # Pridej do PATH (pokud neni) PIP_BIN="$HOME/Library/Python/3.9/bin" if [[ -d "$PIP_BIN" ]] && [[ ":$PATH:" != *":$PIP_BIN:"* ]]; then cat >> ~/.zshrc </dev/null; then echo "Hermes nainstalovan: $(hermes --version)" else echo "Hermes neni v PATH. Pridej rucne: export PATH=\"\$HOME/Library/Python/3.9/bin:\$PATH\"" fi # Fish alias FISH_CONFIG="$HOME/.config/fish/config.fish" mkdir -p "$(dirname "$FISH_CONFIG")" if ! grep -q "alias hermes=" "$FISH_CONFIG" 2>/dev/null; then cat >> "$FISH_CONFIG" <<'EOF' # Hermes Agent alias h='hermes' alias hchat='hermes chat' alias hgit='hermes git' alias hd='hermes docker' EOF echo "Fish aliasy pridany" fi echo echo "Hotovo! Nastav API klic:" echo " security add-generic-password -s hermes:api -a user -w -U" echo " hermes config set api-key "