Skip to content

CLI

Review the local Node client for status, release evidence and confirmed re-reads.

Availability and requirements

The CLI is a local source deliverable at integrations/moat-cli/moat.mjs. It requires Node 20+ and an activated account API. The package is private and has not been published to npm; there is no public package-install command established by this delivery. Run these commands from a reviewed repository checkout. Help works offline; network commands need an owner-provisioned MOATDEFENDER_API_KEY environment variable.

shell
node integrations/moat-cli/moat.mjs help

Inspect status

Replace the example dossier UUID with your owned dossier. Omit --dossier to inspect the account's latest stored reading. The response below illustrates an account with no stored reading; it is not a live result. MOATDEFENDER_URL may select an owner-trusted HTTPS origin without a path, credentials, query or fragment. The default is https://moatdefender.com.

shell
node integrations/moat-cli/moat.mjs status --dossier 11111111-1111-4111-8111-111111111111
json
{
  "ok": true,
  "reading": null
}

Submit reviewed evidence

Use --file or --text to make the input explicit. File submission previews the payload and requires an interactive yes before sending; without a terminal it cancels. Text submission sends the text typed in the command. Evidence remains unverified and submission does not run a reading. ship collects local commit subjects and bodies since --from, previews the exact payload and asks for yes. Review it for confidential content. It does not fetch Git, inspect source diffs or run a paid reading.

shell
node integrations/moat-cli/moat.mjs evidence add ./release-notes.md --file --dossier 11111111-1111-4111-8111-111111111111
node integrations/moat-cli/moat.mjs ship --from release-tag --dossier 11111111-1111-4111-8111-111111111111

Request and accept a quote

First run reread without --confirm. A cost quote prints the API JSON, spends no tokens and exits with code 2. Only after reviewing and approving the returned cost, replace ACCEPTED_COST below with that integer and run the second command. --confirm requires --max-tokens; a zero cap permits only a cached result. The wallet, scope and monthly key cap still apply. Check status before retrying an interrupted run.

shell
node integrations/moat-cli/moat.mjs reread --dossier 11111111-1111-4111-8111-111111111111
node integrations/moat-cli/moat.mjs reread --confirm --max-tokens ACCEPTED_COST --dossier 11111111-1111-4111-8111-111111111111

Exit codes and help

Completed, cached and cancelled operations exit 0; a quote exits 2; errors exit 1. Cancellation means no evidence was sent by that operation. For an unavailable or rejected request, retain sanitized output and contact support. Do not paste the key, private release text or full error stacks into a report.

Search documentation

Search across all documentation

    ↑↓ Navigate ↵ OpenEsc Close