Every Function Health feature, plus a local SQLite store with biomarker trends across every round you've ever drawn, plus a branded shareable PDF your doctor will actually read.
Function Health gives you a great single-round dashboard but no way to see what's drifting across years of draws — and no way to share a clean, branded lab history with your physician. function-health-pp-cli pulls every round into a local SQLite store with FTS5, exposes cross-round trend analysis nobody else offers (goat, biomarker trend, biomarkers trending, biomarkers oscillating), and renders a Function-branded PDF with your name and date of birth that an MD can read in 30 seconds.
Learn more at Function Health.
Created by @DamienStevens (Damien Stevens).
The recommended path installs both the function-health-pp-cli binary and the pp-function-health agent skill (Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, and other agents supported by the upstream skills CLI) in one shot:
npx -y @mvanhorn/printing-press-library install function-healthFor CLI only (no skill):
npx -y @mvanhorn/printing-press-library install function-health --cli-onlyFor skill only — installs the skill into the same agents as the default command above, but skips the CLI binary (use this to update or reinstall just the skill):
npx -y @mvanhorn/printing-press-library install function-health --skill-onlyTo constrain the skill install to one or more specific agents (repeatable — agent names match the skills CLI):
npx -y @mvanhorn/printing-press-library install function-health --agent claude-code
npx -y @mvanhorn/printing-press-library install function-health --agent claude-code --agent codexThe generated install path is category-agnostic until this CLI is published. If npx is not available before publish, install Node or use the category-specific Go fallback from the public-library entry after publish.
Download a pre-built binary for your platform from the latest release. On macOS, clear the Gatekeeper quarantine: xattr -d com.apple.quarantine <binary>. On Unix, mark it executable: chmod +x <binary>.
From the Hermes CLI:
hermes skills install mvanhorn/printing-press-library/cli-skills/pp-function-health --forceInside a Hermes chat session:
/skills install mvanhorn/printing-press-library/cli-skills/pp-function-health --forceTell your OpenClaw agent (copy this):
Install the pp-function-health skill from https://github.com/mvanhorn/printing-press-library/tree/main/cli-skills/pp-function-health. The skill defines how its required CLI can be installed.
This CLI ships an MCPB bundle — Claude Desktop's standard format for one-click MCP extension installs (no JSON config required).
To install:
- Download the
.mcpbfor your platform from the latest release. - Double-click the
.mcpbfile. Claude Desktop opens and walks you through the install. - Fill in
FUNCTION_HEALTH_TOKENwhen Claude Desktop prompts you.
Requires Claude Desktop 1.0.0 or later. Pre-built bundles ship for macOS Apple Silicon (darwin-arm64) and Windows (amd64, arm64); for other platforms, use the manual config below.
Manual JSON config (advanced)
If you can't use the MCPB bundle (older Claude Desktop, unsupported platform), install the MCP binary and configure it manually.
Install the MCP binary from this CLI's published public-library entry or pre-built release.
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"function-health": {
"command": "function-health-pp-mcp",
"env": {
"FUNCTION_HEALTH_TOKEN": "<your-key>"
}
}
}
}Function Health blocks Firebase REST email/password sign-in at the project level, so function-health-pp-cli auth login with --email/--password does not work and auth login --chrome is unreliable. The working path is auth set-token: log in to https://my.functionhealth.com in Chrome, open DevTools (Cmd+Option+I) -> Network, copy the authorization: Bearer <token> value from any member-app-mid.functionhealth.com/api/v1/... request, then run function-health-pp-cli auth set-token <token>. The token is stored in ~/.config/function-health-pp-cli/config.toml (mode 0600) and lasts ~1 hour; re-run auth set-token on HTTP 401. Set FUNCTION_HEALTH_TOKEN to override for CI or one-shot use.
# Paste a session token from DevTools (Network tab -> Authorization: Bearer ...). Function Health blocks password login.
function-health-pp-cli auth set-token <token>
# Pull every round, biomarker, recommendation, and clinician note into the local SQLite store with adaptive pacing.
function-health-pp-cli sync
# Show the single biomarker that's drifting fastest away from Function's optimal range right now.
function-health-pp-cli goat
# See every ApoB value you've ever drawn, with Function optimal range and delta — JSON for agents, sparkline in a terminal.
function-health-pp-cli biomarker trend ApoB --json
# Compose a Markdown context block (biomarker history + clinician notes + recommendations) and paste it straight into Claude or ChatGPT.
function-health-pp-cli bundle ApoB --window 3rounds | pbcopy
# Render a Function-branded multi-round PDF with your name and DOB — the file you actually email to your MD.
function-health-pp-cli export pdf-for-doctor --out ~/Downloads/function-history.pdf
- Email/password
auth logindoes not work. Function Health blocks Firebase REST password sign-in at the project level. Useauth set-token(see Authentication). auth login --chromeis unreliable. It drives browser-use against a sandboxed Chrome profile rather than your real one, so it frequently fails to capture the Firebase refresh token (leaving you without auto-refresh). Preferauth set-token. A future pure-Go IndexedDB LevelDB reader would extract the token directly from Chrome's on-disk storage without a browser shell-out — tracked as a planned enhancement.- Tokens expire hourly. Firebase id-tokens last ~1 hour and the CLI cannot silently refresh a token set via
auth set-token(no refresh token is captured that way). Re-runauth set-tokenwhen you start seeingHTTP 401. bundleclinician-notes are empty. The/notesendpoint returns items without a stable ID, sosynccannot cache them locally; the notes section ofbundleis therefore blank until the upstream shape gains an ID.
These capabilities aren't available in any other tool for this API.
-
export pdf-for-doctor— Render a Function-branded multi-round lab report PDF with your name and date of birth, suitable for emailing to your personal physician.When an agent needs to produce something the user will hand to a third party, this is the durable artifact — not a JSON blob.
function-health-pp-cli export pdf-for-doctor --out ~/Downloads/function-history.pdf
-
biomarker trend— Every value of a biomarker across every round you've ever drawn, with the delta from Function's optimal range, an ASCII sparkline in the terminal, and structured JSON for agents.When the agent is asked 'how has X changed', this is the one query that answers it without re-fetching anything.
function-health-pp-cli biomarker trend ApoB --json
-
goat— Ranks every biomarker by distance-from-optimal multiplied by its slope-away-from-optimal across the last 3 rounds; returns the single most worrying biomarker right now with reasoning fields.When the agent is asked 'what should I worry about', this is the one-call answer.
function-health-pp-cli goat --agent
-
biomarkers trending— Lists every biomarker whose slope across the last N rounds points away from Function's optimal range, sorted by magnitude.Lets the agent prioritize a long biomarker list without burning the user's context window on every reading.
function-health-pp-cli biomarkers trending --direction worse --last 3 --json
-
category trend— For one of the ~13 categories, returns a per-round aggregate score (percent of biomarkers inside Function's optimal range) over time.Rolls up 100+ biomarkers into a single trajectory per body system, so the agent can summarize organ-level changes.
function-health-pp-cli category trend cardiovascular --json
-
biomarkers oscillating— Biomarkers that crossed the optimal-range boundary at least twice in the last N rounds — flags instability separate from trend.Distinguishes 'unstable measurement noise' from 'consistently bad' — important when the agent is reasoning about whether a single high reading matters.
function-health-pp-cli biomarkers oscillating --rounds 4
-
recommendations stale— Recommendations (supplements / foods) whose target biomarker is STILL outside Function's optimal range, joined by Quest code. The /recommendations endpoint has no issued-date, so staleness is by outcome not age; --min-rounds tightens to persistence and --group (supplements, foods_to_eat, foods_to_avoid) focuses a large set.Closes the loop between guidance and outcome — the agent can ask 'did the last fix work?' instead of 'what is recommended now?'.
function-health-pp-cli recommendations stale --json
-
bundle— Composes a single Markdown file with a biomarker's full history, every clinician note mentioning it (FTS5), Function's optimal range, and relevant recommendations — ready to paste into Claude or ChatGPT.When the agent is being asked to draft a question for the user's clinician, this is the prefab context block.
function-health-pp-cli bundle ApoB --window 3rounds
function-health-pp-cli sync && function-health-pp-cli goatCheap incremental sync, then the single most-worrying biomarker right now — both calls are local after the first sync.
# Full report
function-health-pp-cli export pdf-for-doctor --out ~/Downloads/function-$(date +%Y).pdf
# Only what's out of range, scoped to one section (combinable filters)
function-health-pp-cli export pdf-for-doctor --out ~/Downloads/heart.pdf --section Heart --out-of-rangeBranded multi-round report with member name and DOB header, per-category sections, per-biomarker history. --out-of-range keeps only biomarkers outside Function's optimal range in their latest draw; --section <name> keeps only categories whose name contains the text (e.g. Heart, Liver, Nutrients); the two combine.
function-health-pp-cli biomarker trend ApoB --agent --select \\brounds.draw_date,rounds.value,rounds.status\\bStrip the response down to the three fields an agent actually reasons about; --select accepts dotted paths into nested response objects.
function-health-pp-cli bundle hs-CRP --window 3rounds | pbcopyCompose a Markdown context block — history + clinician notes + recommendations — and paste into Claude or ChatGPT for a focused conversation.
function-health-pp-cli recommendations stale --jsonSurface every recommendation issued at least one round ago whose target biomarker has not moved into Function's optimal range.
Run function-health-pp-cli --help for the full command reference and flag list.
Biological-age and BMI calculations Function derives from your panels.
function-health-pp-cli biological-age bio-age- Your biological age vs. chronological age. 404 if not yet calculated.function-health-pp-cli biological-age bmi- BMI with the weight and height inputs Function recorded.
Function Health's full biomarker catalog with names, units, reference ranges, and Function's "optimal" ranges.
function-health-pp-cli biomarkers get- Get one biomarker's full result history across every round you've drawn, with values, units, status, and ranges.function-health-pp-cli biomarkers list- List every biomarker the platform knows about (across all categories).
The ~13 medical categories biomarkers are organized into (Heart, Hormones, Thyroid, Metabolic, Liver, Kidney, etc.).
function-health-pp-cli categories- List every biomarker category with the biomarkers nested under it.
Clinician notes attached to your results.
function-health-pp-cli notes- List all clinician notes (annotations on biomarkers / rounds).
Change notifications (new results landing, biomarker direction changes).
function-health-pp-cli notifications- Read all unread/read notifications about result changes.
Personalized health recommendations tied to your results.
function-health-pp-cli recommendations- Per-category health guidance. May 404 if Function hasn't computed any yet.
Lab requisitions — pending (in-progress draws) and completed (rounds with results).
function-health-pp-cli requisitions completed- Completed requisitions (your past test rounds, keyed by requisitionId).function-health-pp-cli requisitions pending- Currently in-progress requisitions (lab orders awaiting completion).
Lab results — both the structured biomarker-level data and the raw requisition documents.
function-health-pp-cli results list- Raw requisition / PDF result data (less useful for queries; see results-report for structured values).function-health-pp-cli results report- The structured lab-results report — every biomarker, every round, with value, unit, status, Quest reference range, and Function's optimal range. The headline endpoint for sync.
Upcoming scheduled lab-draw appointments.
function-health-pp-cli schedules- Upcoming scheduled lab visits you've booked.
Your Function Health member profile (id, name, contact info, membership status).
function-health-pp-cli user- Get the authenticated member profile. Used by doctor for reachability + auth check.
Individual lab-collection events within a test round.
function-health-pp-cli visits- List every visit (draw event) — useful when a round has multiple draws.
Wearable-device integrations (Apple Health, Garmin, Whoop, Oura, etc.).
function-health-pp-cli wearables- List the wearable apps Function currently supports for integration.
# Human-readable table (default in terminal, JSON when piped)
function-health-pp-cli biomarkers list
# JSON for scripting and agents
function-health-pp-cli biomarkers list --json
# Filter to specific fields
function-health-pp-cli biomarkers list --json --select id,name,status
# Dry run — show the request without sending
function-health-pp-cli biomarkers list --dry-run
# Agent mode — JSON + compact + no prompts in one flag
function-health-pp-cli biomarkers list --agentThis CLI is designed for AI agent consumption:
- Non-interactive - never prompts, every input is a flag
- Pipeable -
--jsonoutput to stdout, errors to stderr - Filterable -
--select id,namereturns only fields you need - Previewable -
--dry-runshows the request without sending - Read-only by default - this CLI does not create, update, delete, publish, send, or mutate remote resources
- Offline-friendly - sync/search commands can use the local SQLite store when available
- Agent-safe by default - no colors or formatting unless
--human-friendlyis set
Exit codes: 0 success, 2 usage error, 3 not found, 4 auth error, 5 API error, 7 rate limited, 10 config error.
function-health-pp-cli doctorVerifies configuration, credentials, and connectivity to the API.
Config file: ~/.config/function-health-pp-cli/config.toml
Static request headers can be configured under headers; per-command header overrides take precedence.
Environment variables:
| Name | Kind | Required | Description |
|---|---|---|---|
FUNCTION_HEALTH_TOKEN |
per_call | Yes | Set to your API credential. |
If you use agentcookie to sync secrets across machines, this CLI auto-adopts agentcookie-managed credentials with no extra setup. When the daemon writes to this CLI's config, function-health-pp-cli doctor reports agentcookie: detected and auth-status labels the source as agentcookie. Skip this section if you don't use agentcookie - the CLI works the same as any other.
Authentication errors (exit code 4)
- Run
function-health-pp-cli doctorto check credentials - Verify the environment variable is set:
echo $FUNCTION_HEALTH_TOKENNot found errors (exit code 3) - Check the resource ID is correct
- Run the
listcommand to see available items
- Every call returns 401
Not allowed to perform this operation.— Your session token expired (Firebase id-tokens last ~1 hour) or password login was attempted (blocked at the project level). Extract a fresh Bearer token from DevTools and runfunction-health-pp-cli auth set-token <token>. syncfinishes butresults listreturns nothing for a recent draw — Runfunction-health-pp-cli sync check— Function may not have published the round yet; this command compares local round IDs against the live requisitions list and reports whether a new round landed.biomarker get <name>reportsnot foundfor a biomarker visible in the Function web app — Function reuses biomarker names across categories. Runfunction-health-pp-cli biomarkers list --search <substring>to find the exact name or UUID, or pass--id <uuid>.export pdf-for-doctorrenders an empty PDF — PDF rendering pulls from the local SQLite — runfunction-health-pp-cli syncfirst if you haven't pulled any rounds yet.
This CLI was built by studying these projects and resources:
- daveremy/function-health-mcp — TypeScript
- bogini/function-health-exporter — TypeScript
- Greenband1/biomarker_chrome_extension — JavaScript
Generated by CLI Printing Press