feat: initial infra repo
- docker-services: 14 generic compose templates (portainer, npm, vaultwarden, gitea, jotty, nextcloud-aio, rustdesk, audiobookshelf, calibre-web, plex, erugo, jswiki, speedtest, watchtower) - install-scripts: bash scripts for Ubuntu server bootstrap, docker, portainer, npm, backup, restore - ansible: 4 playbooks (bootstrap, deploy-services, update-services, security-hardening) + roles skeleton - hermes-install: Hermes CLI setup on macOS - macos-setup: Brewfile + osx-defaults + fish-config - home-nas-tools: metadata index for NAS projects (no binaries) - docs: architecture, security, contributing - README, LICENSE (MIT), .gitignore
This commit is contained in:
@@ -0,0 +1,111 @@
|
||||
# 🤖 Hermes Install
|
||||
|
||||
> Instalace a konfigurace **Hermes Agent** (AI asistent) na macOS.
|
||||
|
||||
## 📦 Obsah
|
||||
|
||||
| Soubor | Účel |
|
||||
|---|---|
|
||||
| [`install-hermes.sh`](install-hermes.sh) | Instaluje Hermes CLI |
|
||||
| [`configure-hermes.sh`](configure-hermes.sh) | Nastaví API klíče, pracovní adresáře, profily |
|
||||
| [`hermes-config.example.yml`](hermes-config.example.yml) | Ukázková konfigurace |
|
||||
| [`README.md`](README.md) | Tento soubor |
|
||||
|
||||
## 🤖 Co je Hermes?
|
||||
|
||||
Hermes je **AI asistent** (Claude/GPT) integrovaný v terminálu. Umí:
|
||||
|
||||
- Spravovat soubory, Git, Docker
|
||||
- Spouštět skripty (sandbox)
|
||||
- Plánovat a provádět multi-step úkoly
|
||||
- Učit se z paměti
|
||||
- Integrovat se schránkou, poštou, kalendářem
|
||||
|
||||
## 🚀 Quickstart
|
||||
|
||||
```bash
|
||||
# 1. Instalace
|
||||
curl -fsSL https://hermes-agent.dev/install.sh | bash
|
||||
# Nebo:
|
||||
bash install-hermes.sh
|
||||
|
||||
# 2. Konfigurace (API klíč)
|
||||
bash configure-hermes.sh
|
||||
# nebo ručně:
|
||||
hermes config set api-key <tvuj-api-klic>
|
||||
hermes config set model claude-sonnet-4.5
|
||||
|
||||
# 3. Test
|
||||
hermes --version
|
||||
hermes chat "Ahoj, kdo jsi?"
|
||||
|
||||
# 4. Přidání Fish aliasu (volitelně)
|
||||
hermes config alias
|
||||
```
|
||||
|
||||
## ⚙️ Konfigurace
|
||||
|
||||
`hermes-config.example.yml` obsahuje:
|
||||
|
||||
```yaml
|
||||
# API provider
|
||||
provider: anthropic
|
||||
model: claude-sonnet-4.5
|
||||
api_key: ${HERMES_API_KEY}
|
||||
|
||||
# Pracovní adresáře
|
||||
workspace: ~/Skripty
|
||||
memory_dir: ~/.hermes/memory
|
||||
|
||||
# Sandbox: povolené příkazy
|
||||
sandbox:
|
||||
allow:
|
||||
- "ls"
|
||||
- "cat"
|
||||
- "git"
|
||||
- "docker"
|
||||
- "kubectl"
|
||||
deny:
|
||||
- "rm -rf /"
|
||||
- "dd if="
|
||||
```
|
||||
|
||||
## 🔐 Bezpečnost
|
||||
|
||||
- **Sandbox** – Hermes ve výchozím stavu **nesmaže** `rm -rf /` ani podobné destruktivní příkazy
|
||||
- **API klíč** – ulož do **macOS keychainu**, ne do konfiguráku
|
||||
- **Audit log** – `hermes log show` ukáže historii příkazů
|
||||
- **Permissions** – nastav na minimum potřebné
|
||||
|
||||
## 🧠 Memory a kontext
|
||||
|
||||
Hermes si pamatuje:
|
||||
|
||||
- Tvoje preference a workflow
|
||||
- Kontext projektů (~/Skripty, ~/git-repos, …)
|
||||
- Dřívější konverzace
|
||||
|
||||
Reset:
|
||||
```bash
|
||||
hermes memory reset
|
||||
hermes memory show
|
||||
```
|
||||
|
||||
## 🔌 Integrace
|
||||
|
||||
- **Gitea** – push/pull, správa issues
|
||||
- **Docker** – compose, logs, restart
|
||||
- **Git** – všechny git operace
|
||||
- **Fish shell** – aliasy
|
||||
- **macOS** – clipboard, notifications
|
||||
|
||||
## 📚 Dokumentace
|
||||
|
||||
- [Hermes docs](https://hermes-agent.nousresearch.com/docs)
|
||||
- [Hermes GitHub](https://github.com/NousResearch/hermes-agent)
|
||||
|
||||
## 🆘 Support
|
||||
|
||||
- **Issues:** [github.com/NousResearch/hermes-agent/issues](https://github.com/NousResearch/hermes-agent/issues)
|
||||
- **Discord:** [discord.gg/hermes](https://discord.gg/hermes)
|
||||
- **Email:** support@hermes-agent.dev
|
||||
@@ -0,0 +1,115 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Konfigurace Hermes Agent
|
||||
# - nastaví API klíč (z keychainu)
|
||||
# - vytvoří výchozí ~/.config/hermes/config.yml
|
||||
# - nastaví pracovní adresáře
|
||||
#
|
||||
set -euo pipefail
|
||||
|
||||
HERMES_CONFIG_DIR="$HOME/.config/hermes"
|
||||
HERMES_CONFIG="$HERMES_CONFIG_DIR/config.yml"
|
||||
HERMES_MEMORY="$HOME/.hermes/memory"
|
||||
|
||||
# API klíč z keychainu
|
||||
echo "▶ Hledám API klíč v keychainu (služba: hermes:api)..."
|
||||
API_KEY=$(security find-generic-password -s "hermes:api" -a "user" -w 2>/dev/null || true)
|
||||
|
||||
if [[ -z "$API_KEY" ]]; then
|
||||
echo "⚠ API klíč není v keychainu."
|
||||
read -rp "Vlož API klíč (nebo Enter pro přeskočení): " API_KEY
|
||||
if [[ -n "$API_KEY" ]]; then
|
||||
security add-generic-password -s "hermes:api" -a "user" -w "$API_KEY" -U
|
||||
echo "✓ API klíč uložen do keychainu"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Vytvoř config adresář
|
||||
mkdir -p "$HERMES_CONFIG_DIR" "$HERMES_MEMORY"
|
||||
|
||||
# Výchozí config
|
||||
cat > "$HERMES_CONFIG" <<EOF
|
||||
# Hermes configuration
|
||||
# Generováno configure-hermes.sh – $(date +%Y-%m-%d)
|
||||
|
||||
provider: anthropic
|
||||
model: claude-sonnet-4.5
|
||||
api_key: \${HERMES_API_KEY} # čte z env, fallback: security find-generic-password
|
||||
|
||||
# Pracovní adresáře
|
||||
workspace: ~/Skripty
|
||||
memory_dir: $HERMES_MEMORY
|
||||
|
||||
# Sandbox
|
||||
sandbox:
|
||||
enabled: true
|
||||
allow:
|
||||
- "ls"
|
||||
- "cat"
|
||||
- "grep"
|
||||
- "find"
|
||||
- "git"
|
||||
- "docker"
|
||||
- "docker compose"
|
||||
- "kubectl"
|
||||
- "ssh"
|
||||
- "scp"
|
||||
- "rsync"
|
||||
- "curl"
|
||||
- "jq"
|
||||
deny:
|
||||
- "rm -rf /"
|
||||
- "rm -rf /*"
|
||||
- "dd if="
|
||||
- "mkfs"
|
||||
- ":(){:|:&};:"
|
||||
|
||||
# Integrace
|
||||
integrations:
|
||||
gitea:
|
||||
url: http://192.168.0.148:3000
|
||||
token_name: hermes:api:192.168.0.148
|
||||
docker:
|
||||
socket: /var/run/docker.sock
|
||||
git:
|
||||
user_name: "Hermes Agent"
|
||||
user_email: "hermes@localhost"
|
||||
|
||||
# Output
|
||||
output:
|
||||
format: markdown
|
||||
streaming: true
|
||||
language: cs
|
||||
|
||||
# UI
|
||||
ui:
|
||||
theme: dark
|
||||
icons: emoji
|
||||
EOF
|
||||
|
||||
# Environment v shellu
|
||||
SHELL_RC="$HOME/.zshrc"
|
||||
if ! grep -q "HERMES_API_KEY" "$SHELL_RC" 2>/dev/null; then
|
||||
cat >> "$SHELL_RC" <<'EOF'
|
||||
|
||||
# Hermes Agent API key (načítá z keychainu)
|
||||
export HERMES_API_KEY=$(security find-generic-password -s "hermes:api" -a "user" -w 2>/dev/null)
|
||||
EOF
|
||||
echo "✓ ~/.zshrc aktualizován"
|
||||
fi
|
||||
|
||||
# Fish varianta
|
||||
FISH_CONFIG="$HOME/.config/fish/config.fish"
|
||||
if [[ -f "$FISH_CONFIG" ]] && ! grep -q "HERMES_API_KEY" "$FISH_CONFIG" 2>/dev/null; then
|
||||
cat >> "$FISH_CONFIG" <<'EOF'
|
||||
|
||||
# Hermes Agent API key
|
||||
set -gx HERMES_API_KEY (security find-generic-password -s "hermes:api" -a "user" -w 2>/dev/null)
|
||||
EOF
|
||||
echo "✓ Fish config aktualizován"
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "🎉 Hermes nakonfigurován!"
|
||||
echo
|
||||
echo "Test: hermes chat \"Ahoj\""
|
||||
@@ -0,0 +1,69 @@
|
||||
# Hermes Agent – ukázková konfigurace
|
||||
# Zkopíruj na ~/.config/hermes/config.yml a doplň
|
||||
|
||||
# AI provider a model
|
||||
provider: anthropic
|
||||
model: claude-sonnet-4.5
|
||||
api_key: ${HERMES_API_KEY}
|
||||
|
||||
# Pracovní adresáře
|
||||
workspace: ~/Skripty
|
||||
memory_dir: ~/.hermes/memory
|
||||
projects_dir: ~/git-repos
|
||||
|
||||
# Sandbox – bezpečnostní omezení
|
||||
sandbox:
|
||||
enabled: true
|
||||
allow:
|
||||
- "ls"
|
||||
- "cat"
|
||||
- "grep"
|
||||
- "find"
|
||||
- "git"
|
||||
- "docker"
|
||||
- "docker compose"
|
||||
- "kubectl"
|
||||
- "ssh"
|
||||
- "scp"
|
||||
- "rsync"
|
||||
- "curl"
|
||||
- "jq"
|
||||
deny:
|
||||
- "rm -rf /"
|
||||
- "rm -rf /*"
|
||||
- "dd if="
|
||||
- "mkfs"
|
||||
|
||||
# Integrace s existujícími službami
|
||||
integrations:
|
||||
gitea:
|
||||
url: http://CHANGE_ME:3000
|
||||
token_name: "gitea:api:CHANGE_ME"
|
||||
docker:
|
||||
socket: /var/run/docker.sock
|
||||
ssh:
|
||||
default_user: deploy
|
||||
default_key: ~/.ssh/id_ed25519
|
||||
|
||||
# Výstup
|
||||
output:
|
||||
format: markdown
|
||||
streaming: true
|
||||
language: cs
|
||||
color: true
|
||||
|
||||
# UI
|
||||
ui:
|
||||
theme: dark
|
||||
icons: emoji
|
||||
spinner: dots
|
||||
|
||||
# Bezpečnost
|
||||
security:
|
||||
audit_log: true
|
||||
require_approval_for:
|
||||
- "rm"
|
||||
- "docker system prune"
|
||||
- "kubectl delete"
|
||||
- "git push --force"
|
||||
api_key_storage: keychain # macOS keychain
|
||||
@@ -0,0 +1,65 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Instalace Hermes Agent na macOS
|
||||
# - vyžaduje Homebrew a Fish shell
|
||||
# - nainstaluje Hermes CLI
|
||||
# - přidá 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 (přes pip)
|
||||
echo "▶ Instaluji Hermes přes pip..."
|
||||
python3 -m pip install --user hermes-agent
|
||||
|
||||
# Přidání do PATH (pokud není)
|
||||
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
|
||||
|
||||
# Ověření
|
||||
if command -v hermes &>/dev/null; then
|
||||
echo "✓ Hermes nainstalován: $(hermes --version)"
|
||||
else
|
||||
echo "⚠ Hermes není v PATH. Přidej ručně: 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 přidány"
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "🎉 Hotovo! Nastav API klíč:"
|
||||
echo " security add-generic-password -s hermes:api -a user -w <klíč> -U"
|
||||
echo " hermes config set api-key <klíč>"
|
||||
Reference in New Issue
Block a user