Obsidian Bases
Workflow
- Read the existing .base file before editing it.
- Define global scope with filters.
- Add computed values under formulas only when needed.
- Configure property display names and one or more views.
- Validate YAML, formula references, quoting, and date/duration operations.
- Open or query the Base in Obsidian when the CLI is available.
Schema
filters:
and:
- 'file.ext == "md"'
- 'status != "archived"'
formulas:
days_until_due: 'if(due, (date(due) - today()).days, "")'
properties:
status:
displayName: Status
formula.days_until_due:
displayName: "Days Until Due"
summaries:
mean_rounded: 'values.mean().round(2)'
views:
- type: table
name: Active
limit: 50
filters:
and:
- 'status != "done"'
order:
- file.name
- status
- formula.days_until_due
groupBy:
property: status
direction: ASC
summaries:
formula.days_until_due: Average
Views may be table, cards, or list.
A map view depends on compatible map support.
Filters and properties
Filters may be a single expression or recursively nested and,
or, and not objects. Property namespaces are:
- note properties: status or note.status
- file metadata: file.name, file.path,
file.folder, file.ctime, file.mtime,
file.tags, file.links, and
file.backlinks
- formulas: formula.days_until_due
Use file.hasTag(), file.hasLink(),
file.hasProperty(), and file.inFolder() for indexed
file relationships. The this value refers to the Base itself, the
embedding note, or the active file depending on where the Base is rendered.
Formula rules
- Guard optional properties with if().
- Date subtraction returns a Duration, not a number. Access
.days, .hours, or another numeric field before
calling number methods such as .round().
- Every formula.X used by a view or property configuration must
have a matching X entry under formulas.
- Wrap formulas containing double quotes in YAML single quotes.
- Quote YAML strings containing special characters, especially colons and
leading punctuation.
Read Functions reference for function and
type-specific operations, and Examples for complete
task-tracker and daily-notes Bases.
Validation checklist
- The document parses as YAML and has a views list.
- View order, groupBy, and summaries reference defined
note, file, or formula properties.
- Formula quoting is balanced and duration math accesses a numeric field.
- Embedded view names match exactly: ![[My Base.base#View Name]].
Attribution
Adapted from kepano/obsidian-skills at revision
a1dc48e68138490d522c04cbf5822214c6eb1202. See LICENSE.
1---2name: obsidian-bases3description: Create and edit Obsidian Bases (.base files) with valid YAML schemas, filters, formulas, properties, summaries, and views. Use for database-like Obsidian views or when the user mentions Bases, .base files, table/card/list views, filters, formulas, or summaries.4license: MIT5---67# Obsidian Bases89## Workflow10111. Read the existing <code>.base</code> file before editing it.122. Define global scope with <code>filters</code>.133. Add computed values under <code>formulas</code> only when needed.144. Configure property display names and one or more views.155. Validate YAML, formula references, quoting, and date/duration operations.166. Open or query the Base in Obsidian when the CLI is available.1718## Schema1920~~~yaml21filters:22 and:23 - 'file.ext == "md"'24 - 'status != "archived"'2526formulas:27 days_until_due: 'if(due, (date(due) - today()).days, "")'2829properties:30 status:31 displayName: Status32 formula.days_until_due:33 displayName: "Days Until Due"3435summaries:36 mean_rounded: 'values.mean().round(2)'3738views:39 - type: table40 name: Active41 limit: 5042 filters:43 and:44 - 'status != "done"'45 order:46 - file.name47 - status48 - formula.days_until_due49 groupBy:50 property: status51 direction: ASC52 summaries:53 formula.days_until_due: Average54~~~5556Views may be <code>table</code>, <code>cards</code>, or <code>list</code>.57A <code>map</code> view depends on compatible map support.5859## Filters and properties6061Filters may be a single expression or recursively nested <code>and</code>,62<code>or</code>, and <code>not</code> objects. Property namespaces are:6364- note properties: <code>status</code> or <code>note.status</code>65- file metadata: <code>file.name</code>, <code>file.path</code>,66 <code>file.folder</code>, <code>file.ctime</code>, <code>file.mtime</code>,67 <code>file.tags</code>, <code>file.links</code>, and68 <code>file.backlinks</code>69- formulas: <code>formula.days_until_due</code>7071Use <code>file.hasTag()</code>, <code>file.hasLink()</code>,72<code>file.hasProperty()</code>, and <code>file.inFolder()</code> for indexed73file relationships. The <code>this</code> value refers to the Base itself, the74embedding note, or the active file depending on where the Base is rendered.7576## Formula rules7778- Guard optional properties with <code>if()</code>.79- Date subtraction returns a Duration, not a number. Access80 <code>.days</code>, <code>.hours</code>, or another numeric field before81 calling number methods such as <code>.round()</code>.82- Every <code>formula.X</code> used by a view or property configuration must83 have a matching <code>X</code> entry under <code>formulas</code>.84- Wrap formulas containing double quotes in YAML single quotes.85- Quote YAML strings containing special characters, especially colons and86 leading punctuation.8788Read [Functions reference](references/FUNCTIONS_REFERENCE.md) for function and89type-specific operations, and [Examples](references/EXAMPLES.md) for complete90task-tracker and daily-notes Bases.9192## Validation checklist9394- The document parses as YAML and has a <code>views</code> list.95- View <code>order</code>, <code>groupBy</code>, and summaries reference defined96 note, file, or formula properties.97- Formula quoting is balanced and duration math accesses a numeric field.98- Embedded view names match exactly: <code>![[My Base.base#View Name]]</code>.99100## Attribution101102Adapted from <code>kepano/obsidian-skills</code> at revision103<code>a1dc48e68138490d522c04cbf5822214c6eb1202</code>. See <code>LICENSE</code>.