I wanted to install the CLI for some background exporting. I followed the instructions in the docs (npm -g install joplin) and installed the NPM package without error. However, when I try using the joplin command in the terminal, it isn't finding the notes created by the desktop app. It's empty. Using the joplin export command will return "There is no data to export."
The CLI has installed itself in ~/.config/joplin while the desktop version has installed itself in ~/.config/joplin-desktop.
I need to either point the CLI to the ~/.config/joplin-desktop directory or point the desktop to the ~/.config/joplin directory. But I can't find any documentation on how to do this. Any ideas?
Yes, you have a good chance of corrupting the database and losing data. 99% of the time you might remember not to run the cli and desktop app at the same time, but it only needs to happen once to cause some serious troubles.
Out of interest is there anything that could be done to mitigate that? I can't say I know much about sqlite but would it be possible to do something like have a flag set in the database to mark when a client is currently accessing it therefore preventing a second client from "connecting". Or is that just stupid and the issue is far more fundemental?
I've tried to do that once but it turns out it was a lot more complicated than I thought, I forgot why exactly. So we don't stop people from doing it, just strongly advise against it.