Add

The add command is one of the central commands of the papis command-line interface. It is a very versatile command with a fair amount of options.

There are also a few customization settings available for this command, which are described on the configuration page for add.

Examples

  • Add a document located in ~/Documents/interesting.pdf and name the folder where it will be stored in the database interesting-paper-2021:

    papis add ~/Documents/interesting.pdf \
        --folder-name interesting-paper-2021
    

    If you want to directly add some metadata, like author, title and tags, you can also run the following:

    papis add ~/Documents/interesting.pdf \
        --folder-name interesting-paper-2021 \
        --set author 'John Smith' \
        --set title 'The interesting life of bees' \
        --set year 1985 \
        --set tags 'biology interesting bees'
    
  • Add a paper with a locally stored file and get the paper information through its DOI identifier (in this case 10.10763/1.3237134 as an example):

    papis add ~/Documents/interesting.pdf --from doi 10.10763/1.3237134
    
  • Add a paper from arxiv.org to a library named machine-learning:

    papis -l machine-learning add \
        --from arxiv https://arxiv.org/abs/1712.03134
    
  • If you do not want copy the original PDFs into the library, you can also tell Papis to just create a link to them, for example:

    papis add --link ~/Documents/interesting.pdf \
        --from doi 10.10763/1.3237134
    

    adds an entry to the Papis library, but the PDF document remains at ~/Documents/interesting.pdf. The document’s folder will contain a link to ~/Documents/interesting.pdf instead of the file itself. Make sure that the document at ~/Documents/interesting.pdf does not disappear, or you will end up without a document file.

  • Papis tries to make sense of the arguments with which it is provided. For instance, you could only provide a DOI, and Papis will verify that this is a valid DOI and download available metadata using Crossref. For example, you can try:

    papis add 10.1103/PhysRevLett.123.156401
    

    Similarly, a wide array of known journals are recognized by URL, so you can try:

    papis add journals.aps.org/prl/abstract/10.1103/PhysRevLett.123.156401
    papis add https://arxiv.org/abs/1712.03134
    
  • You can also download citations alongside the information on the paper if the metadata contains a DOI identifier. You can pass the --fetch-citations flag in order to create a citations.yaml file in the document’s main folder with a list of citations. You can check out the papis citations command for more advanced usage.

  • BibTeX can be imported directly as a string, or read from a local file or from a remote URL. The following all work:

    papis add --from bibtex someFile.bib
    papis add --from bibtex "https://example.com/someFile.bib"
    papis add --from bibtex "@book{someReference,
        author = {John Doe},
        ...more fields...
        }"
    papis add --from bibtex "$(xclip -o)"
    

Command-line interface

Add a document into a given library.

Usage

papis add [OPTIONS] [FILES]...

Options

-h, --help

Show this message and exit.

-s, --set <set_list>

Set some information before.

-d, --subfolder <subfolder>

Subfolder in the library.

-p, --pick-subfolder

Pick from existing subfolders.

--folder-name <folder_name>

Name format for the document main folder.

--file-name <file_name>

File name format for the document.

--from <from_importer>

Add document from a specific importer.

--list-importers

List all supported importers.

-b, --batch

Batch mode (do not prompt or otherwise).

--confirm, --no-confirm

Ask to confirm before adding to the collection.

--open, --no-open

Open files before adding them to the document.

--edit, --no-edit

Edit info file before adding document.

Instead of copying the file to the library, create a link to its original location.

--move, --no-move

Instead of copying the file to the library, move it from its original location.

--auto-doctor, --no-auto-doctor

Apply papis doctor to newly added documents.

--git, --no-git

Git add and commit the new document.

--download-files, --no-download-files

Download file with importer if available or not.

--fetch-citations, --no-fetch-citations

Fetch citations from a DOI (Digital Object Identifier).

Arguments

FILES

Optional argument(s)