GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — secondbrain-setup/setup.sh at main · Vibecoder79/secondbrain-setup Expand file tree/ Copy pathsetup.shMore file actions executable file ·226 lines (190 loc) · 6.74 KB / Copy pathsetup.shFile metadata and controlsexecutable file ·226 lines (190 loc) · 6.74 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 #!/usr/bin/env bash # # SecondBrain Setup — interaktiver Setup-Helfer # # Was er tut: # 1. Fragt nach deinem Vault-Pfad # 2. Legt PARA-Ordner-Struktur an (idempotent) # 3. Kopiert Vault-Templates (CLAUDE.md, AGENTS.md, 00 Kontext) # 4. Optional: legt globale KI-Configs an (Claude Code, Gemini, Codex) # 5. Optional: installiert die drei Skills (projekt-init, lint, ingest) # # Was er NICHT tut: # - Etwas ueberschreiben ohne Nachfrage # - API-Keys konfigurieren # - Claude Desktop einrichten (manuell — siehe templates/claude-desktop/README.md) # - Obsidian installieren oder Plugins aktivieren # # Aufruf: # bash setup.sh # # Sicherheits-Hinweis: das Script schreibt nur in das Vault-Verzeichnis und # `~/.claude/`, `~/.gemini/`, `~/.codex/`. Es liest keine Secrets, schreibt keine # Secrets, sendet nichts ins Netz. set -euo pipefail REPO_DIR="$(cd "$(dirname "$0")" && pwd)" DEFAULT_VAULT="$HOME/Obsidian/SecondBrain" # Farben (nur wenn Terminal) if [[ -t 1 ]]; then BOLD='\033[1m' GREEN='\033[0;32m' YELLOW='\033[0;33m' BLUE='\033[0;34m' RESET='\033[0m' else BOLD='' GREEN='' YELLOW='' BLUE='' RESET='' fi info() { printf "${BLUE}→${RESET} %s\n" "$1"; } ok() { printf "${GREEN}✓${RESET} %s\n" "$1"; } warn() { printf "${YELLOW}⚠${RESET} %s\n" "$1"; } section() { printf "\n${BOLD}== %s ==${RESET}\n" "$1"; } ask_yes_no() { # ask_yes_no "Frage?" default(y|n) local prompt="$1" local default="${2:-n}" local hint if [[ "$default" == "y" ]]; then hint="[Y/n]" else hint="[y/N]" fi printf "%s %s " "$prompt" "$hint" read -r answer answer="${answer:-$default}" [[ "$answer" =~ ^[Yy]$ ]] } # === Schritt 1: Vault-Pfad === section "1. Vault-Pfad" printf "Wo soll dein SecondBrain-Vault liegen?\n" printf " Default: %s\n" "$DEFAULT_VAULT" printf " Eigener Pfad eingeben oder ENTER fuer Default: " read -r VAULT_INPUT VAULT_PATH="${VAULT_INPUT:-$DEFAULT_VAULT}" VAULT_PATH="${VAULT_PATH/#\~/$HOME}" # Tilde-Expansion info "Vault-Pfad: $VAULT_PATH" if [[ -d "$VAULT_PATH" ]]; then warn "Verzeichnis existiert bereits." if ! ask_yes_no "Im bestehenden Verzeichnis weiterarbeiten?" "y"; then info "Abbruch. Du kannst das Script jederzeit erneut starten." exit 0 fi fi mkdir -p "$VAULT_PATH" ok "Vault-Verzeichnis bereit: $VAULT_PATH" # === Schritt 2: PARA-Ordner === section "2. PARA-Ordnerstruktur" PARA_DIRS=( "00 Kontext/Workflows" "01 Inbox" "02 Projekte" "03 Bereiche/Skills" "04 Ressourcen/Research" "05 Daily Notes" "06 Archiv" "07 Anhaenge" ) for dir in "${PARA_DIRS[@]}"; do mkdir -p "$VAULT_PATH/$dir" done ok "PARA-Ordner angelegt (8 Stueck)" # === Schritt 3: Vault-Templates === section "3. Vault-Templates" copy_if_missing() { local src="$1" local dst="$2" if [[ -e "$dst" ]]; then warn "Existiert bereits — nicht ueberschrieben: $(basename "$dst")" else cp "$src" "$dst" ok "Kopiert: $(basename "$dst")" fi } # Pflicht: Vault-CLAUDE.md (Hub-Datei, Single Source of Truth) copy_if_missing "$REPO_DIR/templates/vault/CLAUDE.md" "$VAULT_PATH/CLAUDE.md" # 00 Kontext: Templates + Workflows mkdir -p "$VAULT_PATH/00 Kontext/Workflows" for f in "Projekt-Struktur.md" "Projekt-Struktur.en.md" "User-Story-Template.md" "User-Story-Template.en.md"; do if [[ -f "$REPO_DIR/templates/vault/00 Kontext/$f" ]]; then copy_if_missing "$REPO_DIR/templates/vault/00 Kontext/$f" "$VAULT_PATH/00 Kontext/$f" fi done if [[ -f "$REPO_DIR/templates/vault/00 Kontext/Workflows/Projekt-Anlegen.md" ]]; then copy_if_missing \ "$REPO_DIR/templates/vault/00 Kontext/Workflows/Projekt-Anlegen.md" \ "$VAULT_PATH/00 Kontext/Workflows/Projekt-Anlegen.md" fi # === Schritt 4: Codex-Spiegel (optional) === section "4. Codex-Spiegel im Vault (optional)" printf "Der Codex-Spiegel ist eine Variante der CLAUDE.md mit 'Codex'-Sprache.\n" printf "Nur sinnvoll wenn du Codex CLI nutzt.\n" if ask_yes_no "AGENTS.md im Vault-Wurzel anlegen?" "n"; then copy_if_missing "$REPO_DIR/templates/vault/AGENTS.md" "$VAULT_PATH/AGENTS.md" fi # === Schritt 5: Globale KI-Configs === section "5. Globale KI-Configs" # Claude Code if ask_yes_no "Claude Code Config (~/.claude/CLAUDE.md) anlegen?" "y"; then mkdir -p "$HOME/.claude" copy_if_missing "$REPO_DIR/templates/claude/CLAUDE.md" "$HOME/.claude/CLAUDE.md" fi # Gemini CLI if ask_yes_no "Gemini CLI Config (~/.gemini/GEMINI.md) anlegen?" "n"; then mkdir -p "$HOME/.gemini" copy_if_missing "$REPO_DIR/templates/gemini/GEMINI.md" "$HOME/.gemini/GEMINI.md" fi # Codex CLI if ask_yes_no "Codex CLI Config (~/.codex/AGENTS.md) anlegen?" "n"; then mkdir -p "$HOME/.codex" copy_if_missing "$REPO_DIR/templates/codex/AGENTS.md" "$HOME/.codex/AGENTS.md" fi # === Schritt 6: Skills installieren === section "6. Claude Code Skills (optional)" printf "Drei Skills sind verfuegbar: projekt-init, lint, ingest.\n" printf "Sie liegen unter ~/.claude/skills/ und werden von Claude Code automatisch geladen.\n" if ask_yes_no "Alle drei Skills installieren?" "y"; then mkdir -p "$HOME/.claude/skills" for skill in projekt-init lint ingest; do if [[ -d "$HOME/.claude/skills/$skill" ]]; then warn "Skill existiert bereits — nicht ueberschrieben: $skill" elif [[ -d "$REPO_DIR/skills/$skill" ]]; then cp -r "$REPO_DIR/skills/$skill" "$HOME/.claude/skills/" ok "Skill installiert: $skill" else warn "Skill nicht gefunden im Repo: $skill" fi done fi # === Schritt 7: Pfad-Hinweise === section "7. Abschluss & naechste Schritte" if [[ "$VAULT_PATH" != "$DEFAULT_VAULT" ]]; then warn "Du hast einen abweichenden Vault-Pfad gewaehlt." warn "Die kopierten Configs enthalten Default-Pfade (~/Obsidian/SecondBrain/)." warn "Pruefe und korrigiere die Pfade in den Configs:" echo " - $VAULT_PATH/CLAUDE.md" [[ -f "$HOME/.claude/CLAUDE.md" ]] && echo " - $HOME/.claude/CLAUDE.md" [[ -f "$HOME/.gemini/GEMINI.md" ]] && echo " - $HOME/.gemini/GEMINI.md" [[ -f "$HOME/.codex/AGENTS.md" ]] && echo " - $HOME/.codex/AGENTS.md" echo "" echo " Schnellfix (z.B. mit sed):" echo " grep -rl '~/Obsidian/SecondBrain' \"\$HOME/.claude/CLAUDE.md\" \"$VAULT_PATH\"/*.md | \\" echo " xargs sed -i '' 's|~/Obsidian/SecondBrain|${VAULT_PATH/#$HOME/\~}|g'" fi echo "" ok "Setup abgeschlossen." echo "" echo "Naechste Schritte:" echo " 1. Obsidian oeffnen → 'Open folder as vault' → $VAULT_PATH" echo " 2. Dataview-Plugin aktivieren (Settings → Community Plugins → Dataview)" echo " 3. Eigenes Profil anlegen: $VAULT_PATH/00 Kontext/Über mich.md" echo " 4. In Claude Code testen: \"Was steht in meiner Inbox?\"" echo "" echo "Doku:" echo " - $REPO_DIR/README.md (Quickstart)" echo " - $REPO_DIR/handbuch/ (sieben Kapitel)" echo "" echo "Claude Desktop einrichten: siehe $REPO_DIR/templates/claude-desktop/README.md" echo "" |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |