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 throughnpx -p @meshkit/clior a dev dependency.
1. Initialize Local Config
npx -p @meshkit/cli meshkit init --jsonExpected 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 --jsonYou 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" --jsonThe 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> --jsonInspection 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 --jsonLogs 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
| Symptom | Fix |
|---|---|
missing_cid | Pass the CID returned by meshkit dev put. |
invalid_cli_config | Ensure meshkit.config.json has version: 1 and a supported provider shape. |
| Proof is missing | Pass the same --store and --config used for the write. |
| Output is hard to parse | Add --json and read stdout for success or stderr for structured errors. |
Next Steps
- Read Commands for every supported command and flag.
- Move to Provider testing when you need live-provider evidence.
- Read Local development provider before treating local-dev behavior as production behavior.