obsidian-bases
Create and edit Obsidian Bases (.base files) with views, filters, formulas, and summaries. Use when working with .base files, creating database-like views of notes, or when the user mentions Bases, table views, card views, filters, or formulas in Obsidian.
- License 许可
- MIT
- 最近更新
- 2026-07-12
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- obsidian-bases
- description
- Create and edit Obsidian Bases (.base files) with views, filters, formulas, and summaries. Use when working with .base files, creating database-like views of notes, or when the user mentions Bases, table views, card views, filters, or formulas in Obsidian.
03 SKILL.md 正文
Obsidian Bases Skill
Third-party attribution: This content includes material derived from kepano/obsidian-skills. See THIRD_PARTY_NOTICES.md.
Workflow
- Create a
.basefile in the vault with valid YAML content - Add
filtersto select which notes appear (by tag, folder, property, or date) - Add
formulas(optional): define computed properties - Configure
views: add one or more views (table,cards,list, ormap) - Validate: verify valid YAML and all referenced properties/formulas exist
- Open in Obsidian to confirm the view renders correctly
Schema
# Global filters apply to ALL views
filters:
and: []
or: []
not: []
# Computed properties usable across all views
formulas:
formula_name: 'expression'
# Display name overrides for properties
properties:
property_name:
displayName: "Display Name"
formula.formula_name:
displayName: "Formula Display Name"
# Custom summary formulas
summaries:
custom_summary_name: 'values.mean().round(3)'
# One or more views
views:
- type: table | cards | list | map
name: "View Name"
limit: 10
groupBy:
property: property_name
direction: ASC | DESC
filters:
and: []
order:
- file.name
- property_name
- formula.formula_name
summaries:
property_name: Average
Filter Syntax
# Single filter
filters: 'status == "done"'
# AND — all conditions must be true
filters:
and:
- 'status == "done"'
- 'priority > 3'
# OR — any condition can be true
filters:
or:
- file.hasTag("book")
- file.hasTag("article")
# NOT — exclude matching items
filters:
not:
- file.hasTag("archived")
# Nested
filters:
or:
- file.hasTag("tag")
- and:
- file.hasTag("book")
- file.hasLink("Textbook")
Filter Operators
==, !=, >, <, >=, <=, &&, ||, !
File Properties Reference
| Property | Type | Description |
|---|---|---|
file.name |
String | File name |
file.basename |
String | File name without extension |
file.path |
String | Full path |
file.folder |
String | Parent folder path |
file.size |
Number | File size in bytes |
file.ctime |
Date | Created time |
file.mtime |
Date | Modified time |
file.tags |
List | All tags |
file.links |
List | Internal links |
file.backlinks |
List | Backlinks |
Formula Syntax
formulas:
# Arithmetic
total: "price * quantity"
# Conditional
status_icon: 'if(done, "done", "pending")'
# Date formatting
created: 'file.ctime.format("YYYY-MM-DD")'
# Days since created (Duration → number via .days)
days_old: '(now() - file.ctime).days'
# Days until due (guard null with if())
days_until_due: 'if(due_date, (date(due_date) - today()).days, "")'
Duration pitfall: Subtracting two dates returns a Duration type. Always access .days, .hours, etc. before calling number functions.
# CORRECT
"(now() - file.ctime).days.round(0)"
# WRONG — Duration does not support .round() directly
"(now() - file.ctime).round(0)"
Key Functions
| Function | Description |
|---|---|
date(string) |
Parse string to date |
now() |
Current date and time |
today() |
Current date |
if(cond, t, f?) |
Conditional |
duration(string) |
Parse duration string |
file(path) |
Get file object |
link(path, display?) |
Create a link |
Default Summary Formulas
Average, Min, Max, Sum, Range, Median, Stddev,
Earliest, Latest, Checked, Unchecked, Empty, Filled, Unique
Complete Examples
Projects Tracker
filters:
and:
- 'type == "project"'
- file.inFolder("Projects")
formulas:
days_until_review: 'if(review, (date(review) - today()).days, "")'
overdue: 'if(review, date(review) < today() && status != "completed", false)'
properties:
formula.days_until_review:
displayName: "Days to Review"
views:
- type: table
name: Active
filters:
and:
- 'status == "active"'
order:
- file.name
- status
- review
- formula.days_until_review
groupBy:
property: status
direction: ASC
- type: table
name: All
order:
- file.name
- status
- review
Daily Journal Index
filters:
and:
- file.inFolder("Daily")
- 'type == "daily"'
formulas:
day_of_week: 'date(file.basename).format("dddd")'
views:
- type: table
name: Recent
limit: 30
order:
- file.name
- formula.day_of_week
- file.mtime
Books Reading List
filters:
or:
- file.hasTag("book")
formulas:
status_icon: 'if(status == "reading", "reading", if(status == "done", "done", "to-read"))'
views:
- type: cards
name: Library
order:
- file.name
- author
- formula.status_icon
Embedding Bases
![[MyBase.base]]
<!-- Specific view -->
![[MyBase.base#View Name]]
YAML Quoting Rules
- Use single quotes for formulas containing double quotes:
'if(done, "Yes", "No")' - Strings containing
:,{,},[,]must be quoted
Troubleshooting
Duration math error: Subtracting dates returns Duration, not number. Use .days, .hours, etc.
Missing null check: Use if() to guard properties that may not exist on all notes.
Referencing undefined formula: Every formula.X in order must have a matching entry in formulas.
References
04 同仓库更多 Skills
obsidian-markdown
Create and edit Obsidian Flavored Markdown with wikilinks, embeds, callouts, properties, and other Obsidian-specific syntax. Use when working with .md files in Obsidian, or when the user mentions wikilinks, callouts, frontmatter, tags, embeds, or Obsidian notes.
obsidian-cli
Interact with Obsidian vaults using the Obsidian CLI to read, create, search, and manage notes, tasks, properties, and more. Also supports plugin and theme development with commands to reload plugins, run JavaScript, capture errors, take screenshots, and inspect the DOM. Use when the user asks to interact with their Obsidian vault, manage notes, search vault content, perform vault operations from the command line, or develop and debug Obsidian plugins and themes.
json-canvas
Create and edit JSON Canvas files (.canvas) with nodes, edges, groups, and connections. Use when working with .canvas files, creating visual canvases, mind maps, flowcharts, or when the user mentions Canvas files in Obsidian.
init
暂无简介
hello
Greet the user with a personalized message
distill
Distill today's session notes into a concise Daily summary