obsidian-cli
obsidian-cli copied to clipboard
Print command to use path from vault (or name as currently implemented)
Describe the bug
Had issues with newlines and nested notes
To Reproduce
-
obsidian-cli create "nested/test" --append --content "hello" -
Creates a nested note "nested/test" with "hello" for content
-
Repeat step 1
-
Adds 2 newlines
-
obsidian-cli print "nested/test" -
2024/12/28 11:11:08 Cannot find note in vault
Expected behavior
Don't insert newlines unless user specifies
Don't fail on printing nested notes
Thanks for the feedback @danielwerg. You are mentioning 2 bugs that I can see:
- Creating new note with appending creates 2 new lines - This does not seem to be a bug as when I use the Obsidian URI directly
open obsidian://new?vault=vault-name&name=test&content=hello&append, its the same result. This is how the implementation is working from Obsidian URI so not something I would be able to change. Note this has nothing to do with being nested or not nested (just mentioning as your example mentioned nested notes but it doesnt seem to be relevent to the issue) - Good spot, the new print command does not currently support vault paths, its working based on note name. If this is useful I can do this as a feature request soon. Note you can still do
obsidian-cli print testto printnested/test(assuming this is the only note or the first note calledtest). This is what I tend to do as do not have many duplicate note names.
Yeah, I have several duplicated notes named "TODO" :D
For 1. I guess I will have to use print and create without --append and composing new note myself. Because I'm trying to append new item to the markdown list.
Ah I see, yeah unfortunately if that is how Obsidan URI's work then you will need to use this work around when adding to a note.
In terms of the print command, I will add path functionality in the future.
Closed with https://github.com/Yakitrak/obsidian-cli/pull/50. Will release new version now.