MeshKit

CLI

Command-line workflows for MeshKit development and operations.

The MeshKit CLI is the terminal surface for setup, diagnostics, provider validation, proof inspection, policy checks, and Filecoin bridge operations.

It does not replace the SDK path in your application. Use the CLI to prove that a MeshKit environment is configured correctly, collect release evidence, inspect encrypted objects, and run repeatable local-development workflows from a shell or CI job.

When To Use It

Use the CLI when you need toUse the SDK when you need to
Initialize a local MeshKit sandbox.Store and read data inside an application flow.
Run provider health checks before a release.Build product features around files, records, sharing, messages, or sync.
Inspect a CID or proof returned by a previous operation.Control runtime behavior, identity resolution, UI state, and retries.
Audit policy and Filecoin bridge state from operations tooling.Handle user-facing errors and persist workflow state in your database.

Install

Run the CLI through npx or install it as a dev dependency:

npx -p @meshkit/cli meshkit doctor --json
npm install -D @meshkit/cli
npx meshkit doctor --json

The package requires Node.js 20.11 or newer.

Configuration Model

The CLI loads configuration in this order:

  1. --config <path> when passed.
  2. MESHKIT_CONFIG when set.
  3. meshkit.config.json in the current working directory.

Local-dev state is stored in this order:

  1. --store <path> when passed.
  2. MESHKIT_STORE when set.
  3. provider.store from a local-dev config.
  4. .meshkit/local-dev.json.

meshkit init writes .env.local, meshkit.config.json, and local-dev state only when those files are missing. Keep .env.local and token values out of source control.

Command Map

GoalCommand
Create local configmeshkit init
Check current local provider and store pathmeshkit dev
Store sample encrypted contentmeshkit dev put <name> <content>
Run health checksmeshkit doctor
Inspect proof metadata for a CIDmeshkit inspect <cid>
Read sanitized provider eventsmeshkit logs
Validate the configured providermeshkit providers test
Check Filecoin bridge deal statemeshkit deals status <dealId>
Request Filecoin bridge renewalmeshkit deals renew <dealId> --duration-days <days>
Retrieve Filecoin bridge contentmeshkit deals retrieve <dealId> --output <path>
Check policy provider healthmeshkit policies test
Audit a policy decision trailmeshkit policies audit <policyId>

Add --json for machine-readable output. JSON failures write to stderr as:

{
  "ok": false,
  "error": {
    "code": "invalid_cli_config",
    "message": "meshkit.config.json must set version to 1.",
    "suggestion": "Fix meshkit.config.json or pass a different config file with --config."
  }
}

Production Boundary

CLI evidence proves the environment used by that command. It does not prove every application code path. For production claims, combine CLI output with SDK workflow evidence that shows write, read, metadata, proof, sharing, policy, and cleanup behavior for the actual runtime you ship.

Never commit provider tokens, Filecoin bridge tokens, policy tokens, private keys, capability secrets, decrypted content, or raw user payloads captured while debugging.

Next Steps

On this page