feat: v0.2.0 — key-only frontmatter edits, link-complete move, --no-open/--print-path
- frontmatter --edit/--clear/--delete splice only the targeted keys; values written as Obsidian stores them (plain or double-quoted, no \xE9 escapes, no folding) - move rewrites [[name|alias]], [[name#heading]], embeds, path and frontmatter links, escapes names, refuses to overwrite, leaves ambiguous bare links alone - periodic commands: --no-open, --print-path - stdout/stderr are UTF-8 with LF on every OS
This commit is contained in:
1 parent
d77fac61c8
commit
543ce76207
3 files changed
+337
-149
No files matched your search
@@ -108,8 +108,16 @@ onyx weekly --previous # opens last week's note
|
||||
onyx monthly --next # opens next month's note
|
||||
onyx quarterly --next # opens next quarter's note
|
||||
onyx yearly --previous # opens last year's note
|
||||
|
||||
# Scripts and agents: create if missing without opening Obsidian, print only the path
|
||||
onyx daily --date "2025-11-27" --no-open --print-path
|
||||
```
|
||||
|
||||
Output is UTF-8 with LF line endings on every OS, so `p=$(onyx daily --print-path)` works in
|
||||
bash on Windows too. With `--no-open`, a newly created note keeps the template's raw Templater
|
||||
syntax (`<% … %>`) until Obsidian processes it; when Obsidian is running, Templater's "trigger on
|
||||
new file creation" renders it within seconds.
|
||||
|
||||
**Default filename formats** (used when nothing else is configured):
|
||||
- Daily: `YYYY-MM-DD.md`
|
||||
- Weekly: `YYYY-WWW.md` (ISO week, e.g. `2025-W48.md`)
|
||||
@@ -183,7 +191,8 @@ onyx print-note "note-name" --vault "vault-name"
|
||||
### Moving & Deleting Notes
|
||||
|
||||
```bash
|
||||
# Move or rename a note (auto-updates internal links)
|
||||
# Move or rename a note; rewrites every wikilink that resolves to it:
|
||||
# [[name]], [[name|alias]], [[name#heading]], ![[embeds]], [[folder/name]], frontmatter links
|
||||
onyx move "old-path" "new-path"
|
||||
|
||||
# Move in specific vault
|
||||
@@ -194,7 +203,14 @@ onyx move "old-path" "new-path" --open
|
||||
|
||||
# Delete a note
|
||||
onyx delete "note-path"
|
||||
```
|
||||
|
||||
`move` refuses to overwrite an existing note. A bare `[[name]]` link is only rewritten when that
|
||||
name was unique in the vault (otherwise it is reported and left alone); the new link stays bare
|
||||
unless the new name is shared by another note, in which case it becomes a path link. Markdown
|
||||
`[text](path.md)` links are not rewritten.
|
||||
|
||||
```bash
|
||||
# Delete from specific vault
|
||||
onyx delete "note-path" --vault "vault-name"
|
||||
```
|
||||
@@ -224,6 +240,12 @@ onyx frontmatter "note-name" --delete --key "tags"
|
||||
onyx frontmatter "note-name" --delete --key "date,status,tags"
|
||||
```
|
||||
|
||||
Edits only touch the targeted keys: key order, quoting, accents and long values elsewhere in the
|
||||
frontmatter stay byte-for-byte identical. Values are written the way Obsidian stores them: plain
|
||||
when YAML reads them back unchanged (`done`, `2026-10-19`, `3`), double-quoted otherwise
|
||||
(`"[[Haro]]"`). `tags` takes a comma-separated list, written as a block list. Cleared keys become
|
||||
empty (`status:`), cleared tags `tags: []`.
|
||||
|
||||
### Version
|
||||
|
||||
```bash
|
||||
|
||||
Reference in new issue
Block a user