Skip to content

bwrb schema

Inspect and manage your vault’s schema definition.

Terminal window
bwrb schema <subcommand>
SubcommandDescription
listList schema contents
validateValidate schema structure
diffShow pending schema changes
migrateApply schema changes to notes
historyShow migration history
Terminal window
# List all types
bwrb schema list
# Show specific type details
bwrb schema list type task
# Validate schema structure
bwrb schema validate
# Preview migration
bwrb schema diff
# Apply migration
bwrb schema migrate --execute

List schema contents including types, fields, and detailed type information.

Terminal window
bwrb schema list [options]
bwrb schema list types [options]
bwrb schema list fields [options]
bwrb schema list type [options] <name>
SubcommandDescription
(none)Show full schema overview
typesList type names only
fieldsList all fields across all types
type <name>Show details for a specific type
OptionDescription
-o, --output <format>Output format: text, json
Terminal window
# Show full schema overview
bwrb schema list
# List all type names
bwrb schema list types
# List all fields across types
bwrb schema list fields
# Show details for a specific type
bwrb schema list type task
bwrb schema list type objective/milestone
# JSON output for scripting
bwrb schema list --output json
bwrb schema list type task --output json

Validate your schema.json file for structural correctness.

Terminal window
bwrb schema validate [options]
OptionDescription
-o, --output <format>Output format: text, json

Validates the schema.json file against the expected structure:

  • Required fields are present
  • Field types are valid
  • Enum values are properly defined
  • Type hierarchies are consistent
  • Output directories are specified
Terminal window
# Validate schema
bwrb schema validate
# JSON output for CI
bwrb schema validate --output json
CodeMeaning
0Schema is valid
1Validation errors found

Show changes to the schema since the last migration.

Terminal window
bwrb schema diff [options]
OptionDescription
-o, --output <format>Output format: text, json

Compares the current schema.json against the last migration snapshot to show:

  • New types added
  • Types removed
  • Fields added to types
  • Fields removed from types
  • Field definitions changed
  • Enum values changed
Terminal window
# Show what changed
bwrb schema diff
# JSON output for scripting
bwrb schema diff --output json
  1. Make changes to .bwrb/schema.json
  2. Run bwrb schema diff to preview changes
  3. Run bwrb schema migrate to apply changes to existing notes

Apply schema changes to existing notes in your vault.

Terminal window
bwrb schema migrate [options]
OptionDescription
-x, --executeActually apply the migration (default is dry-run)
--no-backupSkip backup creation (not recommended)
-o, --output <format>Output format: text, json

Migrations update existing notes when the schema changes:

  • Add new required fields with default values
  • Remove deleted fields
  • Rename fields
  • Update enum values
  • Move files to new output directories
  • Dry-run by default: Shows what would change without modifying files
  • Automatic backup: Creates a backup before applying changes
  • Atomic operations: All changes succeed or none are applied
Terminal window
# Preview migration (dry-run)
bwrb schema migrate
# Apply migration with backup
bwrb schema migrate --execute
# Apply without backup (not recommended)
bwrb schema migrate --execute --no-backup
  1. Make changes to .bwrb/schema.json
  2. Run bwrb schema diff to preview changes
  3. Run bwrb schema migrate to preview note updates
  4. Run bwrb schema migrate --execute to apply

View the history of schema migrations applied to your vault.

Terminal window
bwrb schema history [options]
OptionDescription
--limit <n>Number of entries to show (default: 10)
-o, --output <format>Output format: text, json

Shows a log of all migrations that have been applied:

  • Migration timestamp
  • Changes included
  • Files affected
Terminal window
# Show migration history
bwrb schema history
# Show last 5 migrations
bwrb schema history --limit 5
# JSON output
bwrb schema history --output json