Export Bibliography from Command Line

edited November 13, 2021
Hello! This might be quite niche, but since I mainly interact with my laptop using the Shell/Terminal Emulator, I was wondering if there was a way to export a bibliography (perhaps even a specific library) from Zotero directly to a .bib file. like so:

$ zotero dump "My Library" > references.bib

or:

$ zotero dump "My Library/path/to/my/project" > references.bib

If not, how could it be implemented?
  • Nothing easy. Zotero just isn't set up to expose it's functionality not the command line.
    You could do the above relatively easy via web API or you could see if https://github.com/sailist/pyzotero-local works for your purpose
  • So a command that connects to the web API could do the dump? i.e., this could only happen online and not on the Zotero app? (side note: when I use the Zotero Connector Chromium-based plugin, I cannot choose the library I want to save the items to when I do not use the Zotero Desktop app)
  • The command line version is easiest from the web API.
    But if you just want auto updating bibtex files, I'd look at the better bibtex add-on for Zotero, which will be much faster and more convenient.

    And yes, the connector principally interacts with the local client, so web import works better and has more functionality, including collection selection and tagging
  • edited November 13, 2021
    Thank you! Mh, I have installed better bibtex, how do I enable the auto updating?

    EDIT: Found here https://retorque.re/zotero-better-bibtex/exporting/auto/
  • Since you have BBT installed, you can also do pull exports as an alternative.
Sign In or Register to comment.