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
| Option | Default | Description |
|---|---|---|
--root <path> | . | Project root directory |
--tsconfig <path> | auto-detected | Path to tsconfig.json |
--pattern <glob> | **/*.controller.ts | Glob pattern to find controllers |
--format <format> | ts | Docs file format to look for: ts or js |
--quiet | false | Suppress 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 checkOr as an npm script:
json
{
"scripts": {
"docs:check": "nestjs-docfy check"
}
}