The binary bundle of citeproc-java contains a command line tool which you can use to execute the library without setting up a full development environment. The tool allows you to create citations and bibliographies in an easy and fast manner. In particular, it comes in very handy if you are in the following situations:

Description

The citeproc-java tool’s general usage is as follows:

citeproc-java [OPTION]... [COMMAND]

The tool accepts the following command line options:

-o, --output <FILE>
Specify a file to write the tool’s output to. By default the tool writes to standard out.
-h, --help
Displays the help text
-V, --version
Displays the command line tool’s version

The next sections describe the commands you can use and their options.

bibliography

Usage

citeproc-java bibliography [OPTION]... [CITATION ID]...

Generate a bibliography from an input file.

Options

-i, --input <FILE>
Specifies the input bibliography file. Valid input files are BibTeX files (*.bib), EndNote files (*.enl), RIS files (*.ris), and CSL citations in JSON format (*.json).
-s, --style <STYLE>
The citation style name. Can either be a simple name specifying one of the 8000+ CSL styles distributed with the command line tool (such as ieee, apa, or chicago-author-date), or a string containing an XML-serialized representation of a CSL style. The default value for this argument is ieee.
-f, --format <FORMAT>
The output format to use. Valid values are text (default), html, asciidoc, fo, and rtf.
-l, --locale <LOCALE>
Specifies the locale to use for citations and bibliographies. The default value for this argument is en-US.
-h, --help
Displays the help text for this command

Arguments

CITATION ID
One or more IDs of citations to include in the bibliography (optional).

Examples

Generate a bibliography from all items in the given BibTeX file using the ieee style and the en-US locale:

citeproc-java bibliography -i references.bib

Generate a bibliography that only contains items with the citation IDs Fowler_2010 and Kisker_2012:

citeproc-java bibliography -i references.bib Fowler_2010 Kisker_2012

Generate a German bibliography using the din-1505-2 style:

citeproc-java bibliography -i references.bib -s din-1505-2 -l de-DE

citation

Usage

citeproc-java citation [OPTION]... [CITATION ID]...

Generate citations from an input file.

Options

-i, --input <FILE>
Specifies the input bibliography file. Valid input files are BibTeX files (*.bib), EndNote files (*.enl), RIS files (*.ris), and CSL citations in JSON format (*.json).
-s, --style <STYLE>
The citation style name. Can either be a simple name specifying one of the 8000+ CSL styles distributed with the command line tool (such as ieee, apa, or chicago-author-date), or a string containing an XML-serialized representation of a CSL style. The default value for this argument is ieee.
-f, --format <FORMAT>
The output format to use. Valid values are text (default), html, asciidoc, fo, and rtf.
-l, --locale <LOCALE>
Specifies the locale to use for citations and bibliographies. The default value for this argument is en-US.
-h, --help
Displays the help text for this command

Arguments

CITATION ID
One or more IDs of the citations to generate.

Examples

Generate ieee citations that can be inserted into the text:

citeproc-java citation -i references.bib Fowler_2010 Kisker_2012

The tool will help you if you specify an incorrect citation ID. The following command

citeproc-java citation -i references.bib Fwler_2010 Kisker_2012

will output

citeproc-java: unknown citation id: Fwler_2010

Did you mean this?
        Fowler_2010

list

Usage

citeproc-java list [OPTION]...

Display sorted list of available citation IDs.

Options

-i, --input <FILE>
Specifies the input bibliography file. Valid input files are BibTeX files (*.bib), EndNote files (*.enl), RIS files (*.ris), and CSL citations in JSON format (*.json).
-h, --help
Displays the help text for this command

json

Usage

citeproc-java json [OPTION]... [CITATION ID]...

Convert input bibliography to JSON. The resulting JSON object can be used as input to other CSL processors such as citeproc-js.

Options

-i, --input <FILE>
Specifies the input bibliography file. Valid input files are BibTeX files (*.bib), EndNote files (*.enl), RIS files (*.ris), and CSL citations in JSON format (*.json).
-h, --help
Displays the help text for this command

Arguments

CITATION ID
One or more IDs of citations to convert (optional).

mendeley

Usage

citeproc-java mendeley [OPTION]... [COMMAND]

Connect to Mendeley Web and generate styled citations and bibliographies.

