Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Automatically Check Obsidian for Broken Links with lychee

说明与用途

使用 lychee 自动检查 Obsidian 中的内部链接,结合相对 Markdown 链接、pre‑commit 钩子和 GitHub Actions。

问题

Renaming or deleting notes in Obsidian can leave broken links that are hard to detect manually.

结果

The vault is automatically scanned for broken links, with failures reported in the terminal, pre‑commit aborts commits, and CI prevents PR merges until links are fixed.

工作流

  • Configure Obsidian to use relative Markdown links
  • Install lychee via Homebrew or curl
  • Create a .lycheeignore or lychee.toml to exclude non‑vault files
  • Run lychee --offline vault/ to scan locally
  • Set up a pre‑commit hook with pre‑commit to run lychee on every commit
  • Add a GitHub Actions workflow to run lychee in CI

证据

When you manage notes in Obsidian, renaming or deleting notes can leave broken links behind.

来源

Obsidian's default wiki-link format [[note]] is not supported. To check links with lychee, you need to use standard Markdown link syntax.

来源

lychee --offline vault/

来源

Now the link check runs automatically on every commit, and the commit will be aborted if any broken links are found.

来源

Running the link check in CI catches problems before a PR is merged.

来源

  • 记录日期: 2026-10-13T16:55:59.193Z