Skip to content

bwrb audit

Validate vault files against schema and report issues, with optional interactive repair.

Terminal window
bwrb audit [options] [target]

The target argument is auto-detected as type, path (contains /), or where expression.

OptionDescription
-t, --type <type>Filter by type path
-p, --path <glob>Filter by file path pattern
-w, --where <expr>Filter by frontmatter expression (repeatable)
-b, --body <query>Filter by body content
OptionDescription
--only <issue-type>Only report specific issue type
--ignore <issue-type>Ignore specific issue type
--strictTreat unknown fields as errors instead of warnings
--allow-field <fields>Allow additional fields beyond schema (repeatable)
OptionDescription
--fixInteractive repair mode
--autoWith --fix: automatically apply unambiguous fixes
OptionDescription
-o, --output <format>Output format: text, json
TypeDescription
orphan-fileFile in managed directory but no type field
invalid-typeType field value not recognized in schema
missing-requiredRequired field is missing
invalid-enumField value not in allowed enum values
unknown-fieldField not defined in schema (warning by default)
wrong-directoryFile location doesn’t match its type’s output_dir
format-violationField value doesn’t match expected format (wikilink, etc.)
stale-referenceWikilink points to non-existent file
Terminal window
# Check all files (report only)
bwrb audit
# Check only tasks
bwrb audit --type objective/task
# Check specific directory
bwrb audit --path "Ideas/**"
# Check files with specific status
bwrb audit --where "status=active"
# Check files containing TODO
bwrb audit --body "TODO"
Terminal window
# Only missing required fields
bwrb audit --only missing-required
# Ignore unknown fields
bwrb audit --ignore unknown-field
# Strict mode: unknown fields are errors
bwrb audit --strict
# Allow specific extra fields
bwrb audit --allow-field custom --allow-field legacy
Terminal window
# Interactive fix mode
bwrb audit --fix
# Auto-apply unambiguous fixes
bwrb audit --fix --auto
Terminal window
# JSON output for CI
bwrb audit --output json
# Fail build on schema violations
bwrb audit --output json || exit 1

Audit resolves each file’s type from its frontmatter type field:

  • If type is missing: reports orphan-file and skips type-dependent checks
  • If type is invalid: reports invalid-type and skips type-dependent checks
  • Type-dependent checks (missing-required, invalid-enum, wrong-directory) require valid type resolution

Use --type to filter by type; it does not fix missing type fields.

CodeMeaning
0No violations found
1Violations found