<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Haider Ali</title>
    <description>The latest articles on DEV Community by Haider Ali (@haiderstudio).</description>
    <link>https://dev.to/haiderstudio</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4234625%2Fe1a1ae92-c116-4b91-9725-7067df8a4313.jpg</url>
      <title>DEV Community: Haider Ali</title>
      <link>https://dev.to/haiderstudio</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/haiderstudio"/>
    <language>en</language>
    <item>
      <title>Broken links in docs are silent. This Python CLI names the broken kind.</title>
      <dc:creator>Haider Ali</dc:creator>
      <pubDate>Mon, 09 Nov 2026 18:25:20 +0000</pubDate>
      <link>https://dev.to/haiderstudio/broken-links-in-docs-are-silent-this-python-cli-names-the-broken-kind-16li</link>
      <guid>https://dev.to/haiderstudio/broken-links-in-docs-are-silent-this-python-cli-names-the-broken-kind-16li</guid>
      <description>&lt;p&gt;You update a docs page, move a file, rename a heading. Nothing breaks loudly. A reader clicks a link weeks later and lands on a 404 — or worse, on the right page with the wrong anchor, staring at the top while the section they wanted is three screens down.&lt;/p&gt;

&lt;p&gt;Most link checkers give you one word: broken. This one tells you which kind of broken, because the fix is different.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;broken-link-checker-cli&lt;/code&gt; is a Python CLI. Standard library only. It scans &lt;code&gt;.md&lt;/code&gt;, &lt;code&gt;.markdown&lt;/code&gt; and &lt;code&gt;.html&lt;/code&gt; files, checks every link for real, and reports each link as one of three things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;OK&lt;/code&gt; — the page exists, and the anchor on it exists too.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;BROKEN (page)&lt;/code&gt; — the page itself is missing.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;BROKEN (anchor)&lt;/code&gt; — the page exists, the anchor on it does not.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A link is never reported OK unless its check actually ran. If an anchor cannot be checked (a PDF, for example), the link is reported &lt;code&gt;SKIPPED&lt;/code&gt; with the reason — never silently OK. Links inside fenced code blocks and inline code are ignored, so code samples never produce false failures. &lt;code&gt;mailto:&lt;/code&gt; and &lt;code&gt;tel:&lt;/code&gt; links are skipped, not flagged.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;broken-link-checker-cli
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Point it at your docs folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;broken-link-checker docs/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The repo ships with an &lt;code&gt;examples/&lt;/code&gt; folder you can try first — one link in there is deliberately broken:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/haiderstudio/broken-link-checker-cli.git
&lt;span class="nb"&gt;cd &lt;/span&gt;broken-link-checker-cli
broken-link-checker examples/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Real output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;examples/sample-docs.md:3: other-page.md -&amp;gt; OK
examples/sample-docs.md:5: #sample-docs -&amp;gt; OK
examples/sample-docs.md:8: missing-page.md -&amp;gt; BROKEN (page) (file does not exist)
2 ok, 1 broken, 0 skipped
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remote links are checked with HEAD, falling back to GET where a server refuses HEAD. If a remote link has an anchor, the fetched page must carry that &lt;code&gt;id&lt;/code&gt; or &lt;code&gt;name&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Useful flags
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Local files only — works fully offline&lt;/span&gt;
broken-link-checker &lt;span class="nt"&gt;--local-only&lt;/span&gt; docs/

&lt;span class="c"&gt;# Machine-readable output for CI&lt;/span&gt;
broken-link-checker &lt;span class="nt"&gt;--format&lt;/span&gt; json docs/

&lt;span class="c"&gt;# Skip URLs matching a pattern (repeatable)&lt;/span&gt;
broken-link-checker &lt;span class="nt"&gt;--exclude&lt;/span&gt; &lt;span class="s1"&gt;'example\.com'&lt;/span&gt; docs/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Exit code 0 means no broken links, 1 means at least one broken link, 2 means a usage error such as a missing path — so it drops straight into CI as a gate.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does not do
&lt;/h2&gt;

&lt;p&gt;It does not rewrite any file, follow JavaScript-rendered pages, or log in anywhere. It only reads and reports. It does not send your docs anywhere — remote checks are plain requests to the linked URL itself.&lt;/p&gt;

&lt;p&gt;I built it because every docs check I tried either needed a service, a Node install, or reported "broken" without saying which part was broken. This one is one file, stdlib only, and the output tells you exactly what to fix.&lt;/p&gt;

&lt;p&gt;The repo is MIT licensed: &lt;a href="https://github.com/haiderstudio/broken-link-checker-cli" rel="noopener noreferrer"&gt;https://github.com/haiderstudio/broken-link-checker-cli&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If it catches a broken link in your docs, a star helps other people find it.&lt;/p&gt;

</description>
      <category>python</category>
      <category>cli</category>
      <category>opensource</category>
      <category>github</category>
    </item>
  </channel>
</rss>
