bwrb schema
Inspect and manage your vault’s schema definition.
Synopsis
Section titled “Synopsis”bwrb schema <subcommand>Subcommands
Section titled “Subcommands”| Subcommand | Description |
|---|---|
| list | List schema contents |
| validate | Validate schema structure |
| diff | Show pending schema changes |
| migrate | Apply schema changes to notes |
| history | Show migration history |
Quick Examples
Section titled “Quick Examples”# List all typesbwrb schema list
# Show specific type detailsbwrb schema list type task
# Validate schema structurebwrb schema validate
# Preview migrationbwrb schema diff
# Apply migrationbwrb schema migrate --executeList schema contents including types, fields, and detailed type information.
Synopsis
Section titled “Synopsis”bwrb schema list [options]bwrb schema list types [options]bwrb schema list fields [options]bwrb schema list type [options] <name>Subcommands
Section titled “Subcommands”| Subcommand | Description |
|---|---|
| (none) | Show full schema overview |
types | List type names only |
fields | List all fields across all types |
type <name> | Show details for a specific type |
Options
Section titled “Options”| Option | Description |
|---|---|
-o, --output <format> | Output format: text, json |
Examples
Section titled “Examples”# Show full schema overviewbwrb schema list
# List all type namesbwrb schema list types
# List all fields across typesbwrb schema list fields
# Show details for a specific typebwrb schema list type taskbwrb schema list type objective/milestone
# JSON output for scriptingbwrb schema list --output jsonbwrb schema list type task --output jsonvalidate
Section titled “validate”Validate your schema.json file for structural correctness.
Synopsis
Section titled “Synopsis”bwrb schema validate [options]Options
Section titled “Options”| Option | Description |
|---|---|
-o, --output <format> | Output format: text, json |
Description
Section titled “Description”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
Examples
Section titled “Examples”# Validate schemabwrb schema validate
# JSON output for CIbwrb schema validate --output jsonExit Codes
Section titled “Exit Codes”| Code | Meaning |
|---|---|
0 | Schema is valid |
1 | Validation errors found |
Show changes to the schema since the last migration.
Synopsis
Section titled “Synopsis”bwrb schema diff [options]Options
Section titled “Options”| Option | Description |
|---|---|
-o, --output <format> | Output format: text, json |
Description
Section titled “Description”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
Examples
Section titled “Examples”# Show what changedbwrb schema diff
# JSON output for scriptingbwrb schema diff --output jsonWorkflow
Section titled “Workflow”- Make changes to
.bwrb/schema.json - Run
bwrb schema diffto preview changes - Run
bwrb schema migrateto apply changes to existing notes
migrate
Section titled “migrate”Apply schema changes to existing notes in your vault.
Synopsis
Section titled “Synopsis”bwrb schema migrate [options]Options
Section titled “Options”| Option | Description |
|---|---|
-x, --execute | Actually apply the migration (default is dry-run) |
--no-backup | Skip backup creation (not recommended) |
-o, --output <format> | Output format: text, json |
Description
Section titled “Description”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
Safety
Section titled “Safety”- 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
Examples
Section titled “Examples”# Preview migration (dry-run)bwrb schema migrate
# Apply migration with backupbwrb schema migrate --execute
# Apply without backup (not recommended)bwrb schema migrate --execute --no-backupWorkflow
Section titled “Workflow”- Make changes to
.bwrb/schema.json - Run
bwrb schema diffto preview changes - Run
bwrb schema migrateto preview note updates - Run
bwrb schema migrate --executeto apply
history
Section titled “history”View the history of schema migrations applied to your vault.
Synopsis
Section titled “Synopsis”bwrb schema history [options]Options
Section titled “Options”| Option | Description |
|---|---|
--limit <n> | Number of entries to show (default: 10) |
-o, --output <format> | Output format: text, json |
Description
Section titled “Description”Shows a log of all migrations that have been applied:
- Migration timestamp
- Changes included
- Files affected
Examples
Section titled “Examples”# Show migration historybwrb schema history
# Show last 5 migrationsbwrb schema history --limit 5
# JSON outputbwrb schema history --output jsonSee Also
Section titled “See Also”- Schema concepts — Understanding schema structure
- Migrations — Migration workflow
- bwrb audit — Validate notes against schema