CLI
The BiomAPI CLI is a zero-dependency Python script that calls the REST API and formats results for the terminal. It also works as an Agent Skill through Claude Code and Codex plugin marketplaces, letting AI assistants process biometry reports directly in conversation.
Processing uploads the source report to BiomAPI. PDF and image extraction also sends the report to Google Gemini; see the Privacy Policy before processing patient data.
See Supported Devices for the list of biometers BiomAPI can extract from.
Installation
Section titled “Installation”Standalone
Section titled “Standalone”Download biomapi-cli.zip, unzip it, and run biomapi.py directly — no pip, no dependencies, pure Python 3.11+:
python biomapi.py statuspython biomapi.py process report.pdfClaude Code plugin
Section titled “Claude Code plugin”/plugin marketplace add mglraimundo/biomapi-cli/plugin install biomapi-cli@mglraimundo-biomapi-clicodex plugin marketplace add mglraimundo/biomapi-clicodex plugin add biomapi-cli@biomapiStart a new task after installation so Codex loads the bundled skill.
Source repo: mglraimundo/biomapi-cli
Configuration
Section titled “Configuration”Interactive setup (saves to ~/.config/biomapi/config):
python biomapi.py configureOr set directly:
python biomapi.py configure --key biom_your_key_herepython biomapi.py configure --gemini-key AIza_your_keypython biomapi.py configure --showPriority: CLI flags > environment variables (BIOMAPI_KEY, GEMINI_API_KEY, ESCRS_IOL_CALCULATOR_URL) > config file.
Prefer interactive configuration or environment variables so secrets do not appear in shell history. On POSIX systems, the CLI writes the configuration directory with mode 0700 and the file with mode 0600; on Windows, access follows the user profile’s ACLs.
Commands
Section titled “Commands”process
Section titled “process”python biomapi.py process report.pdfpython biomapi.py process *.pdf # Multiple files (concurrent)python biomapi.py process *.pdf --service-tier slowpython biomapi.py process report.pdf --no-pinThe server enforces its configured per-file upload limit. Multiple files use at most four concurrent workers, while stdout remains in input order. --service-tier standard is the default and costs 1 BiomAI credit per PDF/image; slow costs 0.5 credit and may take substantially longer.
Output includes patient name (as acronym), BiomPIN, BiomAPI URL, and ESCRS IOL Calculator link. When patient identifiers are available, both URLs can include a reversible #biomctx=... fragment so name/ID can be restored in a new browser session. The fragment is not sent in a normal HTTP request, but anyone receiving the complete URL can decode it; treat that URL as patient-identifying data.
The full response is saved beside the source. If that filename already exists, the CLI adds -2, -3, and subsequent numeric suffixes instead of replacing it.
retrieve
Section titled “retrieve”python biomapi.py retrieve lunar-rocket-731904You may also pass a full BiomAPI or ESCRS URL containing #biomctx=... to restore browser-local patient identifiers during retrieval.
export
Section titled “export”Generate a ZIP containing combined CSV and XLSX spreadsheets plus the saved JSON responses:
python biomapi.py export result-one.json result-two.json --output ./exportsThe command returns the absolute path to biomapi_export.zip as JSON on stdout.
python biomapi.py usagestatus
Section titled “status”python biomapi.py statusPrints lightweight API status and deployment metadata, including db_id. For active Gemini/database health checks, call GET /api/v1/health directly.
configure
Section titled “configure”python biomapi.py configure --key biom_...python biomapi.py configure --gemini-key AIza_...python biomapi.py configure --showAccess tiers
Section titled “Access tiers”BIOMAPI_KEY |
GEMINI_API_KEY |
process limit |
retrieve limit |
|---|---|---|---|
| — | — | Public biomai quota |
Public retrieve quota |
| ✓ | — | Custom quota | Custom quota |
| — | ✓ | biomai_byok bucket (your Gemini quota) |
Public retrieve quota |
| ✓ | ✓ | biomai_byok bucket (your Gemini quota) |
Custom quota |