Expand description
doiget cite <ref> subcommand — resolve a DOI / arXiv reference to a
clean BibTeX entry on stdout, a doi2bib-style citation helper.
Unlike bib (which renders an entry already in the local
store), cite resolves the reference live — cache-aware via the
resolver cache (docs/CACHE.md), so repeat citations of the same ref
avoid upstream rate limits — and never writes to the store. The DOI
path enriches the entry from the Crossref envelope
(doiget_core::orchestrator::cite_metadata) so the output carries
year / journal / publisher / ISSN, not just the bare id.
§Offline resilience (issue #305)
A live resolve that fails (network hiccup, OpenAlex flake) does NOT
discard an already-fetched reference: cite falls back to the local
store and renders the stored metadata, with a note: on stderr so the
offline path is visible. --offline skips the live resolve entirely
(store-only). Either way a total miss is a non-zero error, never a
silent empty stdout (the #302 / #304 “never exit 0 with nothing”
contract).
Rendering (field mapping, brace-stripping, HTML/MathML tag scrubbing)
is shared with doiget bib via
doiget_core::store::render::to_bibtex.
§Relation to doi2bib
This command is functionally comparable to the doi2bib tool, and the
“doi2bib-style” / “doi2bib-quality” phrasing throughout doiget is a
descriptive comparison only. cite is an independent, clean-room
implementation built on doiget’s own Crossref/arXiv resolver and
to_bibtex renderer; it incorporates no code from any external
doi2bib project. In particular it does not derive from the AGPL-3.0
doi2bib at https://github.com/vandroogenbroeckmarc/doi2bib — none
of that project’s source, field-correction heuristics, or
Unicode→ASCII tables are used here, so doiget remains MIT-licensed.
Functions§
- run
- Run the
citesubcommand.