When connecting for the first time the tool will synchronize its internal database (stored in the user’s home directory) with the server. The tool will ask for authorization if it has not connected to the Mendeley server before. Authorization can be granted by pointing the web browser to the URL given by the tool, accepting the requesting, and then entering the displayed validation code.

-s, --sync
Force synchronization with Mendeley Web and refresh the local database. This option has to be used if new documents have been added to the user’s web catalog or if a document’s details have changed.
-h, --help
Displays the help text for this command

Subcommands

The mendeley command accepts a number of subcommands. Most of them have top-level counter-parts to which they work quite similar except for the fact that they don’t read from an input file but from Mendeley Web.

bibliography
Generate bibliography from Mendeley Web. See the bibliography top-level command.
citation
Generate citations from Mendeley Web. See the citation top-level command.
list
Display sorted list of available citation IDs in the Mendeley Web catalog. See the list top-level command.
json
Convert Mendeley Web catalog to JSON. See the json top-level command.
sync
Synchronize with Mendeley Web and refresh the local database. This command can be used if new documents have been added to the user’s web catalog or if a document’s details have changed.

Examples

Generate a bibliography from all documents stored in Mendeley Web:

citeproc-java mendeley bibliography

Generate a bibliography from Mendeley Web but only include items with the citation IDs Fowler_2010 and Kisker_2012:

citeproc-java mendeley bibliography Fowler_2010 Kisker_2012

Generate a bibliography from all documents stored in Mendeley Web but synchronize with the server first:

citeproc-java mendeley -s bibliography

zotero

Usage

citeproc-java zotero [OPTION]... [COMMAND]

Connect to Zotero and generate styled citations and bibliographies.

When connecting for the first time the tool will synchronize its internal database (stored in the user’s home directory) with the server. The tool will ask for authorization if it has not connected to the Zotero server before. Authorization can be granted by pointing the web browser to the URL given by the tool, accepting the requesting, and then entering the displayed validation code.

-s, --sync
Force synchronization with Zotero and refresh the local database. This option has to be used if new documents have been added to the user’s web catalog or if a document’s details have changed.
-h, --help
Displays the help text for this command

Subcommands

The zotero command accepts a number of subcommands. Most of them have top-level counter-parts to which they work quite similar except for the fact that they don’t read from an input file but from Zotero.

bibliography
Generate bibliography from Zotero. See the bibliography top-level command.
citation
Generate citations from Zotero. See the citation top-level command.
list
Display sorted list of available citation IDs in the Zotero catalog. See the list top-level command.
json
Convert Zotero catalog to JSON. See the json top-level command.
sync
Synchronize with Zotero and refresh the local database. This command can be used if new documents have been added to the user’s web catalog or if a document’s details have changed.

Examples

Generate a bibliography from all documents stored in Zotero:

citeproc-java zotero bibliography

Generate a bibliography from Zotero but only include items with the citation IDs Fowler_2010 and Kisker_2012:

citeproc-java zotero bibliography Fowler_2010 Kisker_2012

Generate a bibliography from all documents stored in Zotero but synchronize with the server first:

citeproc-java zotero -s bibliography

shell

Usage

citeproc-java shell

Run citeproc-java in interactive mode.

In the interactive shell you can open input bibliographies and apply commands quite similar to the ones described above. The shell also keeps a history of last used commands. Use the arrow up and down keys to scroll through it. It also supports auto-completion via the tab key.

The following commands are specified:

load <FILE>
Load an input bibliography file. Valid input files are BibTeX files (*.bib), EndNote files (*.enl), RIS files (*.ris), and CSL citations in JSON format (*.json).
bibliography [CITATION ID]...
Generate a bibliography from the currently loaded input file. See the bibliography top-level command.
citation [CITATION ID]...
Generate a citations from the currently loaded input file. See the citation top-level command.
list
Display sorted list of available citation IDs in the currently loaded input file. See the list top-level command.
json [CITATION ID]...
Convert currently loaded input bibliography to JSON. See the json top-level command.
mendeley [COMMAND]
Connect to Mendeley Web and generate styled citations and bibliographies. See the mendeley top-level command.
zotero [COMMAND]
Connect to Zotero and generate styled citations and bibliographies. See the zotero top-level command.
help [COMMAND]
Display the list of possible commands or display help about a given command.
exit or quit
Leave the interactive shell

help

Usage

citeproc-java help [COMMAND]...

Display help about citeproc-java or about a specific command.