Interact with a running Desktop Client via command line

I am happily using the NC Desktop Client on Windows and Linux machines. Recently I was wondering, whether it is possible to interact with the running client application via command line, instead of clicking through the GUI.

I would like a Bash/Powershell/Python script to do the following:

  • Pause/Unpause synchronisation
  • Resolve sync conflicts

The Desktop Client is running and doing a fantastic job, but those tasks are a pain to do manually each and every time. Those tasks do not really require me to do decision making (“resolving a conflict” is for me to always keep the server version), and therefore should be easy to automate.

I already found the “Advanced Usage” section, but this still leaves me with questions:

  1. The Desktop Client uses an “.INI” config file, and has a parameter called “paused” - does the running Client re-parse the config file, if I change this parameter?
  2. How can the “resolve sync conflict” mechanic be accessed? Is there a way to access the functions that are available via the Desktop Client’s GUI?

I realize that my question is not finely worded, and I in my process of formulating I might have missed to express some premise which seems totally obvious to me. So I am happy to to enter a conversation with anyone who has some idea about the inner workings of the Desktop Client. :slight_smile:

  1. Pause Folder Sync Using CMD · Issue #336 · nextcloud/desktop · GitHub

  2. Not sure.

Whoa! @jtr , thanks a lot! That’s hugely helpful - the link you provided, as well as pointing me to the github page. I actually didn’t think of checking the issues there.

For now, this solves one of the two tasks I need, on one of the two systems I am using. I’ll keep this thread as “unsolved”, and go dive into github. If anyone else has some comment to my issue, I’d still be happy to engage with you :slight_smile:

1 Like

I just found a dirty work around for conflict resolution:

In this GitHub comment we find the recommendation to use the “(conflicted copy” part of the filename to localize and delete the offending files, and thereby resolving the conflict. Seems good enough for me.

But still, I’d be interested to properly interact with the running desktop client. Any suggestions are welcome :slight_smile: