Lem/Docs

import

Import an authored project or external research into Lem.

Invocation#

Shell
lem-cli import [--project <directory> | --bibtex <file> | --pdf <file> --arxiv <id-or-url>]

Inputs and options#

  • Choose one input selector: --project, --bibtex, or --pdf. PDF import requires --arxiv; --arxiv is refused without --pdf. Each option may appear only once.
  • With no selector, imports projects from the configured discovery roots that currently exist. Explicit input paths expand ~. Directories are discovered in place; BibTeX and PDF inputs enter the literature library through the shared research importer.

Output and state#

Prints the shared import result as JSON, including the input kind and path, imported and unchanged counts, destination path, and message. Project import merges discovered papers into the durable registry and writes it atomically; external research retains import provenance in the literature library.

Refusals#

  • Unknown options refuse with “import: unknown option <option>”; repeated options with “import: <option> may be provided only once”; missing values with “import: <option> needs a value”.
  • Multiple input selectors refuse with “import: choose exactly one of --project, --bibtex, or --pdf”. Invalid PDF/arXiv combinations and an empty set of existing configured project roots are refused before import.
  • The shared importer refuses missing or unsupported inputs, archives, temporary project directories, projects without discoverable LaTeX documents, unreadable registries, and persistence failures with the underlying import diagnostic. Arguments are not ignored.