Sync Obsidian vault to GitHub with wiki-link transformation
Project description
ob-sync
A CLI tool to sync your Obsidian vault to a GitHub repository with automatic wiki-link transformation.
Features
- 🔄 Sync Obsidian notes to a GitHub repository
- 🖼️ Transform wiki-style image links (
![[image.png]]) to raw GitHub URLs - ⚡ Incremental sync - only processes changed files (using MD5 hashes)
- 📤 Auto-push to GitHub after sync using local ssh keys (super simple)
Installation
From PyPI
pip install ob-sync
From source
git clone https://github.com/sounak07/obsidian-transformer.git
cd obsidian-transformer
pip install .
Development install
pip install -e .
Configuration
ob-sync requires a configuration file at ~/.config/ob-sync/config.yaml.
Setup
-
Create the config directory:
mkdir -p ~/.config/ob-sync
-
Create the config file:
touch ~/.config/ob-sync/config.yaml -
Add your configuration (see example below)
Configuration File
# Path to your Obsidian vault folder
vault_path: "~/Documents/Obsidian/MyVault"
# GitHub repository configuration
github:
username: "your-github-username"
repo: "your-repo-name"
branch: "main" # optional, defaults to "main"
# Path to your attachments folder (images, PDFs, etc.)
attachments_folder: "~/Documents/Obsidian/MyVault/assets"
# Output directory (your cloned GitHub repo)
output_path: "~/Documents/Projects/your-repo-name"
# Subdirectory for assets in the output repo
output_path_resources: "assets"
# Files to include (glob patterns)
include:
- "**/*.md"
# Files to exclude (glob patterns)
exclude:
- "**/Templates/**"
- "**/Daily/**"
- "**/.obsidian/**"
- "**/Excalidraw/**"
Configuration Options
| Option | Required | Description |
|---|---|---|
vault_path |
✅ | Absolute path to your Obsidian vault |
github.username |
✅ | Your GitHub username |
github.repo |
✅ | Target repository name |
github.branch |
❌ | Branch name (default: main) |
attachments_folder |
✅ | Path to folder containing images/attachments |
output_path |
✅ | Path to your local clone of the GitHub repo |
output_path_resources |
✅ | Subdirectory for assets in output |
include |
❌ | Glob patterns for files to include (default: **/*.md) |
exclude |
❌ | Glob patterns for files to exclude |
Usage
Sync your vault
ob-sync sync
This will:
- Find all markdown files matching your include/exclude patterns
- Transform wiki-style image links to GitHub raw URLs
- Copy transformed files to your output directory
- Copy referenced images to the assets folder
- Commit and push changes to GitHub
Sync without pushing
ob-sync sync --no-push
Sync with custom commit message
ob-sync sync -m "Updated notes on Docker"
Check sync status
ob-sync status
Shows:
- Vault path and existence
- Output path and existence
- Git branch and status
- GitHub repository info
Show version
ob-sync --version
Show help
ob-sync --help
ob-sync sync --help
How It Works
Wiki-Link Transformation
ob-sync automatically transforms Obsidian wiki-style image links:
Before (Obsidian):
![[my-diagram.png]]
After (GitHub-compatible):

Incremental Sync
ob-sync tracks file hashes in .sync-hashes.json to avoid re-processing unchanged files. Only modified files are transformed and copied.
Prerequisites
- Python 3.9+
- Git installed and configured
- GitHub repository cloned locally (at
output_path) - SSH keys or credentials configured for Git push
Dependencies
- click - CLI framework
- GitPython - Git operations
- PyYAML - YAML config parsing
- pathspec - Glob pattern matching
License
MIT
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ob_sync-0.1.1.tar.gz.
File metadata
- Download URL: ob_sync-0.1.1.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe61be87a423b4e89b7223552a1572215a383d7fd0a874b72700f43538493eeb
|
|
| MD5 |
caa3fa8d036fe6f68e512e9be0c6effd
|
|
| BLAKE2b-256 |
cb368aabb5229bc4a4a5a67a8d0671b53f78af20499f1ec23b1ff02ca2fcaace
|
Provenance
The following attestation bundles were made for ob_sync-0.1.1.tar.gz:
Publisher:
publish.yml on sounak07/obsidian-transformer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ob_sync-0.1.1.tar.gz -
Subject digest:
fe61be87a423b4e89b7223552a1572215a383d7fd0a874b72700f43538493eeb - Sigstore transparency entry: 781461642
- Sigstore integration time:
-
Permalink:
sounak07/obsidian-transformer@a0902114049efdf5c0e2755ca9dff408decf397f -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/sounak07
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a0902114049efdf5c0e2755ca9dff408decf397f -
Trigger Event:
push
-
Statement type:
File details
Details for the file ob_sync-0.1.1-py3-none-any.whl.
File metadata
- Download URL: ob_sync-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb34b4b8ee3266310e2e9f2997c0f3b7a8f95eb157771329d69575bf83685782
|
|
| MD5 |
756825d4fbc8fc7c6ba5fb128fe17f13
|
|
| BLAKE2b-256 |
89ac2abc908293f025204c58f8a518a5d92befbdbfb2a475157e58a818f9b223
|
Provenance
The following attestation bundles were made for ob_sync-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on sounak07/obsidian-transformer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ob_sync-0.1.1-py3-none-any.whl -
Subject digest:
fb34b4b8ee3266310e2e9f2997c0f3b7a8f95eb157771329d69575bf83685782 - Sigstore transparency entry: 781461646
- Sigstore integration time:
-
Permalink:
sounak07/obsidian-transformer@a0902114049efdf5c0e2755ca9dff408decf397f -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/sounak07
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a0902114049efdf5c0e2755ca9dff408decf397f -
Trigger Event:
push
-
Statement type: