How to accept the shared directory with the command line?

I can use the syncthing cli config folders * devices add-device-id * to share my directory, but how do I use the command line accept folder on the receiving device?

Hi there!

You basically need to get the details from the “pending folder” entry as JSON and post a configuration change accordingly. It depends on whether the folder is already added on the “receiver” as you call it, and the inviting device just needs to be added to the list of shared device IDs, or you need to set up the shared folder at all with a new path to sync?

The jq command line tool will be helpful to transform the JSON data. This previous topic may be of interest:

Hope that helps. Let me know if you get stuck.

Thank you, it would be better if you can accept it with cli.

Sure would be nice to have it accessible without fiddling around JSON data. But on the other hand, some details must be provided such as the folder path at a minimum and you need to select which invitation should be accepted if there are several. It would be another syntax to learn if we packed all those into a cli command. So far the decision was to stick with JSON, which is both easy to read and write, and pretty standard so there are tools available.

I think a PR adding an appropriate command would have a chance of getting accepted, but so far nobody has found it important enough to try. Most people are probably happy with the Web GUI or ready to dive in and handle the API themselves.