# Bibverify
Verify bibliographic existence and metadata consistency without destructive edits.
Chinese · Install · Quick start · MCP · Development
Bibverify is a BibTeX metadata verification tool for researchers, editors, automation, and AI assistants. It starts with exact DOI, PMID, PMCID, or arXiv identifiers and then scores candidates from title, author, year, venue, and pagination evidence. Bibverify evaluates whether a bibliographic record can be located in the queried sources and whether its metadata agrees. It does not prove that research findings are true, data is authentic, or a venue is reputable. A missing database record is not evidence that a reference is fabricated. By default, the source `.bib` file is never overwritten. ## Highlights - Identifier-first lookup for DOI, PMID, PMCID, and arXiv IDs. - Crossref, OpenAlex, Semantic Scholar, PubMed, Europe PMC, CORE, DBLP, arXiv, bioRxiv, and more. - Explainable multi-signal matching across identifiers, title, authors, year, venue, and pages. A resolvable DOI with a materially different title becomes `identifier_conflict` instead of being hidden by title search. - Structured provider outcomes distinguish a genuine no-match from rate limiting, authentication, network, parsing, and provider failures. - Non-destructive merging preserves `abstract`, `keywords`, `file`, `note`, and custom fields that providers do not return; conflicting persistent identifiers are never overwritten automatically. - A shared connection pool with retries, exponential backoff, and `Retry-After` support for `429/5xx` responses. - An expiring SQLite cache for successful GET responses; failures are never cached. - Cross-platform path, encoding, Unicode filename, UTF-8 BOM, and CRLF handling. - JSON output, stable exit codes, a Python API, and an MCP server built on the official SDK. - Atomic output writes and byte-preserving backups. ## Requirements - Windows, macOS, or Linux - Network access to the enabled metadata APIs - Python 3.11–3.14 when using the Python distribution; npm, containers, and native packages bundle their runtime GitHub Actions tests all three operating systems across all four supported Python versions. ## Install The current published release is v0.3.0. This branch prepares v0.4.0; commands marked **v0.4.0** become usable only after their linked npm, GHCR, or GitHub Release artifact has been published. Run without a permanent installation: ```bash uvx bibverify --version ``` Starting with v0.4.0, Node.js users can use the zero-dependency npm launcher. It downloads the matching native release, verifies `SHA256SUMS`, and forwards every argument and exit code: ```bash npx --yes @hylouis233/bibverify --version pnpm dlx @hylouis233/bibverify --version bunx --bun @hylouis233/bibverify --version ``` For a persistent CLI in an isolated Python environment, use `uv tool` or `pipx`: ```bash uv tool install bibverify ``` ```bash pipx install bibverify ``` Inside a virtual environment, regular pip also works: ```bash python -m pip install --upgrade bibverify ``` Each release also provides smoke-tested native packages on [GitHub Releases](https://github.com/Hylouis233/bibverify/releases). Beginning with v0.4.0, the release matrix covers Windows x64 plus macOS and glibc 2.28+ Linux on both x64 and ARM64. musl-based Linux users should use the Python package or container image. Windows ARM64 is not published natively yet because an MCP runtime dependency does not currently provide Windows ARM64 wheels; npm automatically uses the tested x64 build under Windows 11 emulation, or you can use the ARM64 container instead. The same release publishes a multi-architecture container: ```bash docker run --rm ghcr.io/hylouis233/bibverify:0.4.0 --version ``` Package-manager manifests are generated from the final release bytes, not from unverified build inputs. Homebrew, Scoop, and WinGet are not live catalog entries yet: v0.4.0 will attach submission- ready manifests to GitHub Release, after which each external catalog still requires onboarding or review. See [Distribution channels](#distribution-channels) for rollout status. ## Quick start ### Convert a DOI to BibTeX ```bash bibverify doi 10.1038/nature12373 --key example2013 ``` For a machine-readable response: ```bash bibverify doi 10.1038/nature12373 --json ``` ### Verify a `.bib` file Create a starter configuration: ```bash bibverify config init ``` Place `references.bib` next to the configuration and run: ```bash bibverify check --config config.json ``` You can override the input and output paths from the command line: ```bash bibverify check references.bib --config config.json --output-dir bibverify-output ``` Inspect results without writing any file: ```bash bibverify check references.bib --dry-run --json ``` After reviewing the report, explicitly apply high-confidence field updates. Bibverify creates a byte-for-byte backup first: ```bash bibverify check references.bib --apply ``` PowerShell example: ```powershell py -m bibverify check '.\Bibliography\references.bib' --output-dir '.\Verification results' ``` The v0.2 forms remain available for compatibility, although new scripts should use subcommands: ```bash bibverify config.json bibverify --doi 10.1038/nature12373 --key example2013 ``` ## Configuration A minimal configuration looks like this: ```json { "language": "EN", "bib_file": "references.bib", "encoding": "auto", "output_dir": "bibverify-output", "user_info": { "email": "your_email@example.com", "app_name": "Bibverify" } } ``` See [`config_template.json`](config_template.json) for every commonly used option. Path behavior is intentionally predictable: - Relative `bib_file` and `output_dir` values are resolved from the directory containing `config.json`, not the shell's current directory. - If `output_dir` is omitted, output is written next to the input bibliography. - `encoding: "auto"` tries UTF-8 with BOM, UTF-8, and GB18030. It does not fall back to Latin-1 and silently turn unknown bytes into mojibake. ### API keys and email Keys can be stored in a local configuration, but environment variables are safer and harder to commit accidentally: | Environment variable | Used for | |---|---| | `BIBVERIFY_EMAIL` | Crossref polite pool and contact information | | `BIBVERIFY_OPENALEX_API_KEY` | OpenAlex | | `BIBVERIFY_SEMANTIC_SCHOLAR_API_KEY` | Semantic Scholar | | `BIBVERIFY_PUBMED_API_KEY` | PubMed/NCBI | | `BIBVERIFY_CORE_API_KEY` | CORE | PowerShell: ```powershell $env:BIBVERIFY_EMAIL = 'you@example.com' $env:BIBVERIFY_OPENALEX_API_KEY = '...' bibverify check --config config.json ``` Bash or Zsh: ```bash export BIBVERIFY_EMAIL='you@example.com' export BIBVERIFY_OPENALEX_API_KEY='...' bibverify check --config config.json ``` ### Query and matching settings ```json { "query_settings": { "delay_between_requests": 0.5, "timeout": 10, "connect_timeout": 3.05, "read_timeout": 20, "max_retries": 3, "backoff_factor": 0.5, "stop_on_first_match": true, "match_threshold": 0.86, "ambiguous_threshold": 0.68, "auto_update_threshold": 0.92, "cache_enabled": true, "cache_ttl_hours": 168, "cache_path": ".bibverify-cache.sqlite3" } } ``` `connect_timeout` and `read_timeout` separately bound connection setup and response reads; the compatibility `timeout` field remains available. `match_threshold` controls automatic candidate acceptance, `ambiguous_threshold` controls which plausible candidates enter review, and `auto_update_threshold` is an additional gate for field changes. Higher values are more conservative. Relative cache paths are resolved from the config directory. The official bioRxiv `details` route does not provide arbitrary title search. Bibverify therefore calls bioRxiv only for an exact `10.1101/...` DOI and leaves title-only discovery to providers whose contracts support it, such as Crossref and Europe PMC. ## CLI reference ```text bibverify check [BIB_FILE] [--config PATH] [--output-dir DIR] [--format txt|json|jsonl|csv] [--dry-run|--apply] [--json] bibverify doi DOI [--key KEY] [--config PATH] [--json] bibverify config init [--output PATH] [--force] bibverify doctor [--config PATH] [--json] bibverify providers list [--json] bibverify cache clear [--config PATH] bibverify benchmark [--dataset PATH] bibverify mcp [--config PATH] [--workspace-root DIR] [--transport stdio|streamable-http] bibverify agent init [--target generic|codex|claude|cursor] [--output PATH] bibverify skill export [--target ...] ``` Exit codes: | Code | Meaning | |---:|---| | `0` | Verification completed and metadata is consistent | | `1` | Runtime error reserved for uncategorized command failures | | `2` | Metadata differences or high-confidence updates exist | | `3` | Ambiguous, not-found, or identifier-conflict entries require review | | `4` | A provider was unavailable and verification is incomplete | | `5` | The input file, configuration, or entry is invalid | With `--json`, stdout contains JSON only. Diagnostics go to stderr, which keeps the command safe for CI and scripts. ## Output files For an input named `references.bib`, Bibverify may create: - `bibverify_report_