I could have been clearer; I meant the Dendron CLI...
# questions
b
I could have been clearer; I meant the Dendron CLI. You could generate the frontmatter yourself as SeriousBug just suggested. Another option would be to use dendron's note lookup from the CLI. something like
dendron note lookup --quiet --wsRoot "$DENDRON_WORKSPACE" --attach --useLocalEngine --enginePort 4040 --query "$NOTE"
in a shellscript. It would generate the frontmatter for you.
v
dendron note lookup --quiet --attach --useLocalEngine --enginePort 4040 --query "testnote" dendron note note related commands Positionals: cmd a command to run [string] [required] [choices: "lookup", "delete"] Options: --version Show version number [boolean] --help Show help [boolean] --wsRoot location of workspace --vault name of vault --quiet don't print output to stdout --enginePort If set, connect to to running engine. If not set, create new instance of Dendron Engine --attach Use existing engine instead of spawning a new one --useLocalEngine If set, use in memory engine instead of connecting to a server [boolean] --query the query to run [string] --output format to output in [string] [choices: "json", "md_gfm", "md_dendron"] [default: "json"] TypeError: cb is not a function at Object.close (/opt/homebrew/lib/node_modules/@dendronhq/dendron-cli/lib/src/commands/utils.js:25:20) at NoteCLICommand.execute (/opt/homebrew/lib/node_modules/@dendronhq/dendron-cli/lib/src/commands/notes.js:133:29) at Object.CLICommand.eval [as handler] (/opt/homebrew/lib/node_modules/@dendronhq/dendron-cli/lib/src/commands/base.js:58:36) I am getting above error message. running command in root vault
b
I can reproduce this - actually, I've encountered this error message in my daily use as well
there aren't any functional consequences
the note is created or found just fine
v
ah let me check
b
it would be good to nip this in the bud in any case
I believe the reasons this happens are understood, but it hasn't been fixed yet
v
so if i am inside vault dir , i dont have to specify wsRoot is that right
or should i always be passing wsRoot
and possible value for wsRoot
i am not able to find the note
b
yes, you shouldn't have to
could you send the command you used?
oh
v
one moment
b
you did
v
Copy code
dendron note lookup --quiet --attach --useLocalEngine --enginePort 4040 --query "testnote"
b
and you can't find testnote.md in the vault?
v
no
Copy code
āÆ āÆ ls testnote2.*
zsh: no matches found: testnote2.*
b
it's working in my test vault - can you tell me what you get if you just run
dendron note lookup --query "testfoo"
v
Error: need to specify vault at checkQueryAndVault (/opt/homebrew/lib/node_modules/@dendronhq/dendron-cli/lib/src/commands/notes.js:30:15) at NoteCLICommand.execute (/opt/homebrew/lib/node_modules/@dendronhq/dendron-cli/lib/src/commands/notes.js:73:46) at Object.CLICommand.eval [as handler] (/opt/homebrew/lib/node_modules/@dendronhq/dendron-cli/lib/src/commands/base.js:58:36) at processTicksAndRejections (node:internal/process/task_queues:96:5) ```
b
do you have multiple vaults in your workspace?
v
yes
b
ah
so then you will need to specify a vault
if you look at your
dendron.yml
you should be able to see the names of your different vaults, something like:
Copy code
yml
workspace:
    dendronVersion: 0.70.0
    vaults:
        -
            fsPath: vault3
            name: vaultThree
        -
            fsPath: vault2
            visibility: private
        -
            fsPath: vault
        -
            fsPath: assets
v
it worked now
but the command is not finding my main vault
let me check
dendron.yml
how do i reference default vault
workspace: vaults: - fsPath: test - fsPath: templates seed: dendron.templates name: dendron.templates - fsPath: vault
just vault
b
something like
dendron note lookup --query "note-in-vault2" --vault vault2
yeah, in your case
it should be just 'vault'
v
it worked ī‚° dendron note lookup --query "testfoo" --vault "vault"
b
from what I can see
v
awesome thank you so much
b
sure thing
v
i was looking for way to dynamic generate markdown tasks from taskwarrior , this will help to increase my productivity šŸ™‚
b
yeah, it's handy 😁
v
cheers
one last question šŸ™‚ can i specify content in the command line or pass content as argument
b
typically, if I know the name of the file created, I like to just pipe it in
at the time of note creation
v
got it
what should be the value of $DENDRON_WORKSPACE dir path or path/workspapce file
I passed the location, it worked
b
it's the directory that has
dendron.yml
directly under it
and the code workspace file
v
i am new to linux , not able to figure out pipe to
dendron note lookup
command and append the text below frontmatter. any tips will help
b
You wouldn't pipe to the command, but rather to the file that was created. something like:
Copy code
sh
#!/bin/sh
[...]
dendron note lookup --vault "$DENDRON_VAULT" --wsRoot "$DENDRON_WS" --query "$NOTE" --quiet"
echo "text to be piped" >> ${DENDRON_VAULT}/${NOTE}.md
instead of echo, you might call a script like:
Copy code
sh
#!/bin/sh

IFS=$(printf '\n\t')
for i in $(task status:pending +next export | jq '.[].description' --raw-output); do
    printf -- "- [ ] %s\n" "$i"
done
5 Views