CLI Reference
Mero DevTools ships two independent CLIs. calimero-abi-codegen (from
@calimero-network/abi-codegen) generates a typed client from an ABI manifest;
create-mero-app scaffolds a new project from the KV Store reference app.
calimero-abi-codegen
Section titled “calimero-abi-codegen”Parses a WASM-ABI v1 manifest and generates a fully-typed TypeScript client. It
runs in one of two modes: code generation (the default) or validation
(--validate).
# Installnpm install @calimero-network/abi-codegen
# …or run without installingnpx @calimero-network/abi-codegen -i abi.json -o src/generatedOptions
Section titled “Options”| Flag | Description | Default |
|---|---|---|
-i, --input <file> |
Input ABI JSON file. | abi.json |
-o, --output <dir> |
Output directory for the generated file (created if missing). | src |
--client-name <Name> |
Explicit client class name; sanitized to a valid identifier. | derived (see below) |
--name-from <path> |
Derive the client name from a file path (e.g. the .wasm file). |
— |
--import-path <path> |
Import path for the runtime dependency in generated code. | @calimero-network/mero-react |
--validate |
Validate the manifest only; generate nothing. Exits 0 on success. |
— |
-h, --help |
Print usage help. | — |
Client name resolution
Section titled “Client name resolution”When code-generating, the client class name is resolved in strict priority order:
--client-name <Name>— highest priority. Passed throughsanitizeClassName: split on non-alphanumeric characters, capitalize the first letter of each part, keep the rest."Task Board"→TaskBoard,"kv-store"→KvStore, an already-validTestClientstaysTestClient.--name-from <path>— derived withderiveClientNameFromPath: take the file basename, strip its extension, split on non-alphanumerics, and appendClient. Segments of one or two characters are upper-cased whole.- Input basename — falls back to deriving from the
-ifile name with the samederiveClientNameFromPathrule.
Examples
Section titled “Examples”# Generate into src/generated/ (name derived from abi.json → AbiClient)calimero-abi-codegen -i abi.json -o src/generated
# Explicit client class namecalimero-abi-codegen -i abi.json -o src/generated --client-name TodoClient
# Derive the name from the WASM binary pathcalimero-abi-codegen -i abi.json -o src/generated --name-from kv_store.wasmcalimero-abi-codegen --validate -i abi.json✅ ABI manifest validated successfully!📊 Summary: Methods: 5 Events: 2 Types: 8# Point generated imports at a different runtime packagecalimero-abi-codegen -i abi.json -o src/generated \ --import-path @calimero-network/mero-js{ "scripts": { "codegen": "calimero-abi-codegen -i abi.json -o src/generated", "build": "npm run codegen && vite build" }}On a successful generation the tool prints a summary and the path it wrote:
✅ Code generation completed successfully!📊 Summary: Methods: 5 Events: 2 Types: 8 Client: TodoClient📁 Generated files: /abs/path/src/generated/TodoClient.tsIf the input file does not exist, or the manifest fails validation, the tool prints an error and exits with a non-zero status without writing anything.
create-mero-app
Section titled “create-mero-app”Scaffolds a new Calimero application from the KV Store reference app in the
calimero-network/apps monorepo.
npx create-mero-app my-app
# …or the npm-init formnpm create mero-app my-appcreate-mero-app [project-name] [options]| Argument / flag | Description |
|---|---|
[project-name] |
Directory to scaffold into. Omit to use the current directory; its basename must be a valid npm package name. |
-t, --template <name> |
Template to use. rust is the only one, and the default, so this flag is optional. |
Templates
Section titled “Templates”| Name | Source | Contents |
|---|---|---|
rust |
calimero-network/apps → apps/kv-store |
Rust WASM contract + React frontend |
The template is a directory inside the apps monorepo, not a repository of its
own. The standalone calimero-network/kv-store and calimero-network/kv-store-js
repos this CLI used to clone were archived when every app moved into that
monorepo.
There is no javascript template. kv-store-js was archived with no
replacement — for a JavaScript contract, see the examples in
calimero-sdk-js.
What it does
Section titled “What it does”- Validates the project name as an npm package name; refuses a non-empty existing directory.
- Sparse-checks-out
apps/kv-storefromcalimero-network/appsinto a temp directory. Cone mode also brings the repo-root files, which the next step needs. - Copies the app into your project, excluding
.git,.github,.gitignore,.gitattributes,.gitmodules, andnode_modules. - Detaches it from the monorepo — see below.
- Writes a project root (
package.json,pnpm-workspace.yaml) and a README describing the standalone commands. - Prints next steps:
cd,pnpm install,pnpm logic:build,pnpm dev.
Detaching from the monorepo
Section titled “Detaching from the monorepo”An app in apps is deliberately not self-contained: shared versions live at the
repo root so one edit moves the whole fleet. Copying the directory alone would
produce a project that cannot install and cannot build, so three kinds of
inherited reference are resolved against the checkout it came from:
| Inherited | Resolved from | Becomes |
|---|---|---|
"react": "catalog:" |
pnpm-workspace.yaml |
the concrete version range |
edition.workspace = true |
root Cargo.toml |
the concrete value |
calimero-sdk.workspace = true |
root Cargo.toml |
the pinned git dependency |
extends: ../../../tsconfig.base.json |
root tsconfig.base.json |
the file, hoisted into the project |
Nothing is hardcoded in the CLI: the values come from the commit that was
cloned, so a core bump or a frontend release in apps reaches newly scaffolded
projects with no change here. The crate also gains its own [workspace] table,
without which cargo would search parent directories and either fail or adopt an
unrelated workspace above your project.