Skip to content

CLI tool + GitHub Action that checks every .md file in your project is linked from the root README. Scans, classifies, and auto-fixes isolated documentation files. Rich terminal dashboard included.

License

Notifications You must be signed in to change notification settings

Maneesh-Relanto/MD-Files-Connector

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

15 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“‹ MD Files Connector

CI GitHub Marketplace GitHub release Python 3.11+ License: MIT Works with any language

A lightweight CLI tool + GitHub Action that scans your project for Markdown files and tells you which ones are referenced in your root README โ€” and which ones are isolated and invisible to readers.

Every .md file โ€” including nested README.md files in sub-directories โ€” must be linked from the root README.md to be considered covered. This keeps your root README the single source of truth for all project documentation.


Why?

As projects grow, docs accumulate. CONTRIBUTING.md, ARCHITECTURE.md, docs/API.md โ€” they get written and then forgotten. This tool keeps your README honest.


Features

  • ๐Ÿ” Recursively scans your entire project for .md files
  • ๐Ÿ“– Checks coverage against the root README.md only (strict mode)
  • โœ… Classifies each file as linked or isolated
  • ๐Ÿ“Š Outputs a terminal dashboard with coverage stats
  • ๐Ÿ“„ Generates an MD_REPORT.md with a full breakdown
  • ๐Ÿค– Runs as a GitHub Action on every push or PR
  • ๏ฟฝ Interactive fix menu โ€” auto-links isolated files into your README
  • ๐Ÿ’ก No install, no config โ€” one file, one command
  • ๐ŸŒ Language agnostic โ€” works with any project regardless of tech stack

๐Ÿ”’ Privacy & Security

  • Nothing leaves your machine. The tool reads file paths and Markdown content locally to build the coverage report. No data is collected, transmitted, or stored anywhere outside your project.
  • No code is read or copied. Only .md files are scanned โ€” your source code, configs, and secrets are never touched.
  • No network calls. The CLI runs entirely offline. The GitHub Action only uses the GitHub-provided runner environment; it does not call any external service.
  • Read-only by default. The tool never modifies any file unless you explicitly choose a fix option (G or D) in the interactive menu โ€” and even then, only your root README.md is updated.
  • Open source. The full source is a single readable file โ€” md_connector.py. You can audit every line before running it.

๐Ÿš€ Quickest Way to Start โ€” 60 seconds

No package manager. No install. Just copy one file.

Step 1 โ€” Download the script into your project

# with curl
curl -O https://raw.githubusercontent.com/Maneesh-Relanto/MD-Files-Connector/main/md_connector.py

# or with wget
wget https://raw.githubusercontent.com/Maneesh-Relanto/MD-Files-Connector/main/md_connector.py

Or just download md_connector.py and drop it anywhere in your project.

Step 2 โ€” Install the only dependency

pip install rich

rich is optional โ€” the tool works without it (plain text output). But you want it for the coloured dashboard.

Step 3 โ€” Run it

# scan current directory
python md_connector.py .

# scan a specific project
python md_connector.py /path/to/your/project

# skip writing MD_REPORT.md
python md_connector.py . --no-report

That's it. You'll see a dashboard, a report file, and an interactive prompt to fix any isolated files.


๐Ÿค– Add to CI โ€” GitHub Action

Paste this into .github/workflows/md-check.yml in your repo:

name: MD Files Connector Check

on:
  push:
    paths: ["**.md"]
  pull_request:
    paths: ["**.md"]

jobs:
  md-check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Run MD Files Connector
        id: md-connector
        uses: Maneesh-Relanto/MD-Files-Connector@v1
        with:
          project-root: "."
          exclude-dirs: "node_modules .git venv .venv __pycache__ dist build"
          report-path: "MD_REPORT.md"

      - name: Show coverage summary
        run: |
          echo "Coverage : ${{ steps.md-connector.outputs.coverage }}%"
          echo "Isolated : ${{ steps.md-connector.outputs.isolated-files }} file(s)"

