Skip to content

mosaic cache ​

Inspects and maintains the local SQLite cache: every paper any command has seen, and every PDF downloaded.

Usage ​

bash
mosaic cache stats                          # counts and the database size
mosaic cache list -n 5                      # the newest papers
mosaic cache list -q "thruster" --offset 20 # filtered, the next page
mosaic cache show 10.3389/fphy.2019.00140   # one paper, every field
mosaic cache verify                         # are the downloaded files still there, and PDFs?
mosaic cache clean                          # forget downloads that are missing or not PDFs
mosaic cache export library.bib -q "hall thruster"
mosaic cache clear --yes                    # delete everything (PDF files stay)

Behaviour ​

--query (on list and export) keeps the papers whose title or abstract contains every word of the query.

cache show takes a DOI, an arXiv ID or a uid (doi:..., arxiv:...), and prints the local path when the PDF is downloaded. Exit code 1 if the paper is not cached.

cache verify checks every download recorded as successful: missing files, and files that are not PDFs (HTML pages saved by versions before 1.6). cache clean removes those records, so the next get downloads them again; it never deletes papers or files.

cache export writes .bib, .ris, .csv, .json, .md or .markdown, as search --output.

cache clear deletes papers, download records, the search log, exports, the vector index and the citation graph. Watches and PDF files stay. It asks for confirmation unless you pass --yes.

The cache lives at db_path (default ~/.local/share/mosaic/cache.db).

See also: tutorial 3, the cache, maintenance recipes.

Options ​

mosaic cache clean ​

Remove download records whose files are missing or are not PDFs.

mosaic cache clean [OPTIONS]

mosaic cache clear ​

Wipe the entire cache (papers, downloads, searches, exports).

mosaic cache clear [OPTIONS]
OptionValueDefaultDescription
--yes, -ySkip confirmation prompt

mosaic cache export ​

Bulk export cached papers to a file.

mosaic cache export [OPTIONS] OUTPUT
ArgumentValueDescription
OUTPUTPATHOutput file (.md, .markdown, .csv, .json, .bib, .ris)
OptionValueDefaultDescription
--query, -qTEXTFilter by title/abstract
--limit, -nINTEGER0Max papers to export (0 = all)

mosaic cache list ​

List cached papers, newest first.

mosaic cache list [OPTIONS]
OptionValueDefaultDescription
--query, -qTEXTFilter by title/abstract
--limit, -nINTEGER50Max rows to show
--offsetINTEGER0Skip first N rows

mosaic cache show ​

Show full cached metadata for a paper.

mosaic cache show [OPTIONS] IDENTIFIER
ArgumentValueDescription
IDENTIFIERTEXTDOI, arXiv ID, or full UID of the paper

mosaic cache stats ​

Print a summary of the local cache.

mosaic cache stats [OPTIONS]

mosaic cache verify ​

Check that all tracked download files exist on disk and are real PDFs.

mosaic cache verify [OPTIONS]

Released under GPL-3.0-or-later, BSD-2-Clause, BSD-3-Clause or MIT, at your choice.