MeshKit

Commands

MeshKit CLI command groups and when to use them.

This reference lists the supported MeshKit CLI commands, their required arguments, and the output each command is meant to produce.

Use it after the CLI quickstart. The quickstart teaches the first local workflow; this page is for exact command lookup.

Global Flags

FlagDefaultDescription
--jsonfalseWrites successful results as compact JSON to stdout. MeshKit-classified failures are written as structured JSON to stderr.
--config <path>meshkit.config.jsonLoads a specific CLI config file. Overrides MESHKIT_CONFIG.
--store <path>.meshkit/local-dev.jsonUses a specific local-dev state file. Overrides MESHKIT_STORE and the local-dev provider config value.

Environment Variables

VariableUsed for
MESHKIT_CONFIGConfig file path when --config is not passed.
MESHKIT_STORELocal-dev state path when --store is not passed.
MESHKIT_IPFS_APILive IPFS HTTP API URL shortcut. Requires MESHKIT_METADATA_API.
MESHKIT_METADATA_APIMeshKit metadata API URL shortcut. Requires MESHKIT_IPFS_API.
MESHKIT_PROVIDER_TOKENProvider bearer token fallback.
MESHKIT_FILECOIN_ENDPOINTFilecoin bridge endpoint.
MESHKIT_FILECOIN_TOKENFilecoin bridge bearer token.
MESHKIT_POLICY_ENDPOINTPolicy provider endpoint.
MESHKIT_POLICY_TOKENPolicy provider bearer token.

Prefer tokenEnv fields in meshkit.config.json for committed config and keep token values in the environment or a secret manager.

Local Setup Commands

CommandRequired argumentsOutput
meshkit initNoneCreates .env.local, meshkit.config.json, and local-dev state if missing.
meshkit devNoneReports provider name, store path, and readiness.
meshkit dev put <name> <content>Optional name, text contentStores encrypted content through the configured provider and returns a MeshFile.

meshkit dev put joins all remaining arguments into a single text payload. It is meant for small local examples and diagnostics, not bulk upload workflows.

Diagnostics Commands

CommandRequired argumentsOutput
meshkit doctorNoneRuns provider health checks through mesh.doctor.run().
meshkit providers testNoneRuns the same health-check path as doctor; use it when the intent is provider validation.
meshkit inspect <cid>cidReturns proof metadata for the CID from mesh.proofs.get(cid).
meshkit logsNoneReturns sanitized provider and observability events.

doctor and providers test prove the configured provider for that CLI process. They do not replace application-level tests of your actual SDK runtime.

Filecoin Bridge Commands

CommandRequired argumentsOutput
meshkit deals status <dealId>dealIdReads persistence status from the configured Filecoin HTTP bridge.
meshkit deals renew <dealId> --duration-days <days>dealId; optional positive integer daysRequests renewal through the bridge.
meshkit deals retrieve <dealId> --output <path>dealId, output pathRetrieves bridge content and writes bytes to the requested local path.

These commands require a configured persistence provider, either through MESHKIT_FILECOIN_ENDPOINT or a persistence block in meshkit.config.json.

Policy Commands

CommandRequired argumentsOutput
meshkit policies testNoneRuns health checks with the configured policy provider available to the client.
meshkit policies audit <policyId>policyIdReturns the policy provider's audit trail for the policy.

Policy commands require a configured policy provider, either through MESHKIT_POLICY_ENDPOINT or a policy block in meshkit.config.json.

Supported Provider Configs

meshkit.config.json must include version: 1. The CLI supports these provider types:

TypeRequired fieldsNotes
local-devNoneOptional store; for demos and repeatable local development only.
ipfs-httpipfsApiUrl, metadataApiUrlUse with a MeshKit metadata service, not raw IPFS alone.
pinning-serviceendpoint, storageAdds pinning behavior around another provider profile.
gateway-retrievalgatewayUrl, storageUses gateway reads around another provider profile.
ipfs-clusterclusterApiUrl, metadataApiUrlCluster coordinates IPFS nodes; metadata still comes from MeshKit service.
fallbackprovidersOrdered provider list; all entries should preserve MeshKit metadata semantics.

Persistence supports filecoin-http. Policy supports lit-http.

Failure Output

Commands return exit code 1 on failure. With --json, failures look like this:

{
  "ok": false,
  "error": {
    "code": "missing_deal_id",
    "message": "Missing deal ID. Usage: meshkit deals status <dealId>",
    "suggestion": "Pass the dealId returned by file.persist."
  }
}

MeshKit errors include code, message, suggestion, and optional sanitized details. Generic thrown errors use cli_error.

Safe Output Rules

Safe to save in CI artifacts:

  • Command name and exit code.
  • Error code and suggestion.
  • CID, deal ID, provider name, proof summary, and redacted endpoint names.
  • JSON output with tokens and plaintext removed.

Unsafe to save:

  • Provider, Filecoin, or policy bearer tokens.
  • Private keys, exported identity secrets, and capability token secrets.
  • Plaintext payloads used with dev put.
  • Retrieved bytes from deals retrieve unless the artifact store is approved for that data.

On this page