https://www.dendron.so/ logo
#questions
Title
# questions
b

benhsm | Jack of N trades

02/16/2022, 3:47 AM
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

vishal.gandhi

02/23/2022, 2:49 AM
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

benhsm | Jack of N trades

02/23/2022, 2:52 AM
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

vishal.gandhi

02/23/2022, 2:52 AM
ah let me check
b

benhsm | Jack of N trades

02/23/2022, 2:53 AM
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

vishal.gandhi

02/23/2022, 2:54 AM
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

benhsm | Jack of N trades

02/23/2022, 2:56 AM
yes, you shouldn't have to
could you send the command you used?
oh
v

vishal.gandhi

02/23/2022, 2:57 AM
one moment
b

benhsm | Jack of N trades

02/23/2022, 2:57 AM
you did
v

vishal.gandhi

02/23/2022, 2:57 AM
Copy code
dendron note lookup --quiet --attach --useLocalEngine --enginePort 4040 --query "testnote"
b

benhsm | Jack of N trades

02/23/2022, 2:58 AM
and you can't find testnote.md in the vault?
v

vishal.gandhi

02/23/2022, 2:59 AM
no
Copy code
āÆ āÆ ls testnote2.*
zsh: no matches found: testnote2.*
b

benhsm | Jack of N trades

02/23/2022, 3:00 AM
it's working in my test vault - can you tell me what you get if you just run
dendron note lookup --query "testfoo"
v

vishal.gandhi

02/23/2022, 3:02 AM
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

benhsm | Jack of N trades

02/23/2022, 3:03 AM
do you have multiple vaults in your workspace?
v

vishal.gandhi

02/23/2022, 3:03 AM
yes
b

benhsm | Jack of N trades

02/23/2022, 3:03 AM
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

vishal.gandhi

02/23/2022, 3:04 AM
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

benhsm | Jack of N trades

02/23/2022, 3:07 AM
something like
dendron note lookup --query "note-in-vault2" --vault vault2
yeah, in your case
it should be just 'vault'
v

vishal.gandhi

02/23/2022, 3:07 AM
it worked ī‚° dendron note lookup --query "testfoo" --vault "vault"
b

benhsm | Jack of N trades

02/23/2022, 3:07 AM
from what I can see
v

vishal.gandhi

02/23/2022, 3:08 AM
awesome thank you so much
b

benhsm | Jack of N trades

02/23/2022, 3:08 AM
sure thing
v

vishal.gandhi

02/23/2022, 3:08 AM
i was looking for way to dynamic generate markdown tasks from taskwarrior , this will help to increase my productivity šŸ™‚
b

benhsm | Jack of N trades

02/23/2022, 3:08 AM
yeah, it's handy šŸ˜
v

vishal.gandhi

02/23/2022, 3:09 AM
cheers
one last question šŸ™‚ can i specify content in the command line or pass content as argument
b

benhsm | Jack of N trades

02/23/2022, 3:10 AM
typically, if I know the name of the file created, I like to just pipe it in
at the time of note creation
v

vishal.gandhi

02/23/2022, 3:11 AM
got it
what should be the value of $DENDRON_WORKSPACE dir path or path/workspapce file
I passed the location, it worked
b

benhsm | Jack of N trades

02/23/2022, 3:57 AM
it's the directory that has
dendron.yml
directly under it
and the code workspace file
v

vishal.gandhi

02/23/2022, 5:52 PM
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

benhsm | Jack of N trades

02/23/2022, 6:00 PM
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