A simple Deno CLI tool to manage the date field in Obsidian vault markdown files' frontmatter.
- Scans markdown files in an Obsidian vault recursively
- Identifies files missing the
datefield in their frontmatter - Automatically adds the
datefield using file creation date when run with write permissions - Preserves existing frontmatter structure and other fields
- Deno version 2.x or higher
Run the script directly:
deno run --allow-read --allow-write jsr:@zanza00/obsidian-date-adder /path/to/vaultIf you want to only view files without modifying them, omit the --allow-write flag:
deno run --allow-read jsr:@zanza00/obsidian-date-adder /path/to/vaultExample output:
File: /path/to/vault/notes/example-note.md
Created: 2024-01-15T10:30
Current Frontmatter:
id: abc123
tags:
- note
- example
File updated with new date field
---
The date is added in the format: YYYY-MM-DDTHH:mm
For example: 2024-01-15T10:30
- The script will only modify files that don't already have a
datefield - The script uses the file's creation date for the
datefield - Only
.mdfiles are processed - Files without frontmatter are ignored
- Existing frontmatter fields are preserved
- Run with
--allow-writeto automatically update files, omit it to only view files
MIT