On every push or PR that touches a .md file, the action will:

  1. Scan your repo for all Markdown files
  2. Check which ones are linked from your root README.md
  3. Post a summary to the GitHub Actions step summary panel
  4. Upload MD_REPORT.md as a downloadable artifact

Action Inputs

Input Description Default
project-root Root directory to scan .
exclude-dirs Space-separated dirs to skip node_modules .git venv ...
report-path Output path for MD report MD_REPORT.md
skip-report Skip generating report file false
fail-on-isolated Exit code 1 if isolated files found false

Action Outputs

Output Description
total-md-files Total MD files found (excl. root README)
linked-files Files referenced in root README
isolated-files Files NOT in root README
coverage Percentage linked

๐Ÿ“‹ Sample Output

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ ๐Ÿ“‹ MD Files Connector                                 โ”‚
โ”‚ Project root: /my-project                             โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

  ๐Ÿ“„ Root README                        README.md
  ๐Ÿ“ Total MD files (excl. root README)  7
  โœ… Linked in root README               5
  โš ๏ธ  Isolated (not in root README)       2
  ๐Ÿ“Š README coverage                    71.4%

โ•ญโ”€ โœ… Linked Files โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ

  #  File                       Title             Words  Sections
  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
  1  docs/CONTRIBUTING.md       Contributing      210    Setup, Guidelines
  2  docs/ARCHITECTURE.md       Architecture      540    Overview, Components
  ...

โ•ญโ”€ โš ๏ธ  Isolated Files โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ

  #  File                  Title          Words  First line / description
  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
  1  docs/OLD_API.md        Old Api        890    Deprecated. Use v2 API.
  2  SCRATCH_NOTES.md       Scratch Notes   42    Notes from planning sess

๐Ÿ’ก Add these to your root README.md to improve discoverability.

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ ๐Ÿ”ง  Fix isolated files?                 โ”‚
โ”‚ 2 file(s) are not linked in README.md   โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

  [G]  Generic  Append a new "๐Ÿ“Ž Other Documentation" section
  [D]  Docs     Looks for any heading matching "docs / documentation"
  [M]  Manual   I'll update the README myself โ€” no changes made

  Enter choice (G / D / M):

๐Ÿ”ง Fix Options

When isolated files are found, the tool prompts you interactively:

Option What it does
G โ€” Generic Appends a ## ๐Ÿ“Ž Other Documentation section at the end of your README with all missing links
D โ€” Docs Finds the first heading in your README that contains the word doc or documentation and appends the missing links there
M โ€” Manual Does nothing โ€” you handle it yourself

The fix menu only appears in an interactive terminal. It is automatically skipped in CI.


โš™๏ธ CLI Reference

usage: md_connector.py [-h] [--exclude [...]] [--report REPORT] [--no-report] [root]

positional arguments:
  root               Project root directory (default: current directory)

options:
  --exclude [...]    Directory names to exclude from scan
  --report REPORT    Output path for markdown report (default: MD_REPORT.md)
  --no-report        Skip generating the MD_REPORT.md file
  --fail-on-isolated Exit with code 1 if any isolated MD files are found

Examples:

# Scan current directory, generate report
python md_connector.py .

# Scan a specific folder, no report file
python md_connector.py /path/to/project --no-report

# Exclude extra directories
python md_connector.py . --exclude node_modules .git venv dist tests

# Save report to a custom path
python md_connector.py . --report docs/coverage-report.md

๐Ÿ“„ Generated Report

Running without --no-report writes MD_REPORT.md (into the scanned project root) containing:

  • Summary stats table (total, linked, isolated, coverage %)
  • Full linked files table with title, word count, and sections
  • Full isolated files table with content preview
  • Ready-to-paste markdown link snippets for your root README

Contributing

See CONTRIBUTING.md for development setup and guidelines.


License

MIT ยฉ 2026 Maneesh Thakur

About

CLI tool + GitHub Action that checks every .md file in your project is linked from the root README. Scans, classifies, and auto-fixes isolated documentation files. Rich terminal dashboard included.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages