Integration

Use Humanform from your terminal

The @humanform/cli CLI runs predictions, percentile ranges, country comparisons, and measurement search from your shell. Same API, same credits, built for scripting and CI pipelines.

Install

Install globally, or run with npx without installing:

Global install
npm install -g @humanform/cli
Try without installing
npx @humanform/cli --help

Authenticate

Run humanform login once with an API key from the dashboard. The key is stored locally in ~/.humanform/config.json (file mode 600). For CI and automation, set HUMANFORM_API_KEY instead; it takes precedence over the stored config.

Login
humanform login
Logout
humanform logout

Commands

Five subcommands mirror the REST API. Browse the full measurement and country datasets, or read the predict API docs.

CommandAPIDescription
predictPOST /v1/predictForward lookup: predict one measurement from age, sex, percentile, country, and unit.
rangePOST /v1/predict/rangeReturn multiple percentiles for one measurement in a single request.
comparePOST /v1/predict/compareCompare one percentile for a measurement across multiple countries.
measurements searchGET /v1/measurements/searchFuzzy search measurement names. No API key required.
percentile-lookupPOST /v1/percentile-lookupReverse lookup: given a measured value, return the population percentile.

Examples

predict
humanform predict \
  --measurement Stature \
  --gender Female \
  --age 34 \
  --percentile 50 \
  --country US \
  --unit cm
range
humanform range \
  --measurement PoplitealHeight \
  --gender Female \
  --age 34 \
  --country US \
  --percentiles 5,50,95 \
  --unit cm
compare
humanform compare \
  --measurement PoplitealHeight \
  --gender Female \
  --age 34 \
  --percentile 50 \
  --countries US,UK,JP \
  --unit cm
measurements search
humanform measurements search grip
percentile-lookup
humanform percentile-lookup \
  --measurement PoplitealHeight \
  --gender Female \
  --age 34 \
  --country US \
  --unit cm \
  --value 43.1

Scripting with --json

Add --json to any command for machine-readable output. Pipe into jq or other tools. API errors print to stderr with non-zero exit codes for CI pipelines.

JSON output
humanform predict \
  --measurement Stature \
  --gender Male \
  --age 30 \
  --percentile 50 \
  --country US \
  --unit cm \
  --json
CI with environment variable
HUMANFORM_API_KEY="hf_live_..." humanform predict \
  --measurement Stature \
  --gender Male \
  --age 30 \
  --percentile 50 \
  --country US \
  --unit cm \
  --json

Use cases

  • CI/CD pipelines: gate ergonomic checks in build scripts with HUMANFORM_API_KEY and --json.
  • Shell scripting: chain predictions into existing bash or zsh workflows without writing HTTP clients.
  • Quick terminal lookups: search measurement names or run a one-off predict without opening the dashboard or an IDE.

Package

Explore

Browse datasets: full measurement list, supported countries, design examples, plugins roadmap, REST API docs, or MCP server install, or CLI install, or Google Sheets install, or Excel install.