I want a tool to merge bookmarks (bookmarks files as stored in FF profile) from two places (PCs) from time to time, in automated way, having Linux terminal / CLI option (I don't want to select files in GUI each time), open-source copyleft licensed. Answers found via web search mostly advice to use sync, but it requires to agree to Terms of Service, which is IMO burdensome, as I can live with moving bookmarks via local html / json files.
After I wrote the above SE found several related posts: A tool for managing bookmark sets, Syncing Firefox and Google Chrome Browser Bookmarks, Automated bookmark merging/synchronization app/addon between multiple instances of Google Chrome and Mozilla Firefox concurrently. I've looked at them and the answer about Python https://charlesleifer.com/blog/building-bookmarking-service-python-and-phantomjs/ is IMO worth reading about more.
However, most of posts are several years old, maybe there are new solutions and also, my current task is to sync only Firefox boookmarks, therefore same format (I expect it to be, though FF versions might be slightly different).