A CLI tool for checking for dead links in a markdown file
Find a file
NotAShelf 013de9960d
Some checks failed
Build / build-go (push) Has been cancelled
Build / build-nix (push) Has been cancelled
docs: clean up README
2025-06-12 16:36:20 +03:00
.github ci: set up dependabot; bump go version 2025-06-12 16:14:42 +03:00
nix nix: clean up package 2025-06-12 16:36:12 +03:00
.envrc direnv 2023-12-24 21:58:33 +03:00
.gitignore ignore build artifacts 2023-12-24 21:58:57 +03:00
flake.lock flake: pin nixos-unstable 2025-06-12 16:36:07 +03:00
flake.nix flake: pin nixos-unstable 2025-06-12 16:36:07 +03:00
go.mod chore: bump deps 2025-06-12 16:29:08 +03:00
go.sum chore: bump deps 2025-06-12 16:29:08 +03:00
LICENSE Initial commit 2023-12-24 20:13:31 +03:00
main.go better worker performance 2023-12-30 00:03:15 +03:00
README.md docs: clean up README 2025-06-12 16:36:20 +03:00

🚨 mdlinkt

Practical CLI tool for detecting dead or inaccessible links in markdown files.

Usage

To check a markdown file for dead or inaccessible links

$ mdlinkt -file your-file.md
<some output here>

This will return each tested link and a summary message in an example markdown file containing 1 valid and 1 invalid file. For example, for a test.md containing https://probablynotvalid.com:

$ mdlinkt -file test.md
2023/12/12 12:00:00 ERROR Invalid link: https://probablynotvalid.com
2023/12/12 12:00:00 INFO Summary: 1 valid links, 1 invalid links

Should you want more details on the links that are scanned, you may pass the -verbose flag.

2023/12/12 12:00:00 INFO https://github.com: 200
2023/12/12 12:00:00 ERROR Invalid link: https://probablynotvalid.com
2023/12/12 12:00:00 INFO Summary: 1 valid links, 1 invalid links

Tip

In case of invalid links, the program will exit with exit code 1, making it perfect for usage in GitHub actions or other pipelines.

Performance

For a file containing 10,000 invalid links, the Hyperfine benchmark is as follows.

Command Mean [ms] Min [ms] Max [ms] Relative
mdlinkt -verbose -file links.md 822.2 ± 22.6 787.4 959.8 1.00

The test has been conducted on a Ryzen 5 3600X, at a 95 ± 5 MB/s bandwitdh speed.

Hacking

A nix flake is provided. Use direnv allow or nix develop to enter the development shell.

Contributing

PRs are always welcome.

License

Available under the GPLv3. See LICENSE for more details.