0.7.11 • Published 15 days ago

@citation-js/cli v0.7.11

Weekly downloads
4,678
License
MIT
Repository
github
Last release
15 days ago

@citation-js/cli

CLI for Citation.js.

NPM version NPM total downloads License

Dependency status

Install

npm install --global @citation-js/cli

Usage

Usage: citation-js [options]

Options:
  -h, --help                         output usage information
  -V, --version                      output the version number

  -i, --input <path>                 Input file. If all input options are omitted, it uses stdin
  -t, --text <string>                Input text. If all input options are omitted, it uses stdin
  -u, --url <string>                 Deprecated in favor of -t, --text. If all input options are omitted, it uses stdin
  -o, --output <path>                Output file (omit file extension). If this option is omitted, the output is written to stdout
  --pipe                             Pipe and transform from stdin to stdout

  -R, --output-non-real              Output as a text file
  -f, --output-type <option>         Output structure type: string, html, json (default: "json")
  -s, --output-style <option>        Output scheme. A combination of --output-format json and --output-style citation-* is considered invalid. Options: csl (Citation Style Lanugage JSON), bibtex, citation-* (where * is any formatting style) (default: "csl")
  -l, --output-language <option>     Output language. [RFC 5646](https://tools.ietf.org/html/rfc5646) codes (default: "en-US")

  --log-level <level>                Log level: silent, error, warn, info, debug, http (default: "warn")

  --plugins <names>                  Plugin names (@citation-js/plugin-NAME); bibjson, bibtex, csl, doi, ris & wikidata are preloaded (default: [])
  --plugin-config <config>           @plugin.property.path=value;... (default: [])
  --formatter-options <config>       property.path=value;... (default: [])

  --no-input-generate-graph          Do not include the parsing graph in CSL output
  --input-force-type <type>          Force parsing as a certain type
  --input-max-chain-length <number>  Set the maximal number of parsing iterations
  --no-input-strict                  Do not use the strict parsing mode
  --input-target <type>              Stop parsing when a certain type is reached

Input

Input can be read from stdin, passed as a file with -i, --input <path> or, for simple IDs, as plain text with -t, --text or the deprecated alias -u, --url.

$ echo "Q30000000" > input.txt

$ cat input.txt | citation-js
[{"title": "The Synergistic Activity ...", ...}]

$ citation-js --input input.txt
[{"title": "The Synergistic Activity ...", ...}]

$ citation-js --text Q30000000
[{"title": "The Synergistic Activity ...", ...}]

Output

The CLI outputs to stdout by default, but can write to a file with the -o, --output option.

$ citation-js --text Q30000000
[{"title": "The Synergistic Activity ...", ...}]

$ citation-js -t Q30000000 -o output
$ more output.json
[{"title": "The Synergistic Activity ...", ...}]

Note: the file extension is determined automatically, and should therefore be omitted in the -o option. To force a file extension, simply omit -o and redirect stdout to the preferred file.

Output Format

To format the output, use the -R, -s, -f and -l options. These options map to the old output options.

CLI optionDefault valueOther values
-R, --output-non-realomitted (real)present (string, plain text)
-f, --output-typejsonjson, string
-s, --output-stylecslcitation-*, bibtex, bibtxt, data
-l, --output-languageen-USes-ES, fr-FR, du-DU, nl-NL

For example, to format doi:10.5281/zenodo.1005176 in French in the APA format:

$ citation-js -t 10.5281/zenodo.1005176 -f string -s citation-apa -l fr-FR

Willighagen, L., & Willighagen, E. (2017,  octobre 9). Larsgw/Citation.Js V0.3.3. Zenodo. https://doi.org/10.5281/zenodo.1005176
0.7.11

15 days ago

0.7.10

1 month ago

0.7.9

2 months ago

0.7.8

3 months ago

0.7.7

3 months ago

0.7.6

4 months ago

0.7.5

4 months ago

0.6.9

7 months ago

0.7.2

7 months ago

0.7.1

7 months ago

0.7.4

6 months ago

0.7.3

6 months ago

0.7.0

7 months ago

0.6.8

12 months ago

0.6.7

1 year ago

0.6.6

1 year ago

0.6.5

1 year ago

0.6.3

2 years ago

0.6.2

2 years ago

0.6.4

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.5.7

2 years ago

0.5.4

2 years ago

0.5.6

2 years ago

0.5.5

2 years ago

0.5.3

2 years ago

0.5.2

3 years ago

0.5.1

3 years ago

0.5.0

3 years ago

0.5.0-alpha.10

3 years ago

0.5.0-alpha.9

4 years ago

0.5.0-alpha.8

4 years ago

0.5.0-alpha.7

4 years ago

0.5.0-alpha.6

4 years ago

0.5.0-alpha.5

5 years ago

0.5.0-alpha.4

5 years ago

0.5.0-alpha.3

5 years ago

0.5.0-alpha.2

5 years ago

0.5.0-alpha.1

5 years ago

0.5.0-alpha.0

5 years ago

0.4.10

5 years ago

0.4.9

5 years ago

0.4.8

5 years ago

0.4.7

5 years ago

0.4.6

5 years ago

0.4.5

5 years ago

0.4.4

5 years ago

0.4.3

5 years ago

0.4.3-alpha.0

5 years ago

0.4.2

5 years ago

0.4.1

5 years ago

0.4.0

5 years ago

0.4.0-rc.4

5 years ago

0.4.0-rc.3

5 years ago

0.4.0-rc.2

5 years ago

0.4.0-rc.1

5 years ago

0.4.0-rc.0

5 years ago