MeshKit

CLI Quickstart

Run MeshKit diagnostics and local-dev writes from the terminal.

Use this quickstart to prove that the MeshKit CLI can create a local sandbox, encrypt content through the configured provider, persist local state, and inspect the resulting proof.

This path is intentionally local. It is the fastest way to learn the CLI without needing a live IPFS, metadata, policy, or Filecoin bridge service.

Prerequisites

  • Node.js 20.11 or newer.
  • A project directory where the CLI can write meshkit.config.json, .env.local, and .meshkit/local-dev.json.
  • @meshkit/cli, either through npx -p @meshkit/cli or a dev dependency.

1. Initialize Local Config

npx -p @meshkit/cli meshkit init --json

Expected result:

{
  "created": [".env.local", "meshkit.config.json", ".meshkit/local-dev.json"],
  "next": ["npx meshkit dev", "npx meshkit doctor"],
  "appId": "mk_local_dev"
}

If one of those files already exists, the CLI leaves it in place.

2. Check The Sandbox

npx -p @meshkit/cli meshkit dev --json

You should see the active provider name, local store path, and status: "ready".

{
  "provider": "local-dev",
  "store": "C:/path/to/project/.meshkit/local-dev.json",
  "status": "ready"
}

3. Store Encrypted Content

npx -p @meshkit/cli meshkit dev put hello.txt "hello from meshkit" --json

The CLI stores the content through the same MeshKit client contract used by the SDK. Save the returned cid; you need it for inspection and retrieval workflows.

The CID identifies the encrypted MeshKit envelope bytes, not the plaintext string.

4. Inspect The Proof

npx -p @meshkit/cli meshkit inspect <cid-from-dev-put> --json

Inspection should return proof metadata for the encrypted object. If the CLI cannot find proof metadata, you are probably using a different config, different local-dev store, or a CID that was not produced by that provider.

5. Read Provider Events

npx -p @meshkit/cli meshkit logs --json

Logs are for diagnosis and release evidence. They should not contain plaintext payloads, bearer tokens, private keys, capability secrets, or decrypted content.

What This Proves

This quickstart proves:

  • The CLI can parse configuration.
  • The local provider can store encrypted MeshKit envelope bytes.
  • Local-dev state persists across separate commands.
  • The proof path can find metadata for the written CID.
  • JSON output can be consumed by CI or issue reports.

It does not prove:

  • A live IPFS or metadata service is reachable.
  • A browser, mobile, or server runtime is wired correctly.
  • Sharing, policy checks, sync, Filecoin persistence, or gateway retrieval work in production.

Common Fixes

SymptomFix
missing_cidPass the CID returned by meshkit dev put.
invalid_cli_configEnsure meshkit.config.json has version: 1 and a supported provider shape.
Proof is missingPass the same --store and --config used for the write.
Output is hard to parseAdd --json and read stdout for success or stderr for structured errors.

Next Steps

On this page