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.
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-cliThen install and enable BiomAPI CLI from the Codex plugin directory.
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.
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 report.pdf --no-pinOutput includes patient name (as acronym), BiomPIN, BiomAPI URL, and ESCRS IOL Calculator link. When patient identifiers are available, both URLs include a browser-only #biomctx=... fragment so name/ID can be restored in a new browser session without being sent to the server.
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.
Generate a by-eye CSV from one or more BiomPINs:
python biomapi.py csv lunar-rocket-731904 solar-river-482910 > export.csvpython biomapi.py usagepython biomapi.py usage --validate # Also verifies your Gemini keystatus
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 |
|---|---|---|---|
| — | — | 15/day per IP | 1,000/day per IP |
| ✓ | — | Custom quota | Custom quota |
| — | ✓ | biomai_byok bucket (your Gemini quota) | 1,000/day per IP |
| ✓ | ✓ | biomai_byok bucket (your Gemini quota) | Custom quota |