Both validate and fix commands provide color-coded output with consistent formatting to help you quickly identify issues and track progress. Messages use standardized colors (errors in red, warnings in yellow, success in green, etc.) and contextual emoji indicators for improved readability.
Validate all CODE_REF references in your documentation:
npx docs-coderef validateYou can specify files or directories to validate:
# Validate a specific file
npx docs-coderef validate docs/README.md
# Validate a specific directory
npx docs-coderef validate docs/backend/
# Validate multiple files/directories
npx docs-coderef validate docs/README.md docs/api/--verbose,-v: Display detailed output including reference counts per file
npx docs-coderef validate --verboseFix errors interactively with colored diffs:
npx docs-coderef fixThis will prompt you for each error with options to apply the fix or skip.
--auto: Automatically apply all fixes without prompting for confirmation
npx docs-coderef fix --auto--dry-run: Simulate fixes without making actual changes (useful for testing)
npx docs-coderef fix --dry-run--backup: Create backup files before applying fixes (default: no backup)
npx docs-coderef fix --backup--verbose,-v: Display detailed output during the fix process
npx docs-coderef fix --verboseYou can combine multiple options:
# Auto-fix with backup
npx docs-coderef fix --auto --backup
# Dry run with verbose output
npx docs-coderef fix --dry-run --verboseBoth commands return appropriate exit codes:
0: Success (no errors found or all fixes applied)1: Errors found (validate) or fixes failed (fix)