docfy check

Verifies every controller is fully documented before merging. Exits with code 1 if any drift is detected, designed for CI.

Usage

bash
npx nestjs-docfy check [options]

Options

OptionDefaultDescription
--root <path>.Project root directory
--tsconfig <path>auto-detectedPath to tsconfig.json
--pattern <glob>**/*.controller.tsGlob pattern to find controllers
--format <format>tsDocs file format to look for: ts or js
--quietfalseSuppress all output except errors

What it checks

  • Controllers with HTTP methods but no companion docs file
  • Controllers that gained methods since the last generate

Example output

text
✖ UsersController, undocumented methods: updateProfile, deleteAccount
  → run nestjs-docfy generate --force to merge new methods

✖ 2 controller(s) out of sync.

CI integration

.github/workflows/*.yml
# GitHub Actions example
- name: Check docs are up to date
  run: npx nestjs-docfy check

Or as an npm script:

json
{
  "scripts": {
    "docs:check": "nestjs-docfy check"
  }
}