@tokenoftrust/cli
v1.3.3
Published
Token of Trust developer CLI — check out a tenant store, run it locally with save→reload, and submit it for preview. Installs the `tot` command.
Maintainers
Readme
@tokenoftrust/cli — the tot developer CLI
One command to go from a Token of Trust invite to a running store.
npm i -g @tokenoftrust/cli
tot checkout # list the stores you can build on
tot checkout <tenant> --clone ./my-store
cd my-store
tot dev # run it locally with save→reload — no Docker needed
tot submit # (coming) submit it for previewPrerequisites: Node.js and an invite. Nothing else. tot dev downloads the
moat-free storefront runner and runs it as a plain host process — no Docker
install, no hand-provisioned AWS credentials. (Docker remains available as a
fallback — tot dev --docker — or automatically if the native artifact can't
be fetched.)
Commands
| Command | Status | What it does |
| --- | --- | --- |
| tot checkout [<tenant>] | built | Clone a store you're entitled to build on, with an authenticated remote configured. No arg → list your stores. |
| tot validate | next | Lint your store before you submit. |
| tot dev | built | Run your store locally with save→reload — NATIVELY (no Docker; falls back to it with --docker or automatically if the native artifact isn't available). |
| tot submit | next | Submit your store for preview (pushes the preview ref, reports the reconcile/compliance verdict + preview URL). |
| tot doctor | built | Check this machine is ready and show which context tot detected. |
Context-aware
The same tot does the right thing wherever you run it (walks up like git):
- storefront monorepo — a full platform checkout;
- tenant checkout — a standalone
content/ public/ theme.json .tot/config.jsonclone (tenant read from.tot/config.json); - loose — anywhere else;
tot checkout <tenant> --clone <dir>gets you a checkout.
tot doctor prints the detected context.
Auth
tot talks to the Token of Trust MCP (default https://mcp.tokenoftrust.com, override with --mcp or MCP_BASE_URL). It authenticates as one of two identities, transparently:
- developer — you, signed in against the MCP (the real invited-developer path). Depends on entitlement-derived MCP access; until that ships,
totreports it clearly and points you at operator creds. - operator —
TOT_API_KEY/TOT_SECRET_KEY/TOT_APP_DOMAINin the environment (how we dogfood the CLI and how CI exercises it).
Design notes
Dependency-free by design (global fetch + git + the system tar), so npm i -g @tokenoftrust/cli stays light. tot dev is the only command that pulls in the storefront runner: for a standalone checkout it downloads the moat-free runner artifact (dev_renderer_artifact, entitlement-gated, same shape as the Docker pull-token path) once per version to ~/.tot/cache/renderer/<version>/, pnpm installs it there (via corepack — no separate pnpm install needed), and reuses that cache on every later run. See src/ for the small modules: context.mjs (detection), mcp.mjs (transport), auth.mjs (the identity seam), commands/.
