Files
mates-macos-setup/install-hermes.sh
T
mates 4340cb3b2a init: clean history with no PII
Toto repo ma novou cistou historii (1 commit). Predchozi historie
byla smazana, protoze obsahovala osobni udaje (IP, emaily, hesla,
klice, tokeny, Volume cesty). Soubory v aktualnim commit uz tyto
udaje neobsahuji (nahradeno placeholdery <server-ip>, CHANGE_ME,
admin@example.com atd.).

Pokud chces zpet kompletni seznam starych commitu, mas je ve svem
lokalnim working tree - git log --all ukaze prazdno (protoze jsme
smazali .git/ a zacali znovu).
2026-08-01 19:51:59 +02:00

66 lines
1.6 KiB
Bash

#!/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 <<EOF
export PATH="\$HOME/Library/Python/3.9/bin:\$PATH"
EOF
export PATH="$PIP_BIN:$PATH"
fi
# Overeni
if command -v hermes &>/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 <klic> -U"
echo " hermes config set api-key <klic>"