Public Docs
OpenAPI Source of Truth
MCP Streamable HTTP
CLI for Consumers

TSFM.ai developer documentation.

Multiple pages, one contract. API, MCP, and CLI are aligned on the same schema so teams can move from manual calls to production automation with zero drift.

CLI

Distributable CLI for consumers

CLI resolves OpenAPI at runtime and executes by operation id. That keeps command workflows stable even as endpoint implementation evolves behind the same contract.

Install options

npx (zero install)

npx @metis/tsfm-cli@latest list --base-url https://api.tsfm.ai

Best default for docs and one-off experiments.

Global install

npm i -g @metis/tsfm-cli

Best for operators using CLI daily on secure workstations.

Pinned project dev dependency

pnpm add -D @metis/tsfm-cli

Best for reproducible CI pipelines with lockfile pinning.

Command reference

FieldTypeRequiredDescription
listreadNoPrint operation ids discovered from OpenAPI schema.
inspect <operationId>readYesShow method/path/required params for one operation.
call <operationId>executeYesExecute an API operation with --path, --query, and --body inputs.

Credential precedence

CLI checks flags first, then environment variables.

FieldTypeRequiredDescription
1. --tokenflagNoHighest priority; useful for session-scoped account actions.
2. --api-keyflagNoRecommended for CI and server-side forecasting automation.
3. TSFM_API_TOKENenvNoFallback token env var.
4. TSFM_API_KEYenvNoFallback API key env var for unattended jobs.
cli-workflow.sh
# discover operations from live schema
tsfm list --base-url https://api.tsfm.ai

# inspect one operation contract
tsfm inspect forecast --base-url https://api.tsfm.ai

# execute one operation
cat forecast.json | tsfm call forecast \
  --base-url https://api.tsfm.ai \
  --api-key "$TSFM_API_KEY" \
  --body-file /dev/stdin
cli-ci-check.sh
# CI-friendly smoke check
set -euo pipefail

tsfm list --base-url "$TSFM_API_BASE_URL" --json > /tmp/ops.json
tsfm call getHealth --base-url "$TSFM_API_BASE_URL" --json

tsfm call forecast \
  --base-url "$TSFM_API_BASE_URL" \
  --api-key "$TSFM_API_KEY" \
  --body-file ./payloads/forecast-smoke.json \
  --json | jq '.status == 200'

Operational guidance

  • tsfm list should be your first step in every environment to confirm schema reachability.
  • tsfm inspect <operationId> reveals required path/query/body expectations before execution.
  • tsfm call supports JSON inline (--body) or file-based payloads (--body-file) for repeatable jobs.
  • Use --json for machine-readable output in CI and scripts.
  • CLI exits non-zero when API call returns non-2xx, which is ideal for deployment gates.