Skip to content

CodedRichy/ObsidianBridge

Repository files navigation

ObsidianBridge

Real-time sync between your GitHub projects and Obsidian Vault


What Problem Does This Solve?

If you're like me, you write documentation in your GitHub repos but manage your knowledge in Obsidian. The problem? Manually copying files breaks your wiki-links, and Obsidian can't read GitHub's relative links. Plus, pointing Obsidian directly at your GitHub folder? That creates serious lag with all those git files and large repositories.

How It Helps

ObsidianBridge runs quietly in your system tray and automatically keeps your Obsidian vault in sync with your GitHub projects. It:

  • Watches for changes in your GitHub folders in real-time
  • Rewrites wiki-links so they work perfectly in Obsidian
  • Generates smart indexes that make folders show up as connected nodes in your graph
  • Creates hierarchical navigation - main index → folder indexes → files
  • Keeps your vault fast by only syncing processed markdown, not git history

The Architecture That Works

GitHub/                         ObsidianBridge                         Vault/
├── project-a/                  (processes & copies)                    ├── project-a/
│   ├── README.md       →       │   ├── README.md       →               │   ├── README.md
│   └── docs/                   │   └── docs/                           │   └── docs/
│       └── guide.md    →       │       └── guide.md    →               │       └── guide.md
├── project-b/                  │   └── notes.md        →               │   └── notes.md
│   └── notes.md        →       │   └── index.md (generated)           │   └── index_project.md
└── .git/ (ignored)             │                                       └── index_project_docs.md
                              (one-way sync only)

Key insight: Your vault contains processed copies, not live connections to GitHub. This keeps Obsidian fast while giving you all the knowledge management power.


Getting Started

Installation

# Clone or download
cd ObsidianBridge

# Install dependencies
pip install -r requirements.txt

First Run

# Launch the app
python ObsidianBridge.py

On first run, you'll see setup instructions if directories don't exist.

Configuration

Right-click the tray icon → Settings (or edit config.json):

{
  "SOURCE_DIRECTORY": "C:\\Users\\You\\Documents\\GitHub",
  "DESTINATION_DIRECTORY": "C:\\Users\\You\\Documents\\Vault",
  "PRESERVE_STRUCTURE": true,
  "ENABLE_TAGGING": false,
  "COLLISION_DELAY": 2,
  "DEBOUNCE_DELAY": 5,
  "OLLAMA_MODEL": "llama3.1:8b"
}

Daily Usage

The app runs in your system tray:

Action How
View status Double-click tray icon or "Show Window"
Force sync Right-click → "Force Sync All"
Pause sync Right-click → "Toggle Watch"
Open vault Right-click → "Open Vault"
Settings Right-click → "Settings..."
Exit Right-click → "Exit"

Status Window:

ObsidianBridge Status Window

The status window shows real-time sync activity, colored logs, and quick actions.

AI Tagging (Optional)

If you want automatic tagging:

# Install Ollama
# https://ollama.com/download

# Pull a model
ollama pull llama3.1:8b

# Start Ollama server
ollama serve

Then enable in Settings: ENABLE_TAGGING = true


How It Works Behind The Scenes

You edit file.md in GitHub repo
         ↓
   watchdog detects change
         ↓
   Debounce wait (5s default)
         ↓
   Check collision prevention
         ↓
   Create backup
         ↓
   Rewrite WikiLinks
         ↓
   Generate AI tags (optional)
         ↓
   Write to Vault
         ↓
   Update index.md
         ↓
   Clean up backup

Using ObsidianBridge as an AI IDE Context Memory

I built this not just for syncing files, but to create a contextual brain for my AI IDE. Here's how I use it:

The Problem with AI Context

When working on multiple projects, AI assistants lose context between sessions. I needed a way to:

  • Persist knowledge across conversations
  • Search my entire codebase before answering questions
  • Maintain project memory without re-explaining everything
  • Connect ideas across different repositories

The Solution: Obsidian as a Knowledge Graph

By syncing all my GitHub projects to Obsidian, I get:

1. Persistent Memory

  • Every project, every note, every decision lives in the vault
  • AI can read the vault via MCP (Model Context Protocol)
  • Context survives across sessions and tools

2. Connected Knowledge

  • The graph view shows relationships between projects
  • Folder indexes create hierarchical structure
  • Wiki-links connect related concepts automatically

3. Searchable Context

  • Before answering, AI can search the entire vault
  • Find relevant files, past decisions, technical notes
  • No more "I don't have context about your project"

How I Set It Up

GitHub Repos → ObsidianBridge → Vault → AI IDE (via MCP)
     ↑                                                    ↓
     └────────────── Context Memory ←───────────────────┘
  1. Sync all projects to the vault automatically
  2. Connect Obsidian MCP to my AI IDE
  3. AI reads vault for context before responding
  4. I write memory notes in Obsidian during work

Example Workflow

  1. Start a new session with AI
  2. AI queries vault: "What do I know about this project?"
  3. Finds: index_project.mddocs/architecture.md
  4. AI has full context: tech stack, decisions, current status
  5. We continue work without re-explaining

The Key Insight

Your vault becomes a second brain that:

  • Survives across AI sessions
  • Connects all your projects visually
  • Provides instant context retrieval
  • Grows smarter as you work

This isn't just file syncing - it's building a knowledge infrastructure for AI-assisted development.

What the connected graph looks like:

Obsidian Graph View - Connected Knowledge

Each hub represents a project, with folder indexes creating the structure that connects everything together.


Distribution Options

Method Command Best For
Python python ObsidianBridge.py Development
Batch Launch ObsidianBridge.bat Quick start
Shortcuts python create_shortcuts.py Desktop/Start Menu
EXE python build_exe.py Sharing with others

Important Things to Know

One-Way Sync Only:

  • Edit in GitHub → Appears in Obsidian
  • Edit in Obsidian → Does NOT sync back

Vault Contains Processed Copies:

  • Vault files are copies, not live connections
  • No git history or version control in vault
  • Links are rewritten for Obsidian compatibility
  • Index files are auto-generated for navigation

This prevents conflicts and keeps GitHub as the source of truth.

File Safety:

  • Backups created before every change (kept last 5)
  • Automatic rollback on sync failure
  • File size limits (10MB default) skip huge files

Troubleshooting

Issue Solution
App won't start Check sync_log.txt for errors
"Python not found" Add Python to PATH or use EXE version
Ollama errors Set ENABLE_TAGGING: false or start ollama serve
High CPU Normal during initial sync; idle after
Links broken Enable PRESERVE_STRUCTURE: true

License

MIT License - Use, modify, distribute freely.

About

Turn your codebase into a living knowledge system inside Obsidian

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors