Plugins installed:
obsidian-excalidraw-plugin
manifest.json + styles.css tracked in git
main.js (8MB) excluded from git — downloaded by setup-vault.sh on first run
obsidian-banners
manifest.json + main.js + styles.css all tracked (148KB, acceptable)
CSS Snippets (ITS Theme by SlRvb):
ITS-Dataview-Cards.css — transforms TABLE queries into visual card grids
Usage: use backtick-dataview-cards instead of backtick-dataview above query
ITS-Image-Adjustments.css — fine-grained image sizing in notes
Usage: caption images with |100 or wrap in image-adjustments callout
Config updates:
community-plugins.json — added obsidian-excalidraw-plugin, obsidian-banners
appearance.json — added ITS-Dataview-Cards + ITS-Image-Adjustments snippets
(vault-colors preserved)
.gitignore — added excalidraw main.js exclusion rule
setup-vault.sh — step 5: auto-downloads Excalidraw main.js if missing
curl from GitHub releases/latest, skips if already present
Canvas updates (Obsidian saved state):
welcome.canvas — user added Cosmic Brain GIF at top
main.canvas — user added brand assets to Wiki Pages zone
Wiki Map.canvas — Obsidian format normalised
112 lines
4.1 KiB
Bash
Executable File
112 lines
4.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# cosmic-brain vault setup script
|
|
# Run this ONCE before opening Obsidian for the first time.
|
|
# Usage: bash bin/setup-vault.sh [optional: /path/to/vault]
|
|
# Default: uses the directory where this script lives (the vault root)
|
|
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
VAULT="${1:-$(dirname "$SCRIPT_DIR")}"
|
|
OBSIDIAN="$VAULT/.obsidian"
|
|
|
|
echo "Setting up cosmic-brain vault at: $VAULT"
|
|
|
|
# ── 1. Create directories ─────────────────────────────────────────────────────
|
|
mkdir -p "$OBSIDIAN/snippets"
|
|
mkdir -p "$VAULT/.raw"
|
|
mkdir -p "$VAULT/wiki/concepts" "$VAULT/wiki/entities" "$VAULT/wiki/sources" "$VAULT/wiki/meta"
|
|
mkdir -p "$VAULT/_templates"
|
|
|
|
# ── 2. Write graph.json ───────────────────────────────────────────────────────
|
|
cat > "$OBSIDIAN/graph.json" << 'EOF'
|
|
{
|
|
"collapse-filter": false,
|
|
"search": "path:wiki",
|
|
"showTags": false,
|
|
"showAttachments": false,
|
|
"hideUnresolved": true,
|
|
"showOrphans": false,
|
|
"collapse-color-groups": false,
|
|
"colorGroups": [
|
|
{ "query": "path:wiki/entities", "color": { "a": 1, "rgb": 12945088 } },
|
|
{ "query": "path:wiki/concepts", "color": { "a": 1, "rgb": 5227007 } },
|
|
{ "query": "path:wiki/sources", "color": { "a": 1, "rgb": 6986069 } },
|
|
{ "query": "path:wiki/meta", "color": { "a": 1, "rgb": 5676246 } },
|
|
{ "query": "path:wiki", "color": { "a": 1, "rgb": 5676246 } }
|
|
],
|
|
"showArrow": true,
|
|
"textFadeMultiplier": -1,
|
|
"nodeSizeMultiplier": 1.8,
|
|
"lineSizeMultiplier": 1.2,
|
|
"centerStrength": 0.5,
|
|
"repelStrength": 30,
|
|
"linkStrength": 1.5,
|
|
"linkDistance": 120,
|
|
"scale": 1.0
|
|
}
|
|
EOF
|
|
|
|
# ── 3. Write app.json (excluded files) ───────────────────────────────────────
|
|
cat > "$OBSIDIAN/app.json" << 'EOF'
|
|
{
|
|
"userIgnoreFilters": [
|
|
"agents/",
|
|
"commands/",
|
|
"hooks/",
|
|
"skills/",
|
|
"_templates/",
|
|
"README.md",
|
|
"CLAUDE.md",
|
|
"WIKI.md",
|
|
"Welcome.md"
|
|
]
|
|
}
|
|
EOF
|
|
|
|
# ── 4. Write appearance.json (enable CSS snippets) ───────────────────────────
|
|
cat > "$OBSIDIAN/appearance.json" << 'EOF'
|
|
{
|
|
"enabledCssSnippets": [
|
|
"vault-colors",
|
|
"ITS-Dataview-Cards",
|
|
"ITS-Image-Adjustments"
|
|
]
|
|
}
|
|
EOF
|
|
|
|
# ── 5. Download Excalidraw main.js (8MB, not in git) ─────────────────────────
|
|
EXCALIDRAW="$OBSIDIAN/plugins/obsidian-excalidraw-plugin"
|
|
if [ -f "$EXCALIDRAW/manifest.json" ] && [ ! -f "$EXCALIDRAW/main.js" ]; then
|
|
echo "Downloading Excalidraw main.js (~8MB)..."
|
|
curl -sS -L \
|
|
"https://github.com/zsviczian/obsidian-excalidraw-plugin/releases/latest/download/main.js" \
|
|
-o "$EXCALIDRAW/main.js"
|
|
echo "✓ Excalidraw main.js downloaded"
|
|
elif [ -f "$EXCALIDRAW/main.js" ]; then
|
|
echo "✓ Excalidraw main.js already present"
|
|
fi
|
|
|
|
echo ""
|
|
echo "✓ Setup complete."
|
|
echo ""
|
|
echo "Next steps:"
|
|
echo " 1. Open Obsidian"
|
|
echo " 2. Manage Vaults → Open folder as vault → select: $VAULT"
|
|
echo " 3. Enable community plugins when prompted (Calendar + Thino are pre-installed)"
|
|
echo " 4. Install: Dataview, Templater, Obsidian Git (Settings → Community Plugins)"
|
|
echo " 5. Type /wiki in Claude Code to scaffold your knowledge base"
|
|
echo ""
|
|
echo "Views available:"
|
|
echo " - Wiki Map canvas (wiki/Wiki Map.canvas) — knowledge graph"
|
|
echo " - Design Ideas canvas (projects/visual-vault/design-ideas.canvas) — visual reference board"
|
|
echo " - Graph view filtered to wiki/ only, color-coded by type"
|
|
echo ""
|
|
echo "To switch to the visual layout (Canvas + Calendar + Thino sidebar):"
|
|
echo " Quit Obsidian, then run:"
|
|
echo " cp $OBSIDIAN/workspace-visual.json $OBSIDIAN/workspace.json"
|
|
echo " Then reopen Obsidian."
|
|
echo ""
|
|
echo "Graph colors: if they reset after closing Obsidian, open Graph settings"
|
|
echo "→ Color groups and re-add them once. They persist permanently after that."
|