Developers & Agents Updated 2026-08-23 View as Markdown

nLight.fit CLI

The official command-line tool for nLight.fit. It speaks the same MCP protocol the production server and the sandbox speak, so an agent or a script can try the integration without building a client from scratch.

Install

The package is published from this site while registry publication is pending:

npm install -g https://nlight.fit/cli/nlight-fit-latest.tgz
nlight --help

That needs no registry account. npm installs from a tarball URL natively, and the tarball is the same artifact npm publish would upload. A versioned copy sits beside it for pinning, and /cli/index.json names both along with the current version.

Once nlight-fit is on npm, the shorter form will work and is preferred — it gives version resolution and updates, which a tarball URL does not:

npm install -g nlight-fit    # after registry publication
npx nlight-fit tools         # after registry publication

x-cli.registryPublished in the OpenAPI document says which of those is currently true, so a program does not have to guess.

What it talks to

Sandbox by default. nlight tools, nlight init and nlight call hit POST https://nlight.fit/api/sandbox. No account, no token, no approval. Every value is synthetic and labelled as such.

Production with --prod. nlight init --prod and nlight tools --prod need no credential either — the server answers the handshake and the generic tool catalog without one, so you can confirm the real endpoint is there and see its tool surface before anyone has an account.

A token, for reading an actual record. nlight call --prod needs NLIGHT_TOKEN, a Bearer token with the read scope:

NLIGHT_TOKEN=rt_ro_... nlight call get_streak metric=vitamins --prod

Setting NLIGHT_TOKEN also improves tools --prod: the authenticated catalog describes each tool against your own column names and date coverage rather than generically. The token is never sent to the sandbox, which has nothing to authenticate to.

Mint that token in the app under Settings → MCP / CLI Access; see token management. The published CLI never asks for database credentials and keeps no state.

Commands

Command What it does
nlight discover HEAD every published developer URL — the OpenAPI document, the MCP manifest, the API catalog, the OAuth metadata, the short aliases — and print the status and content type of each
nlight init Send MCP initialize and print serverInfo, capabilities and protocolVersion
nlight tools Call tools/list and print every tool name
nlight call <tool> [k=v...] Call one tool. Example: nlight call get_streak metric=vitamins
nlight spec Fetch and print https://nlight.fit/openapi.json
nlight discover
nlight init
nlight tools
nlight call get_recovery_context days_back=7
nlight spec | head

Rate limits and versioning

The CLI reads the same RateLimit, RateLimit-Policy and Api-Version headers every other client does. A 429 includes Retry-After. Breaking changes are announced with Deprecation and Sunset; the policy is at nLight.fit API versioning and deprecation.