Merge pull request 'bootstrap: Voraussetzungen automatisch prüfen und installieren' (#3) from feat/bootstrap-prereq-autoinstall into main
bootstrap: Voraussetzungen automatisch prüfen und installieren
This commit was merged in pull request #3.
This commit is contained in:
+89
-4
@@ -24,6 +24,8 @@ echo "✓ Agents verlinkt"
|
||||
ln -sf "$REPO/dotfiles/CLAUDE.md" ~/.claude/CLAUDE.md
|
||||
ln -sf "$REPO/dotfiles/settings.json" ~/.claude/settings.json
|
||||
ln -sf "$REPO/dotfiles/statusline-command.sh" ~/.claude/statusline-command.sh
|
||||
ln -sf "$REPO/dotfiles/gitea-mcp-wrapper.sh" ~/.claude/gitea-mcp-wrapper.sh
|
||||
chmod +x "$REPO/dotfiles/gitea-mcp-wrapper.sh"
|
||||
echo "✓ Dotfiles verlinkt"
|
||||
|
||||
# Hooks ausführbar machen
|
||||
@@ -31,7 +33,90 @@ chmod +x "$REPO/hooks/"*.sh
|
||||
echo "✓ Hooks ausführbar"
|
||||
|
||||
echo ""
|
||||
echo "Setup abgeschlossen. Voraussetzungen prüfen:"
|
||||
echo " - secret-tool: secret-tool lookup user claude-code token gitea"
|
||||
echo " - ruff: ruff --version"
|
||||
echo " - jq: jq --version"
|
||||
echo "=== Voraussetzungen prüfen ==="
|
||||
|
||||
# --- gh (GitHub CLI, wird auch für Gitea-PRs genutzt) ---
|
||||
if command -v gh &>/dev/null; then
|
||||
echo "✓ gh $(gh --version | head -1)"
|
||||
else
|
||||
echo " gh fehlt – installiere via apt..."
|
||||
sudo apt-get install -y gh
|
||||
echo "✓ gh installiert"
|
||||
fi
|
||||
|
||||
# --- jq ---
|
||||
if command -v jq &>/dev/null; then
|
||||
echo "✓ jq $(jq --version)"
|
||||
else
|
||||
echo " jq fehlt – installiere via apt..."
|
||||
sudo apt-get install -y jq
|
||||
echo "✓ jq installiert"
|
||||
fi
|
||||
|
||||
# --- ruff ---
|
||||
if command -v ruff &>/dev/null; then
|
||||
echo "✓ ruff $(ruff --version)"
|
||||
else
|
||||
echo " ruff fehlt – installiere via pipx..."
|
||||
if ! command -v pipx &>/dev/null; then
|
||||
sudo apt-get install -y pipx
|
||||
pipx ensurepath
|
||||
fi
|
||||
pipx install ruff
|
||||
echo "✓ ruff installiert"
|
||||
fi
|
||||
|
||||
# --- gitea-mcp Binary ---
|
||||
if [[ -x ~/go/bin/gitea-mcp ]]; then
|
||||
echo "✓ gitea-mcp vorhanden"
|
||||
else
|
||||
echo " gitea-mcp fehlt – installiere via go install..."
|
||||
go install gitea.com/gitea/gitea-mcp@latest
|
||||
echo "✓ gitea-mcp installiert"
|
||||
fi
|
||||
|
||||
# --- context7 Plugin-Check ---
|
||||
if claude mcp list 2>/dev/null | grep -q "context7"; then
|
||||
echo "✓ context7 Plugin aktiv"
|
||||
else
|
||||
echo "⚠ context7 Plugin nicht aktiv – prüfe enabledPlugins in settings.json"
|
||||
echo " Ggf. Claude Code neu starten oder Plugin manuell aktivieren."
|
||||
fi
|
||||
|
||||
# --- gitea-mcp in Claude Code registrieren ---
|
||||
if claude mcp list 2>/dev/null | grep -q "^gitea:"; then
|
||||
echo "✓ gitea MCP bereits registriert"
|
||||
else
|
||||
echo " Registriere gitea MCP..."
|
||||
claude mcp add --scope user gitea -- bash ~/.claude/gitea-mcp-wrapper.sh
|
||||
echo "✓ gitea MCP registriert"
|
||||
fi
|
||||
|
||||
# --- secret-tool + Gitea-Token ---
|
||||
if ! command -v secret-tool &>/dev/null; then
|
||||
echo " secret-tool fehlt – installiere libsecret-tools..."
|
||||
sudo apt-get install -y libsecret-tools
|
||||
echo "✓ secret-tool installiert"
|
||||
else
|
||||
echo "✓ secret-tool vorhanden"
|
||||
fi
|
||||
|
||||
echo " Gitea-Token prüfen..."
|
||||
if secret-tool lookup user claude-code token gitea &>/dev/null; then
|
||||
echo "✓ Gitea-Token vorhanden"
|
||||
else
|
||||
echo ""
|
||||
echo " Gitea-Token für claude-code nicht gefunden."
|
||||
read -r -p " Gitea-Token eingeben (https://gitea.troeger-net.org): " GITEA_TOKEN
|
||||
if [[ -n "${GITEA_TOKEN// /}" ]]; then
|
||||
echo -n "$GITEA_TOKEN" | secret-tool store \
|
||||
--label="Gitea claude-code token" \
|
||||
user claude-code token gitea
|
||||
echo "✓ Gitea-Token gespeichert"
|
||||
else
|
||||
echo "⚠ Kein Token eingegeben – übersprungen"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "✓ Bootstrap abgeschlossen"
|
||||
|
||||
@@ -39,6 +39,14 @@ PRs muessen jedes Akzeptanzkriterium einzeln als Checkbox auflisten und bestaeti
|
||||
|
||||
Niemals direkt auf `main` committen. Alle Aenderungen ueber Feature-Branches und PRs.
|
||||
|
||||
## Fehlende Tools
|
||||
|
||||
Wenn ein benötigtes CLI-Tool fehlt: **nicht** mit Workarounds (curl, rohe API-Calls) umgehen. Stattdessen:
|
||||
|
||||
1. User informieren welches Tool fehlt und den Installations-Befehl nennen
|
||||
2. User führt den Befehl in einer separaten Konsole aus (sudo funktioniert dort)
|
||||
3. Tool danach in `bootstrap.sh` aufnehmen, damit es auf allen Maschinen automatisch installiert wird
|
||||
|
||||
## Gitea-Integration
|
||||
|
||||
Instanz: `https://gitea.troeger-net.org`. Bot-User `claude-code`, Token: `GITEA_TOKEN=$(secret-tool lookup user claude-code token gitea)`. Bot hat nur Collaborator-Rechte.
|
||||
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
exec env GITEA_ACCESS_TOKEN="$(secret-tool lookup user claude-code token gitea)" \
|
||||
~/go/bin/gitea-mcp -host https://gitea.troeger-net.org
|
||||
+47
-47
@@ -1,50 +1,50 @@
|
||||
{
|
||||
"permissions": {
|
||||
"allow": [
|
||||
"Bash(npm run build:*)",
|
||||
"Bash(grep:*)",
|
||||
"Bash(xargs:*)",
|
||||
"WebSearch",
|
||||
"Bash(npm install)",
|
||||
"Bash(curl:*)",
|
||||
"Bash(ls:*)",
|
||||
"Bash(python3:*)"
|
||||
],
|
||||
"defaultMode": "default"
|
||||
},
|
||||
"statusLine": {
|
||||
"type": "command",
|
||||
"command": "bash ~/.claude/statusline-command.sh"
|
||||
},
|
||||
"enabledPlugins": {
|
||||
"typescript-lsp@claude-plugins-official": true,
|
||||
"frontend-design@claude-plugins-official": true,
|
||||
"context7@claude-plugins-official": true,
|
||||
"code-review@claude-plugins-official": true,
|
||||
"code-simplifier@claude-plugins-official": true
|
||||
},
|
||||
"language": "German",
|
||||
"hooks": {
|
||||
"PostToolUse": [
|
||||
{
|
||||
"matcher": "Edit|Write",
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "bash /mnt/projekte/claude-workflow/hooks/auto-format.sh"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"Stop": [
|
||||
{
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "bash /mnt/projekte/claude-workflow/hooks/verify-on-stop.sh"
|
||||
}
|
||||
]
|
||||
}
|
||||
"permissions": {
|
||||
"allow": [
|
||||
"Bash(npm run build:*)",
|
||||
"Bash(grep:*)",
|
||||
"Bash(xargs:*)",
|
||||
"WebSearch",
|
||||
"Bash(npm install)",
|
||||
"Bash(curl:*)",
|
||||
"Bash(ls:*)",
|
||||
"Bash(python3:*)"
|
||||
],
|
||||
"defaultMode": "default"
|
||||
},
|
||||
"hooks": {
|
||||
"PostToolUse": [
|
||||
{
|
||||
"matcher": "Edit|Write",
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "bash /mnt/projekte/claude-workflow/hooks/auto-format.sh"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"Stop": [
|
||||
{
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "bash /mnt/projekte/claude-workflow/hooks/verify-on-stop.sh"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"statusLine": {
|
||||
"type": "command",
|
||||
"command": "bash ~/.claude/statusline-command.sh"
|
||||
},
|
||||
"enabledPlugins": {
|
||||
"typescript-lsp@claude-plugins-official": true,
|
||||
"frontend-design@claude-plugins-official": true,
|
||||
"context7@claude-plugins-official": true,
|
||||
"code-review@claude-plugins-official": true,
|
||||
"code-simplifier@claude-plugins-official": true
|
||||
},
|
||||
"language": "German"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user