Although JabRef is primarily a GUI based application, it offers several command line options that may be useful. JabRef can even perform file conversion operations without opening the graphical interface.
This description applies since JabRef 5.0, because JabRef comes with a pre-bundled Java-Runtime Environment
Windows:
Locate JabRef.bat
, for example: JabRef-5.0-portable_windows\JabRef\runtime\bin\JabRef.bat
Linux:
JabRef-5.0-portable_linux/JabRef/lib/runtime/bin/JabRef
.
macOS:
/Applications/JabRef.app/Contents/MacOS/JabRef
\
Do not use JabRef\JabRef.exe
or bin/JabRef
The following documentation is for Windows, but works equally well on Linux and macOS:
In some cases, you have to specify --console
to ensure that output is written to the console.
You can always specify one or more Bib(la)TeX files to load by simply listing their filenames.
Take care to specify all options before your list of file names.
Ensure that the first file name is not misunderstood as being an argument for an option; this simply means that if a boolean option like -n
or -l
immediately precedes a file name, add the word true
as an argument.
For instance, the command line will correctly load the file original.bib
, export it in docbook format to filetoexport.xml
, and suppress the GUI:
The word true prevents the file name from being interpreted as an argument to the -n
option.
-h
(or --help
)
Displays a summary of the command line options, including the list of available import and export formats.
-n
(or --nogui
)
Suppresses the JabRef window (i.e. no GUI - Graphic User Interface - is displayed).
It causes the program to exit immediately once the command line options have been processed. This option is useful for performing file conversion operations from the command line or a script.
-i filename[,import format]
(or --import filename[,import format]
or --importToOpen filename[,import format]
)
Import or load the file filename
.
If only the filename is specified (or if the filename is followed by a comma and a *
character), JabRef will attempt to detect the file format automatically. This works for BibTeX files, and also for all files in a supported import format. If the filename is followed by a comma and the name of an import format, the given import filter will be used.
Use the -h
option to get the list of available import formats.
If an export option is also specified, the import will always be processed first, and the imported or loaded file will be used by the export filter. If the GUI is not suppressed (using the -n
option), any imported or loaded file will show up in the main window.
If --importToOpen
is used, the content of the file will be imported into the opened tab.
Note: The -i
option can be specified only once, and for one file only.
-o filename[,export format]
(or --output filename[,export format]
)
Export or save a file imported or loaded by the same command line.
If a file is imported using the -i
option, that file will be exported. If no -i
option is used, the last file specified (and successfully loaded) will be exported.
If only filename is specified, it will be exported in BibTeX format. If the filename is followed by a comma and an export format, the given export filter will be used.
A custom export filter can be used, and will be preferred if the export name matches both a custom and a standard export filter.
If the GUI is not suppressed (using the -n
option), any export operation will be performed before the JabRef window is opened, and the imported database will show up in the window.
Note: The -o
option can be specified only once, and for one file only.
XMP is an ISO standard for the creation, processing and interchange of standardized and custom metadata for digital documents and data sets.
The first option is to export all entries, which are included in the entries.bib
file to the specified export.xmp
file. The second argument, separated by comma, is the type of exporter used by JabRef.
The second option is to export every entry in the entries.bib in a single .xmp file. Therefore, the file name is replaced by the keyword split
without a file ending! JabRef generates individual .xmp files at the path
location. The file name is a combination of the identifier provided by JabRef and the cite key of the entry.
-importBibtex
Import or load code directly from the BibTeX file. This only works for BibTeX files, and does not support files of other import formats. If it detects this command line option, the JabRef CLI will take in its following argument as a BibTeX string that represents the BibTeX article file being read in for import (usually a filename). JabRef then passes on this information to a helper function that will parse the BibTex string into entries and return the resulting BibTex entries to the JabRef CLI.
If the GUI is not suppressed (using the -n
option), any imported or loaded BibTeX file will show up in the main window.
Note: The -importBibtex
option can be specified only once, and for one file only.
-m [field]searchTerm,outputFile:file[,exportFormat]
(or --exportMatches [field]searchTerm,outputFile:file[,exportFormat]
)
Save to a new file all the database entries matching the given search term.
If the filename is followed by a comma and an export format, the given export filter will be used. Otherwise, the default format html-table (with Abstract and BibTeX, provided by tablerefsabsbib) is used.
Information about to the search function is given in 'advanced search' documentation.
Note: In addition it is also possible to search for entries within a time frame such as Year=1989-2005
(instead of only searching for entries of a certain year as in Year=2005
).
Note: Search terms containing blanks need to be bracketed by quotation marks, as in (author=bock or title|keywords="computer methods")and not(author=sager)
-w CITEKEY1[,CITEKEY2][,CITEKEYn] | PDF1[,PDF2][,PDFn] | all
(or -writeMetadatatoPdf -w CITEKEY1[,CITEKEY2][,CITEKEYn] | PDF1[,PDF2][,PDFn] | all
)
Exports information stored in the database as Metadata to linked files. The metadata is stored as XMP metadata and as an embedded bib file. The entries can be selected by citekey. Individual pdfs can be selectec by the path to the pdf (either as given in the database or as an absolute or relative path to the pdf file itself). The keyword all
may be specified to write metadata on all pdfs in the database.
-writeXMPtoPdf CITEKEY1[,CITEKEY2][,CITEKEYn] | PDF1[,PDF2][,PDFn] | all
As -writeMetadatatoPdf, but only write XMP metadata.
-embeddMetadataInPdf CITEKEY1[,CITEKEY2][,CITEKEYn] | PDF1[,PDF2][,PDFn] | all
As -writeMetadatatoPdf, but only embedd a bib file.
-f=FetcherName:QueryString
(or --fetch=FetcherName:QueryString
)
Query a Web fetcher and import the entries.
Pass both the name of a fetcher and your search term or paper id (e.g. --fetch=Medline:cancer
), and the given fetcher will be run. Some fetchers will still display a GUI window if they need feedback from you.
The fetchers listed in the Web search panel can be run from the command line. To get the list of available fetchers, run --fetch
without parameters.
-a infile[.aux],outfile[.bib] base-BibTeX-file
(or --aux infile[.aux],outfile[.bib] base-BibTeX-file
)
Extract a subdatabase from a .aux file:
When you compile a LaTeX document (e.g. infile.tex
), an .aux file is created (infile.aux
). Among other things, it contains the list of entries used in your document. JabRef can extract the references used from the base-BibTeX-file
to a new .bib file (outfile.bib
). This way, you will have a subdatabase containing only the entries used in the .tex file.
-asfl
(or --automaticallySetFileLinks
)
Automatically set file links.
-g
(or --generateCitationKeys
)
Regenerate all keys for the entries of a Bib(la)TeX file.
-x filename
(or --prexp filename
)
Export user preferences to an XML file. After exporting, JabRef will start normally.
-p filename
(or --primp filename
)
Import user preferences from an XML file (exported using the -x
option, or through the GUI). After importing, JabRef will start normally.
-d key
(or --prdef key
)
Reset preferences (key1, key2,..., or all
).
-b
(or --blank
)
Do not open any files at startup
-v
(or --version
)
Display the version number of JabRef.
--debug
Show debug level messages. The log files are stored in an internal file. See FAQs for Windows, Linux, macOS depending on your OS where to find it.
--console
Show info and error messages in the console.
As developer, you pass arguments to the app using gradle's --app
switch. Enclose the arguments in quotes. For instance --args="--debug"
turns on debug mode.
You can then view the event log in JabRef as follows: