A command-line tool to export your complete Function Health data via reverse-engineered APIs and convert it to LLM-ready Markdown reports for personalized health insights.
- 🔐 Secure Authentication: Firebase JWT token handling with auto-refresh
- 📊 Complete Data Export: All health data, lab results, biomarkers, and reports in JSON format
- 📝 LLM-Ready Markdown: Convert JSON data to comprehensive, categorized health reports optimized for AI analysis
- 🩺 Clinical Context: Includes professional clinician notes and medical interpretations
- 🎯 Smart Organization: Data exported in 19+ categorized files with trend analysis
- 🛡️ Production Ready: Comprehensive error handling, retry logic, and rate limiting
- ⚙️ Configurable: Customizable settings with config file support
- 🎨 Beautiful CLI: Professional interface with progress indicators and colored output
- 📝 Detailed Logging: Multiple log levels with optional verbose output
- 🔄 Retry Logic: Automatic retries with exponential backoff for network issues
Install dependencies:
bun install
# Export all your data (interactive)
bun run src/cli.ts export
# Convert JSON data to LLM-ready Markdown reports
bun run src/cli.ts markdown
# Export with saved email for faster login
bun run src/cli.ts export --save-credentials
# Export to custom directory with verbose logging
bun run src/cli.ts export --output ~/my-health-data --verbose
# Configure default settings
bun run src/cli.ts config --output-dir ~/health-exports
# Limit biomarkers if you have hundreds (0 = no limit)
bun run src/cli.ts config --max-biomarkers 50
# Show current configuration
bun run src/cli.ts config --list
# Export with custom options (limit biomarkers if you have many)
bun run src/cli.ts export --max-biomarkers 20 --no-retry --quiet
# Convert JSON to Markdown with custom directories
bun run src/cli.ts markdown --input ./my-health-data --output ./health-reports
# Main commands
export # Export all data
markdown # Convert JSON to LLM-ready Markdown reports
config # Manage configuration
help # Detailed help
# Export options
--email <email> # Function Health email
--password <password> # Function Health password
--output <directory> # Output directory
--max-biomarkers <number> # Limit individual biomarker requests (0 = no limit)
--save-credentials # Save email for future use
--verbose # Detailed logging
--quiet # Minimal output
--debug # Debug logging
--no-retry # Disable retry attempts
# Markdown options
--input <directory> # Input directory with JSON data
--output <directory> # Output directory for Markdown files
--verbose # Detailed logging
--quiet # Minimal output
--debug # Debug logging
# Config options
--list # Show current config
--reset # Reset to defaults
--output-dir <dir> # Set default output directory
--retry-attempts <number> # Set retry attempts
--rate-limit <ms> # Set rate limiting delay
Creates function-health-export/
directory with:
complete-function-health-data.json
- Everything in one fileprofile.json
- User profile and account infohealth-results.json
- Lab test results and valuesbiomarkers.json
- Biomarker definitions and datarecommendations.json
- Health recommendationsreports.json
- Comprehensive health reportsbiological-age.json
- Biological age calculationbmi.json
- BMI data and trendsnotes.json
- Personal health noteslab-requisitions.json
- Lab test orders and history- Plus 9 more categorized data files
Creates health-reports/
directory with LLM-ready reports:
00-health-overview.md
- Executive summary with key metrics01-auto-immunity.md
- Autoimmune and inflammatory markers02-biological-age.md
- Aging and cellular health markers03-blood-electrolytes.md
- Essential minerals and electrolytes04-environmental-toxins.md
- Heavy metals and contaminants05-heart-health.md
- Cardiovascular risk factors06-immune-regulation.md
- Immune system markers07-kidney-function.md
- Kidney health and filtration08-liver-function.md
- Liver enzymes and hepatic health09-male-health.md
- Male hormones and reproductive health10-metabolic-health.md
- Blood sugar and metabolic markers11-nutrients-vitamins.md
- Vitamins, minerals, nutritional status12-pancreatic-function.md
- Pancreatic enzymes and digestion13-stress-aging.md
- Stress hormones and aging markers14-thyroid-function.md
- Thyroid hormones and health15-urine-analysis.md
- Urinalysis and kidney filtration99-uncategorized.md
- Biomarkers not fitting standard categories
src/cli.ts
- Main CLI interface with Commander.jssrc/function-health-client.ts
- API client with authenticationsrc/markdown-generator.ts
- Converts JSON to LLM-ready Markdown reportssrc/logger.ts
- Professional logging systemsrc/config.ts
- Configuration management
- All API calls are made directly without browser automation
- Network requests are rate-limited to avoid overwhelming the server
- JWT authentication tokens are automatically refreshed when needed
- The client is designed to be respectful of the server's resources
This tool is for educational and personal data extraction purposes only. Ensure you comply with Function Health's terms of service and applicable laws when using this tool.