CLI and Desktop Installed in Different Directories

Joplin Desktop Version: 2.3.5 (Joplin.AppImage)
OS: Linux Mint 20.2 (kernal: v5.4.0, cinnamon desktop v5.0.5)
Joplin CLI version: 2.3.2

$ npm list -g
├── joplin@2.3.2
└── npm@7.23.0

I've installed Joplin Desktop as described in the docs.

wget -O - | bash

No problems there.

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?

Changing the profile path is possible, but not supported.

It seems that symlinking the files works. I ran this and was able to run the joplin export commands I was looking for:

cd $HOME/.config/joplin-desktop && for FILE in *; do ln -sf $HOME/.config/joplin-desktop/$FILE $HOME/.config/joplin/$FILE; done

Any gotchas I need to be aware of using symlinks?

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?

So, how can we run the CLI for exporting notes made by the desktop app? What's the official way?

They can use a common sync target, either local or remote


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.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.