Initial commit: Complete Obsidian + Claude Code PKM Starter Kit

- Core structure with README, LICENSE, and .gitignore
- Complete vault template with Goals, Daily Notes, Projects, and Templates
- Cascading goal system (3-year → yearly → monthly → weekly)
- Claude Code integration with custom slash commands
- GitHub Actions workflow for mobile integration
- Comprehensive documentation (setup, customization, workflows, troubleshooting)
- Automation scripts for setup (Unix/Mac and Windows)
- Example content showing system usage
- Self-documenting templates with inline instructions

Ready for users to clone and customize for their personal knowledge management needs.
This commit is contained in:
Bill Allred
2025-08-07 17:11:26 -07:00
commit 3877057f7c
28 changed files with 6178 additions and 0 deletions

631
scripts/customize.sh Executable file
View File

@@ -0,0 +1,631 @@
#!/bin/bash
# Obsidian PKM Customization Helper
# This script helps you customize your PKM system interactively
set -e
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
MAGENTA='\033[0;35m'
CYAN='\033[0;36m'
NC='\033[0m'
# Banner
echo -e "${MAGENTA}"
echo "╔═══════════════════════════════════════════════════╗"
echo "║ PKM Customization Assistant ║"
echo "║ Personalize Your System ║"
echo "╚═══════════════════════════════════════════════════╝"
echo -e "${NC}"
# Find vault directory
if [ -f ".setup_complete" ]; then
VAULT_PATH="$(pwd)"
else
read -p "Enter path to your vault: " VAULT_PATH
VAULT_PATH="${VAULT_PATH/#\~/$HOME}"
fi
if [ ! -d "$VAULT_PATH" ]; then
echo -e "${RED}Error: Vault not found at $VAULT_PATH${NC}"
exit 1
fi
cd "$VAULT_PATH"
# Function to show menu
show_menu() {
echo -e "\n${CYAN}What would you like to customize?${NC}"
echo "=================================="
echo "1. Personal Mission & Values"
echo "2. Goal System (3-year, yearly, monthly)"
echo "3. Daily Note Template"
echo "4. Weekly Review Process"
echo "5. Tag System"
echo "6. Time Blocks & Schedule"
echo "7. Project Templates"
echo "8. Claude Context (CLAUDE.md)"
echo "9. Folder Structure"
echo "10. Create Custom Command"
echo "0. Exit"
echo ""
read -p "Choose an option (0-10): " choice
}
# Function 1: Customize Mission
customize_mission() {
echo -e "\n${BLUE}Personal Mission & Values${NC}"
echo "=========================="
echo "Your personal mission statement guides your daily decisions."
echo "Example: 'Create value through technology while nurturing relationships'"
echo ""
read -p "Enter your mission statement: " MISSION
if [ -n "$MISSION" ]; then
# Update files with mission
for file in "CLAUDE.md" "Templates/Daily Template.md"; do
if [ -f "$file" ]; then
# Backup original
cp "$file" "$file.bak"
# Update mission (handling both macOS and Linux)
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' "1s/.*/_$MISSION_/" "$file"
else
sed -i "1s/.*/_$MISSION_/" "$file"
fi
fi
done
echo -e "${GREEN}✓ Mission statement updated${NC}"
fi
echo -e "\n${BLUE}Core Values${NC}"
echo "What are your top 3 values?"
read -p "Value 1: " VALUE1
read -p "Value 2: " VALUE2
read -p "Value 3: " VALUE3
# Create values file
cat > "Values.md" << EOF
# My Core Values
## 1. $VALUE1
Why this matters to me:
## 2. $VALUE2
Why this matters to me:
## 3. $VALUE3
Why this matters to me:
---
*These values guide my decisions and priorities.*
EOF
echo -e "${GREEN}✓ Values documented${NC}"
}
# Function 2: Customize Goals
customize_goals() {
echo -e "\n${BLUE}Goal System Setup${NC}"
echo "=================="
echo "Let's set up your cascading goals..."
echo ""
# 3-Year Vision
echo -e "${CYAN}3-Year Vision${NC}"
echo "Where do you want to be in 3 years?"
read -p "Career: " CAREER_3Y
read -p "Health: " HEALTH_3Y
read -p "Relationships: " RELATIONSHIP_3Y
read -p "Financial: " FINANCIAL_3Y
# Update 3-year goals file
cat > "Goals/0. Three Year Goals.md" << EOF
# Three Year Goals ($(date +%Y)-$(($(date +%Y)+3)))
## 🌟 Vision Statement
In three years, I will have achieved:
### 💼 Career & Professional Development
- $CAREER_3Y
### 🏃 Health & Wellness
- $HEALTH_3Y
### ❤️ Relationships & Family
- $RELATIONSHIP_3Y
### 💰 Financial Security
- $FINANCIAL_3Y
---
*Created: $(date +%Y-%m-%d)*
EOF
echo -e "${GREEN}✓ 3-year goals set${NC}"
# This Year's Focus
echo -e "\n${CYAN}This Year's Focus${NC}"
read -p "What's your ONE metric that matters this year? " ONE_METRIC
read -p "What's this year's theme word? " THEME
# Update yearly goals
YEAR=$(date +%Y)
sed -i.bak "s/\[CUSTOMIZE THIS:.*\]/$ONE_METRIC/" "Goals/1. Yearly Goals.md" 2>/dev/null || true
echo -e "${GREEN}✓ Yearly goals configured${NC}"
}
# Function 3: Customize Daily Template
customize_daily() {
echo -e "\n${BLUE}Daily Note Customization${NC}"
echo "========================"
echo "Let's customize your daily note structure..."
echo ""
# Time preferences
echo "When does your day typically start?"
read -p "Wake time (e.g., 6:00 AM): " WAKE_TIME
echo "When does your workday start?"
read -p "Work start (e.g., 9:00 AM): " WORK_START
echo "When does your workday end?"
read -p "Work end (e.g., 5:00 PM): " WORK_END
# Categories
echo -e "\n${CYAN}Task Categories${NC}"
echo "What categories do you want to track? (comma-separated)"
echo "Default: Work, Personal, Learning, Health"
read -p "Your categories: " CATEGORIES
CATEGORIES=${CATEGORIES:-"Work,Personal,Learning,Health"}
# Habits
echo -e "\n${CYAN}Daily Habits${NC}"
echo "What habits do you want to track? (comma-separated)"
echo "Example: Exercise, Meditation, Reading, Journaling"
read -p "Your habits: " HABITS
# Generate custom template
cat > "Templates/Daily Template - Custom.md" << EOF
---
date: {{date}}
tags: daily-note
---
# {{date:dddd, MMMM DD, YYYY}}
## 🎯 Today's Focus
**ONE Thing:**
## ⏰ Schedule
- **$WAKE_TIME - Morning Routine**
- **$WORK_START - Work Block**
- **12:00 PM - Lunch Break**
- **1:00 PM - Afternoon Work**
- **$WORK_END - End of Work**
- **Evening - Personal Time**
## ✅ Tasks
EOF
# Add categories
IFS=',' read -ra CATS <<< "$CATEGORIES"
for cat in "${CATS[@]}"; do
cat=$(echo "$cat" | xargs) # Trim whitespace
echo -e "\n### $cat\n- [ ] " >> "Templates/Daily Template - Custom.md"
done
# Add habits section
echo -e "\n## 🧘 Habits" >> "Templates/Daily Template - Custom.md"
IFS=',' read -ra HABS <<< "$HABITS"
for hab in "${HABS[@]}"; do
hab=$(echo "$hab" | xargs)
echo "- [ ] $hab" >> "Templates/Daily Template - Custom.md"
done
# Add reflection
cat >> "Templates/Daily Template - Custom.md" << EOF
## 💭 Notes & Ideas
## 🔍 End of Day Reflection
### What went well?
-
### What could be better?
-
### Tomorrow's priority:
-
---
*Day {{date:D}} of 365*
EOF
echo -e "${GREEN}✓ Custom daily template created${NC}"
}
# Function 4: Customize Weekly Review
customize_weekly() {
echo -e "\n${BLUE}Weekly Review Customization${NC}"
echo "============================"
echo "When do you prefer to do your weekly review?"
echo "1. Sunday Evening"
echo "2. Monday Morning"
echo "3. Friday Afternoon"
echo "4. Saturday Morning"
read -p "Choose (1-4): " REVIEW_TIME
case $REVIEW_TIME in
1) REVIEW_DAY="Sunday Evening" ;;
2) REVIEW_DAY="Monday Morning" ;;
3) REVIEW_DAY="Friday Afternoon" ;;
4) REVIEW_DAY="Saturday Morning" ;;
*) REVIEW_DAY="Sunday Evening" ;;
esac
echo -e "\nHow long for your review?"
read -p "Minutes (default 30): " REVIEW_DURATION
REVIEW_DURATION=${REVIEW_DURATION:-30}
# Create custom weekly review
cat > "Templates/Weekly Review - Custom.md" << EOF
# Weekly Review - {{date:YYYY [Week] w}}
**Review Time:** $REVIEW_DAY ($REVIEW_DURATION minutes)
## 📊 Quick Metrics
- Tasks Completed: /
- Goals Progress: %
- Energy Average: /10
## 🔍 Last Week
### Top 3 Wins
1.
2.
3.
### Top 3 Challenges
1.
2.
3.
### Key Insight
-
## 📅 Next Week
### ONE Big Thing
If nothing else:
### Priority Projects
1.
2.
3.
### Scheduled Blocks
- Deep Work:
- Meetings:
- Personal:
## 🧹 Cleanup
- [ ] Process inbox
- [ ] Review calendar
- [ ] Update project status
- [ ] Archive old notes
- [ ] Plan time blocks
---
*Review completed in: ___ minutes*
EOF
echo -e "${GREEN}✓ Weekly review customized for $REVIEW_DAY${NC}"
}
# Function 5: Customize Tags
customize_tags() {
echo -e "\n${BLUE}Tag System Setup${NC}"
echo "================="
echo "Let's create your personalized tag system..."
echo ""
echo "Choose tag style:"
echo "1. Hierarchical (#area/subarea/specific)"
echo "2. Flat (#area-specific)"
echo "3. Prefix-based (#p-project, #a-area)"
read -p "Style (1-3): " TAG_STYLE
echo -e "\nEnter your main life areas (comma-separated):"
echo "Example: work, personal, health, finance, learning"
read -p "Your areas: " AREAS
# Create tag reference
cat > "Tag System.md" << EOF
# My Tag System
## Structure
EOF
case $TAG_STYLE in
1)
echo "Hierarchical tags:" >> "Tag System.md"
IFS=',' read -ra AREA_ARRAY <<< "$AREAS"
for area in "${AREA_ARRAY[@]}"; do
area=$(echo "$area" | xargs)
echo "- #$area/" >> "Tag System.md"
echo " - #$area/active" >> "Tag System.md"
echo " - #$area/waiting" >> "Tag System.md"
echo " - #$area/someday" >> "Tag System.md"
done
;;
2)
echo "Flat tags:" >> "Tag System.md"
IFS=',' read -ra AREA_ARRAY <<< "$AREAS"
for area in "${AREA_ARRAY[@]}"; do
area=$(echo "$area" | xargs)
echo "- #$area" >> "Tag System.md"
echo "- #${area}-active" >> "Tag System.md"
echo "- #${area}-waiting" >> "Tag System.md"
done
;;
3)
echo "Prefix-based tags:" >> "Tag System.md"
echo "- #p- (projects)" >> "Tag System.md"
echo "- #a- (areas)" >> "Tag System.md"
echo "- #t- (topics)" >> "Tag System.md"
echo "- #s- (status)" >> "Tag System.md"
;;
esac
cat >> "Tag System.md" << EOF
## Status Tags
- #active - Currently working on
- #waiting - Blocked or waiting
- #someday - Future consideration
- #done - Completed
- #cancelled - No longer relevant
## Priority Tags
- #priority/high - Must do today
- #priority/medium - This week
- #priority/low - When possible
## Energy Tags
- #energy/high - Requires focus
- #energy/medium - Normal energy
- #energy/low - Can do when tired
## Quick Search Queries
- Find all active: tag:#active
- Today's priorities: tag:#priority/high
- Waiting items: tag:#waiting
EOF
echo -e "${GREEN}✓ Tag system created${NC}"
}
# Function 6: Customize Time Blocks
customize_time_blocks() {
echo -e "\n${BLUE}Time Block Customization${NC}"
echo "========================"
echo "Let's set up your ideal time blocks..."
echo ""
echo "What type of schedule do you follow?"
echo "1. Traditional (9-5)"
echo "2. Early Bird (5am start)"
echo "3. Night Owl (work late)"
echo "4. Flexible/Remote"
echo "5. Shift Work"
read -p "Choose (1-5): " SCHEDULE_TYPE
case $SCHEDULE_TYPE in
1)
BLOCKS="6-7 AM: Morning Routine
7-8 AM: Planning & Email
8-9 AM: Commute
9-12 PM: Deep Work
12-1 PM: Lunch
1-3 PM: Meetings
3-5 PM: Admin Tasks
5-6 PM: Wrap Up
6-9 PM: Personal Time"
;;
2)
BLOCKS="5-6 AM: Morning Routine
6-8 AM: Deep Work
8-9 AM: Exercise
9-12 PM: Focused Work
12-1 PM: Lunch
1-3 PM: Meetings
3-5 PM: Project Time
5-7 PM: Family Time
7-9 PM: Personal Projects"
;;
3)
BLOCKS="8-9 AM: Slow Morning
9-10 AM: Exercise
10-12 PM: Admin Tasks
12-1 PM: Lunch
1-4 PM: Meetings
4-6 PM: Break/Personal
6-8 PM: Dinner
8-12 AM: Deep Work"
;;
4)
BLOCKS="7-8 AM: Morning Routine
8-10 AM: Deep Work Block 1
10-12 PM: Communication Block
12-1 PM: Lunch & Walk
1-3 PM: Deep Work Block 2
3-4 PM: Admin/Email
4-5 PM: Planning Tomorrow
5-7 PM: Personal Time
7-9 PM: Learning/Side Projects"
;;
5)
echo "Enter your shift schedule:"
read -p "Shift start: " SHIFT_START
read -p "Shift end: " SHIFT_END
BLOCKS="Custom shift: $SHIFT_START - $SHIFT_END"
;;
esac
# Create time block template
cat > "Time Blocks.md" << EOF
# My Ideal Time Blocks
## Default Schedule
$BLOCKS
## Deep Work Times
Best focus: [CUSTOMIZE]
Good focus: [CUSTOMIZE]
Low focus: [CUSTOMIZE]
## Rules
1. Protect deep work blocks
2. Batch similar tasks
3. Include breaks
4. End day with planning
## Weekly Variations
- Monday: Planning focus
- Tuesday-Thursday: Execution
- Friday: Review & wrap-up
---
*Adjust based on energy and priorities*
EOF
echo -e "${GREEN}✓ Time blocks configured${NC}"
}
# Function 10: Create Custom Command
create_custom_command() {
echo -e "\n${BLUE}Create Custom Claude Command${NC}"
echo "============================="
read -p "Command name (e.g., 'report'): " CMD_NAME
read -p "Command description: " CMD_DESC
echo "What should this command do?"
echo "1. Create a specific type of note"
echo "2. Run a workflow/process"
echo "3. Generate a report"
echo "4. Perform maintenance"
read -p "Choose (1-4): " CMD_TYPE
# Create command file
cat > ".claude/commands/$CMD_NAME.md" << EOF
# $CMD_NAME Command
$CMD_DESC
## Usage
\`\`\`
claude code /$CMD_NAME
\`\`\`
## What This Command Does
EOF
case $CMD_TYPE in
1)
read -p "Note template name: " TEMPLATE
cat >> ".claude/commands/$CMD_NAME.md" << EOF
1. Creates a new note from template
2. Names it appropriately
3. Places in correct folder
## Configuration
const TEMPLATE_PATH = "Templates/$TEMPLATE.md";
const OUTPUT_FOLDER = "[CUSTOMIZE]";
EOF
;;
2)
cat >> ".claude/commands/$CMD_NAME.md" << EOF
1. Executes workflow steps
2. Updates relevant files
3. Generates output
## Workflow Steps
1. [Step 1]
2. [Step 2]
3. [Step 3]
EOF
;;
3)
cat >> ".claude/commands/$CMD_NAME.md" << EOF
1. Analyzes specified data
2. Generates formatted report
3. Saves to designated location
## Report Sections
- Summary
- Details
- Recommendations
EOF
;;
4)
cat >> ".claude/commands/$CMD_NAME.md" << EOF
1. Performs maintenance tasks
2. Cleans up files
3. Optimizes structure
## Tasks
- Archive old files
- Update indices
- Clean duplicates
EOF
;;
esac
echo -e "${GREEN}✓ Custom command '/$CMD_NAME' created${NC}"
}
# Main loop
while true; do
show_menu
case $choice in
1) customize_mission ;;
2) customize_goals ;;
3) customize_daily ;;
4) customize_weekly ;;
5) customize_tags ;;
6) customize_time_blocks ;;
7) echo "Project template customization coming soon..." ;;
8) echo "Edit CLAUDE.md directly for now..." ;;
9) echo "Folder structure customization coming soon..." ;;
10) create_custom_command ;;
0)
echo -e "\n${GREEN}Customization complete!${NC}"
echo "Your PKM system has been personalized."
# Commit changes
cd "$VAULT_PATH"
git add .
git commit -m "Customization updates - $(date +%Y-%m-%d)" 2>/dev/null || true
exit 0
;;
*) echo -e "${RED}Invalid option${NC}" ;;
esac
echo -e "\n${CYAN}Press Enter to continue...${NC}"
read
done

249
scripts/setup.bat Normal file
View File

@@ -0,0 +1,249 @@
@echo off
REM Obsidian + Claude Code PKM Setup Script for Windows
REM This script automates the initial setup of your PKM system
setlocal enabledelayedexpansion
REM Colors setup (Windows 10+)
echo.
echo =====================================
echo Obsidian + Claude Code PKM Setup
echo Version 1.0 for Windows
echo =====================================
echo.
REM Step 1: Check Prerequisites
echo Step 1: Checking Prerequisites
echo ==============================
REM Check for Git
where git >nul 2>nul
if %errorlevel%==0 (
echo [OK] Git is installed
git --version
) else (
echo [ERROR] Git is not installed
echo Please install Git from: https://git-scm.com/
pause
exit /b 1
)
REM Check for Claude Code
where claude >nul 2>nul
if %errorlevel%==0 (
echo [OK] Claude Code is installed
) else (
echo [WARNING] Claude Code CLI not found
echo Install from: https://docs.anthropic.com/en/docs/claude-code
set /p CONTINUE="Continue without Claude Code? (y/n): "
if /i not "!CONTINUE!"=="y" exit /b 1
)
echo.
REM Step 2: Get Vault Location
echo Step 2: Choose Vault Location
echo ==============================
set DEFAULT_VAULT=%USERPROFILE%\Documents\ObsidianPKM
set /p VAULT_PATH="Where should we create your vault? [%DEFAULT_VAULT%]: "
if "%VAULT_PATH%"=="" set VAULT_PATH=%DEFAULT_VAULT%
REM Check if directory exists
if exist "%VAULT_PATH%" (
echo [WARNING] Directory already exists: %VAULT_PATH%
set /p USE_EXISTING="Use existing directory? Files may be overwritten (y/n): "
if /i not "!USE_EXISTING!"=="y" (
echo Setup cancelled
pause
exit /b 1
)
) else (
mkdir "%VAULT_PATH%"
echo [OK] Created vault directory: %VAULT_PATH%
)
echo.
REM Step 3: Copy Vault Template
echo Step 3: Setting Up Vault Structure
echo ===================================
set SCRIPT_DIR=%~dp0
set TEMPLATE_DIR=%SCRIPT_DIR%..\vault-template
echo Copying template files...
xcopy /E /I /Y "%TEMPLATE_DIR%\*" "%VAULT_PATH%\" >nul 2>nul
echo [OK] Vault structure created
echo.
REM Step 4: Set Up Claude Commands
echo Step 4: Setting Up Claude Commands
echo ===================================
where claude >nul 2>nul
if %errorlevel%==0 (
REM Commands are already in vault-template\.claude\commands\
REM Just need to initialize Claude
cd /d "%VAULT_PATH%"
REM Check if commands were copied
if exist "%VAULT_PATH%\.claude\commands" (
echo [OK] Claude commands already in place
) else (
echo [WARNING] Claude commands directory not found
)
REM Initialize Claude in vault
claude init 2>nul
echo [OK] Claude Code initialized in vault
) else (
echo [WARNING] Skipping Claude Code setup - not installed
)
echo.
REM Step 5: Initialize Git
echo Step 5: Git Repository Setup
echo ============================
cd /d "%VAULT_PATH%"
if exist .git (
echo [WARNING] Git repository already exists
) else (
git init >nul
echo [OK] Git repository initialized
)
REM Configure Git
set /p GIT_NAME="Enter your name for Git commits: "
set /p GIT_EMAIL="Enter your email for Git commits: "
if not "%GIT_NAME%"=="" (
git config user.name "%GIT_NAME%"
echo [OK] Git user name set
)
if not "%GIT_EMAIL%"=="" (
git config user.email "%GIT_EMAIL%"
echo [OK] Git user email set
)
REM Initial commit
git add . >nul 2>nul
git commit -m "Initial PKM setup" >nul 2>nul
echo [OK] Initial commit created
echo.
REM Step 6: GitHub Setup (Optional)
echo Step 6: GitHub Integration - Optional
echo ======================================
set /p SETUP_GITHUB="Do you want to set up GitHub integration? (y/n): "
if /i "%SETUP_GITHUB%"=="y" (
set /p GITHUB_URL="Enter your GitHub repository URL (or press Enter to skip): "
if not "!GITHUB_URL!"=="" (
git remote add origin "!GITHUB_URL!" 2>nul || git remote set-url origin "!GITHUB_URL!"
echo [OK] GitHub remote configured
set /p PUSH_NOW="Push to GitHub now? (y/n): "
if /i "!PUSH_NOW!"=="y" (
git push -u origin main 2>nul || git push -u origin master
echo [OK] Pushed to GitHub
)
REM Set up GitHub Action
mkdir "%VAULT_PATH%\.github\workflows" 2>nul
copy "%SCRIPT_DIR%..\github-actions\claude.yml" "%VAULT_PATH%\.github\workflows\" >nul
echo [OK] GitHub Action workflow copied
echo [NOTE] Remember to add CLAUDE_CODE_OAUTH_TOKEN to repository secrets
)
)
echo.
REM Step 7: Personalization
echo Step 7: Initial Personalization
echo ================================
echo.
echo What's your personal mission or life purpose?
echo Example: Build meaningful technology while maintaining balance
set /p MISSION="Your mission: "
if not "%MISSION%"=="" (
REM This is simplified - proper text replacement in batch is complex
echo [OK] Personal mission noted - please update CLAUDE.md manually
)
echo.
echo What's your main focus right now?
set /p FOCUS="Current focus: "
REM Create first daily note
for /f "tokens=1-3 delims=/ " %%a in ('date /t') do (
set TODAY=%%c-%%a-%%b
)
set TODAY=%TODAY: =%
set DAILY_NOTE=%VAULT_PATH%\Daily Notes\%TODAY%.md
if not exist "%DAILY_NOTE%" (
echo Creating your first daily note...
copy "%VAULT_PATH%\Templates\Daily Template.md" "%DAILY_NOTE%" >nul
echo [OK] First daily note created: %TODAY%.md
)
echo.
REM Step 8: Final Setup
echo Step 8: Finalizing Setup
echo ========================
REM Create a setup completion marker
echo Setup completed on %date% %time% > "%VAULT_PATH%\.setup_complete"
REM Commit personalization
cd /d "%VAULT_PATH%"
git add . >nul 2>nul
git commit -m "Personalized PKM setup" >nul 2>nul
echo.
echo =============================================
echo Setup Complete!
echo =============================================
echo.
echo Your PKM system is ready at: %VAULT_PATH%
echo.
echo Next steps:
echo 1. Open Obsidian and select your vault folder
echo 2. Explore the Goals folder to set your objectives
echo 3. Start using daily notes with: claude code /daily
echo 4. Run weekly reviews with: claude code /weekly
echo.
echo Quick Commands:
echo cd "%VAULT_PATH%" - Navigate to your vault
echo claude code /onboard - Load context into Claude
echo claude code /daily - Create today's note
echo claude code /push - Save changes to Git
echo.
echo Read the documentation in docs\ for detailed guidance
echo.
REM Offer to open Obsidian
if exist "%LOCALAPPDATA%\Obsidian\Obsidian.exe" (
set /p OPEN_OBSIDIAN="Open Obsidian now? (y/n): "
if /i "!OPEN_OBSIDIAN!"=="y" (
start "" "%LOCALAPPDATA%\Obsidian\Obsidian.exe"
echo [OK] Obsidian launched
)
)
echo.
echo Happy note-taking!
echo.
pause

291
scripts/setup.sh Executable file
View File

@@ -0,0 +1,291 @@
#!/bin/bash
# Obsidian + Claude Code PKM Setup Script
# This script automates the initial setup of your PKM system
set -e # Exit on error
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Banner
echo -e "${BLUE}"
echo "╔═══════════════════════════════════════════════════╗"
echo "║ Obsidian + Claude Code PKM Setup Wizard ║"
echo "║ Version 1.0 ║"
echo "╚═══════════════════════════════════════════════════╝"
echo -e "${NC}"
# Function to print colored messages
print_success() {
echo -e "${GREEN}${NC} $1"
}
print_error() {
echo -e "${RED}${NC} $1"
}
print_warning() {
echo -e "${YELLOW}${NC} $1"
}
print_info() {
echo -e "${BLUE}${NC} $1"
}
# Function to check if command exists
command_exists() {
command -v "$1" >/dev/null 2>&1
}
# Step 1: Check Prerequisites
echo -e "\n${BLUE}Step 1: Checking Prerequisites${NC}"
echo "================================"
# Check for Git
if command_exists git; then
print_success "Git is installed ($(git --version))"
else
print_error "Git is not installed"
echo "Please install Git from: https://git-scm.com/"
exit 1
fi
# Check for Claude Code
if command_exists claude; then
print_success "Claude Code is installed ($(claude --version 2>/dev/null || echo 'version check failed'))"
else
print_warning "Claude Code CLI not found"
echo "Install from: https://docs.anthropic.com/en/docs/claude-code"
read -p "Continue without Claude Code? (y/n): " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
exit 1
fi
fi
# Step 2: Get Vault Location
echo -e "\n${BLUE}Step 2: Choose Vault Location${NC}"
echo "================================"
# Default location
DEFAULT_VAULT="$HOME/Documents/ObsidianPKM"
read -p "Where should we create your vault? [$DEFAULT_VAULT]: " VAULT_PATH
VAULT_PATH=${VAULT_PATH:-$DEFAULT_VAULT}
# Expand tilde if present
VAULT_PATH="${VAULT_PATH/#\~/$HOME}"
# Check if directory exists
if [ -d "$VAULT_PATH" ]; then
print_warning "Directory already exists: $VAULT_PATH"
read -p "Use existing directory? Files may be overwritten (y/n): " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "Setup cancelled"
exit 1
fi
else
mkdir -p "$VAULT_PATH"
print_success "Created vault directory: $VAULT_PATH"
fi
# Step 3: Copy Vault Template
echo -e "\n${BLUE}Step 3: Setting Up Vault Structure${NC}"
echo "====================================="
# Get script directory
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
TEMPLATE_DIR="$SCRIPT_DIR/../vault-template"
# Copy template files
print_info "Copying template files..."
cp -r "$TEMPLATE_DIR"/* "$VAULT_PATH/" 2>/dev/null || true
cp -r "$TEMPLATE_DIR"/.* "$VAULT_PATH/" 2>/dev/null || true
print_success "Vault structure created"
# Step 4: Set Up Claude Commands
echo -e "\n${BLUE}Step 4: Setting Up Claude Commands${NC}"
echo "======================================"
if command_exists claude; then
# Commands are already in vault-template/.claude/commands/
# Just need to initialize Claude
cd "$VAULT_PATH"
# Check if commands were copied
if [ -d "$VAULT_PATH/.claude/commands" ]; then
print_success "Claude commands already in place"
else
print_warning "Claude commands directory not found"
fi
# Initialize Claude in vault
claude init 2>/dev/null || true
print_success "Claude Code initialized in vault"
else
print_warning "Skipping Claude Code setup (not installed)"
fi
# Step 5: Initialize Git
echo -e "\n${BLUE}Step 5: Git Repository Setup${NC}"
echo "==============================="
cd "$VAULT_PATH"
if [ -d .git ]; then
print_warning "Git repository already exists"
else
git init
print_success "Git repository initialized"
fi
# Configure Git
read -p "Enter your name for Git commits: " GIT_NAME
read -p "Enter your email for Git commits: " GIT_EMAIL
if [ -n "$GIT_NAME" ]; then
git config user.name "$GIT_NAME"
print_success "Git user name set"
fi
if [ -n "$GIT_EMAIL" ]; then
git config user.email "$GIT_EMAIL"
print_success "Git user email set"
fi
# Initial commit
git add .
git commit -m "Initial PKM setup" 2>/dev/null || print_warning "Nothing to commit"
# Step 6: GitHub Setup (Optional)
echo -e "\n${BLUE}Step 6: GitHub Integration (Optional)${NC}"
echo "========================================="
read -p "Do you want to set up GitHub integration? (y/n): " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
read -p "Enter your GitHub repository URL (or press Enter to skip): " GITHUB_URL
if [ -n "$GITHUB_URL" ]; then
git remote add origin "$GITHUB_URL" 2>/dev/null || git remote set-url origin "$GITHUB_URL"
print_success "GitHub remote configured"
read -p "Push to GitHub now? (y/n): " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
git push -u origin main 2>/dev/null || git push -u origin master
print_success "Pushed to GitHub"
fi
# Set up GitHub Action
mkdir -p "$VAULT_PATH/.github/workflows"
cp "$SCRIPT_DIR/../github-actions/claude.yml" "$VAULT_PATH/.github/workflows/"
print_success "GitHub Action workflow copied"
print_warning "Remember to add CLAUDE_CODE_OAUTH_TOKEN to repository secrets"
fi
fi
# Step 7: Personalization
echo -e "\n${BLUE}Step 7: Initial Personalization${NC}"
echo "===================================="
print_info "Let's personalize your system..."
# Get personal mission
echo -e "\nWhat's your personal mission or life purpose?"
echo "(Example: 'Build meaningful technology while maintaining balance')"
read -p "Your mission: " MISSION
if [ -n "$MISSION" ]; then
# Update CLAUDE.md
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS
sed -i '' "s/\[CUSTOMIZE THIS: Add your personal mission statement or life purpose here\]/$MISSION/" "$VAULT_PATH/CLAUDE.md"
else
# Linux
sed -i "s/\[CUSTOMIZE THIS: Add your personal mission statement or life purpose here\]/$MISSION/" "$VAULT_PATH/CLAUDE.md"
fi
print_success "Personal mission added"
fi
# Get current focus
echo -e "\nWhat's your main focus right now?"
read -p "Current focus: " FOCUS
# Create first daily note
TODAY=$(date +%Y-%m-%d)
DAILY_NOTE="$VAULT_PATH/Daily Notes/$TODAY.md"
if [ ! -f "$DAILY_NOTE" ]; then
print_info "Creating your first daily note..."
cp "$VAULT_PATH/Templates/Daily Template.md" "$DAILY_NOTE"
# Add focus to daily note
if [ -n "$FOCUS" ]; then
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' "s/\*\*Today's Priority:\*\*/\*\*Today's Priority:\*\* $FOCUS/" "$DAILY_NOTE"
else
sed -i "s/\*\*Today's Priority:\*\*/\*\*Today's Priority:\*\* $FOCUS/" "$DAILY_NOTE"
fi
fi
print_success "First daily note created: $TODAY.md"
fi
# Step 8: Final Setup
echo -e "\n${BLUE}Step 8: Finalizing Setup${NC}"
echo "==========================="
# Create a setup completion marker
echo "Setup completed on $(date)" > "$VAULT_PATH/.setup_complete"
# Commit personalization
cd "$VAULT_PATH"
git add .
git commit -m "Personalized PKM setup" 2>/dev/null || true
# Summary
echo -e "\n${GREEN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
echo -e "${GREEN}✨ Setup Complete!${NC}"
echo -e "${GREEN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}\n"
echo "Your PKM system is ready at: $VAULT_PATH"
echo ""
echo "Next steps:"
echo "1. Open Obsidian and select your vault folder"
echo "2. Explore the Goals folder to set your objectives"
echo "3. Start using daily notes with: claude code /daily"
echo "4. Run weekly reviews with: claude code /weekly"
echo ""
echo "Quick Commands:"
echo " cd \"$VAULT_PATH\" # Navigate to your vault"
echo " claude code /onboard # Load context into Claude"
echo " claude code /daily # Create today's note"
echo " claude code /push # Save changes to Git"
echo ""
print_info "Read the documentation in docs/ for detailed guidance"
print_success "Happy note-taking! 🚀"
# Offer to open Obsidian
if [[ "$OSTYPE" == "darwin"* ]]; then
if [ -d "/Applications/Obsidian.app" ]; then
read -p "Open Obsidian now? (y/n): " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
open -a Obsidian
print_success "Obsidian launched"
fi
fi
elif command_exists obsidian; then
read -p "Open Obsidian now? (y/n): " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
obsidian &
print_success "Obsidian launched"
fi
fi