CLI Reference

Command-line tools for scaffolding apps and generating TypeScript clients from WASM ABI manifests

calimero-abi-codegen

Parses a WASM ABI v1 manifest and generates a fully-typed TypeScript client. Installed as part of @calimero-network/abi-codegen.

Install

npm install @calimero-network/abi-codegen
# or run without installing:
npx @calimero-network/abi-codegen -i abi.json -o src/generated

Options

-i, --input <file>
Input ABI JSON file. Default: abi.json
-o, --outDir <dir>
Output directory for generated files. Default: src
--client-name <Name>
Override the generated client class name. Default derived from input file basename.
--name-from <path>
Derive client name from a file path (e.g. kv_store.wasmKvStoreClient).
--import-path <path>
Override the import path for the mero-react/mero-js dep in generated files. Default: @calimero-network/mero-react
--validate
Validate the ABI manifest only — no code generation. Exits 0 on success.
-h, --help
Show usage help.

Client Name Resolution

The generated client class name is resolved in priority order:

1

--client-name

Explicit name, highest priority. Sanitised to a valid identifier.

--client-name "My Todo App"
# → MyTodoAppClient
2

--name-from

Derive from a file path (e.g. the .wasm file).

--name-from kv_store.wasm
# → KvStoreClient
3

Input basename

Falls back to deriving from the -i file name.

-i my_app.json
# → MyAppClient

Examples

Basic code generation

# Generate into src/generated/
calimero-abi-codegen -i abi.json -o src/generated

# Explicit client class name
calimero-abi-codegen -i abi.json -o src/generated --client-name TodoClient

# Derive name from WASM binary path
calimero-abi-codegen -i abi.json -o src/generated --name-from kv_store.wasm

Validate only

# Check manifest is well-formed (exits 0 on success)
calimero-abi-codegen --validate -i abi.json
# ✅ ABI manifest validated successfully!
# 📊 Summary: Methods: 5 Events: 2 Types: 8

Custom import path (for mero-js without React)

calimero-abi-codegen -i abi.json -o src/generated \
  --import-path @calimero-network/mero-js

package.json scripts

// package.json
{
  "scripts": {
    "codegen": "calimero-abi-codegen -i abi.json -o src/generated",
    "build": "npm run codegen && vite build"
  }
}

Generated Output

The generator produces a single <ClientName>.ts file containing both type definitions and the client class:

// src/generated/KvStoreClient.ts

// — Type definitions (records, variants, aliases) —
export interface SetEntryRequest {
  key: string;
  value: string;
}

// — Generated client class —
export class KvStoreClient {
  constructor(rpc: RpcClient, contextId: string, executorId: string);

  // One method per ABI method:
  getValue(key: string): Promise<string>;
  setValue(req: SetEntryRequest): Promise<void>;
}

Use it with mero.rpc from the SDK:

const client = new KvStoreClient(sdk.rpc, contextId, executorId);
const val = await client.getValue('my-key');

create-mero-app

Scaffold a new Calimero application from a template. Interactive prompts guide you through setup.

Usage

npx create-mero-app
# — or —
npm create mero-app

Templates

rust
Rust kv-store — WASM contract + React frontend starter
javascript
JavaScript kv-store-js — pure JS contract + React frontend

What it does

1
Prompts for project name (validated as npm package name)
2
Lets you choose a template
3
Clones template from GitHub into a new directory
4
Writes your project name into package.json
5
Initialises a fresh git repo