Vault Linker
Overview
Obsidian Linker is a tool designed to help you manage and link your notes in Obsidian. It provides various features to enhance your note-taking experience.
Linking
Features
- Automatic linking of notes
- Uses Wikilink format
- Skip links in metadata
- Skip links in codeblocks, inline code
Linking Process
- Scan Files: The tool scans all the markdown files in your Obsidian vault.
- Extract Filenames: It extracts the filenames from the scanned files.
- Match Filenames: It matches the filenames with the content in other files, ignoring the case.
- Insert Links: When a match is found, it inserts a Wikilink in the content, preserving the original case of the filename in the link.
- Skip Metadata and Code: The tool skips adding links in metadata sections and code blocks to avoid unwanted linking.
Examples
- Simple Linking: If a file named
Object-Oriented Programming.mdexists and another file mentions "object-oriented programming", the tool will link it as[[object-oriented programming]]. - Preserve Case: If the mention is "Object-Oriented Programming", the link will be
[[Object-Oriented Programming]]. - No Links in Code Blocks: Mentions inside code blocks are ignored.
- No Links in Metadata: Mentions inside metadata sections are ignored.
- Multiple Links: If multiple files are mentioned, each will be linked appropriately.
- Partial Matches: If a file named
Object.mdexists, mentions of "object" will be linked as[[object]], but "objects" will not be linked. - Complex Linking: If files named
Object-Oriented Programming.md,Functional Programming.md, andObject.mdexist, and another file mentions "object-oriented programming", "functional programming", and "object", each will be linked as[[object-oriented programming]],[[functional programming]], and[[object]]respectively. Note "object" will not be added inside "object-oriented programming".
Installation
From PyPI
Package: vaultlinker on PyPI
pip install vaultlinker
vaultlinker /path/to/vault/ --help
# or: obsidian-linker /path/to/vault/ --help
From source
Clone the repository and install the package (recommended):
git clone https://github.com/arshad115/obsidian-linker.git
cd obsidian-linker
pip install -e ".[dev]"
For a quick script-only install without the console command:
pip install -r requirements.txt
Usage
After installation:
obsidian-linker /path/to/vault/
Or run the module directly:
python obsidianlinker.py /path/to/vault/
Use -v / --verbose for progress bars and scan details (default is quiet except warnings and the summary).
Parallel processing (read, link, and write phases):
obsidian-linker /path/to/vault/ --jobs 8
obsidian-linker /path/to/vault/ --jobs 0 # automatic worker count
Safety options
Preview changes without writing files:
python obsidianlinker.py /path/to/vault/ --dry-run
Write linked copies to another directory (vault files stay unchanged):
python obsidianlinker.py /path/to/vault/ --output /path/to/linked-vault/
Create a .bak copy of each file before overwriting it in the vault:
python obsidianlinker.py /path/to/vault/ --backup
Skip linking a note's title inside its own file (e.g. do not turn README into [[README]] in README.md):
python obsidianlinker.py /path/to/vault/ --no-self-links
By default, markdown under .obsidian, .git, attachments, and similar folders is skipped. Add more directory names with --exclude DIRNAME, or pass --no-default-excludes to scan everything.
Limit which notes are processed with vault-relative globs:
obsidian-linker /path/to/vault/ --include-glob 'notes/**' --exclude-glob 'templates/**'
Obsidian-aware linking
- Aliases: YAML
alias/aliasesin front matter are link phrases; matches use[[Note Title|alias]]when the visible text differs from the note title. - Embeds & markdown links: Text inside
![[...]]and[label](url)is not linked. - Headings: Text on
# headinglines is skipped unless you pass--link-headings. - Duplicate filenames: If two notes share the same filename in different folders, the tool warns and uses the note with the longest path as the link target for that title.
--use-headings: Also link phrases taken from each note's first# H1heading.--no-aliases: Only use filenames, not front matter aliases.
Audit and unlink
Audit the vault (no file changes):
obsidian-linker /path/to/vault/ --audit
obsidian-linker /path/to/vault/ --audit -v # include pending link details
Reports pending links (same rules as a dry run), broken [[wikilinks]] with no matching note, notes with zero incoming links, and the most-linked titles.
Remove wikilinks that this tool would create (title and alias forms only; manual links to other targets are kept):
obsidian-linker /path/to/vault/ --unlink --dry-run
obsidian-linker /path/to/vault/ --unlink --backup
Incremental and blocklist
Re-run only notes that changed since the last successful incremental run (state is stored in .obsidian/obsidian-linker-state.json). If notes are added or removed, every note is processed again so new titles can link correctly.
obsidian-linker /path/to/vault/ --incremental
Skip noisy short titles or specific words:
obsidian-linker /path/to/vault/ --ignore-phrase README --min-title-length 4
obsidian-linker /path/to/vault/ --ignore-file ./linker-ignore.txt
Obsidian plugin
A community plugin lives in plugin/ (source); manifest.json, versions.json, and main.js are at the repo root for Obsidian’s directory scanner. Build with cd plugin && npm install && npm run build, then submit via community.obsidian.md. See plugin/README.md and PUBLISHING.md.
Make sure to back up your vault before using this tool, as in-place runs can make irreversible edits unless you use --dry-run or --output.
Running Tests
To run tests for Obsidian Linker, use the following command:
pytest
This will execute all the tests and provide you with a summary of the results. Make sure you have all the necessary dependencies installed before running the tests.
TODO
- Add support for alias links
- Multithreading
- Write additional tests for edge cases
- Make it into a plugin for Obsidian
Contributors
Contributing
We welcome contributions to Obsidian Linker! If you have an idea for a new feature or have found a bug, please open an issue or submit a pull request.
Steps to Contribute
- Fork the repository.
- Create a new branch for your feature or bugfix:
git checkout -b feature-name
- Make your changes and commit them:
git commit -m "Description of your changes"
- Push your changes to your fork:
git push origin feature-name
- Open a pull request on the main repository.
License
This project is licensed under the MIT License. See the LICENSE file for more details. © Arshad Mehmood
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 vaultlinker-0.4.3.tar.gz.
File metadata
- Download URL: vaultlinker-0.4.3.tar.gz
- Upload date:
- Size: 20.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b1ec10fb38b3f3903f944f35780d9ae90dd3007d52c8aa7c1e326b2fbb24d81
|
|
| MD5 |
2da3d720c14674f8c39de7b50bfd8aec
|
|
| BLAKE2b-256 |
5f9515282c5451b94504768b4d6df1e0cf4d37c3e468295c43cd363fc72da486
|
Provenance
The following attestation bundles were made for vaultlinker-0.4.3.tar.gz:
Publisher:
release.yml on arshad115/obsidian-linker
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vaultlinker-0.4.3.tar.gz -
Subject digest:
1b1ec10fb38b3f3903f944f35780d9ae90dd3007d52c8aa7c1e326b2fbb24d81 - Sigstore transparency entry: 2864901727
- Sigstore integration time:
-
Permalink:
arshad115/obsidian-linker@39be1e5c11a9a2c2354b8dee8cbd597ec99b355b -
Branch / Tag:
refs/tags/0.4.3 - Owner: https://github.com/arshad115
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@39be1e5c11a9a2c2354b8dee8cbd597ec99b355b -
Trigger Event:
push
-
Statement type:
File details
Details for the file vaultlinker-0.4.3-py3-none-any.whl.
File metadata
- Download URL: vaultlinker-0.4.3-py3-none-any.whl
- Upload date:
- Size: 21.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d7852345b0c19abfe11342f75c57a9baf95b504733fa2caf2b20af653b7ece7
|
|
| MD5 |
7320faf68c2d0d91ce6aeb24dc57614f
|
|
| BLAKE2b-256 |
5f3cb7adff3ecc020c25071949602c273a2549384f600ac25898eb8599a31c45
|
Provenance
The following attestation bundles were made for vaultlinker-0.4.3-py3-none-any.whl:
Publisher:
release.yml on arshad115/obsidian-linker
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vaultlinker-0.4.3-py3-none-any.whl -
Subject digest:
6d7852345b0c19abfe11342f75c57a9baf95b504733fa2caf2b20af653b7ece7 - Sigstore transparency entry: 2864901826
- Sigstore integration time:
-
Permalink:
arshad115/obsidian-linker@39be1e5c11a9a2c2354b8dee8cbd597ec99b355b -
Branch / Tag:
refs/tags/0.4.3 - Owner: https://github.com/arshad115
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@39be1e5c11a9a2c2354b8dee8cbd597ec99b355b -
Trigger Event:
push
-
Statement type: