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 a starter template.
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 by cloning a starter template from GitHub.
# Interactive (prompts for the template)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 or javascript. If omitted, you are prompted to choose. |
Templates
Section titled “Templates”| Name | Repository | Contents |
|---|---|---|
rust |
calimero-network/kv-store |
Rust WASM contract + React frontend |
javascript |
calimero-network/kv-store-js |
JavaScript contract + React frontend |
What it does
Section titled “What it does”- Validates the project name as an npm package name; refuses a non-empty existing directory.
- Resolves the template from
--template, or prompts you to pick one. git clone --depth 1the template into a temp directory.- Copies the files into your project, excluding
.git,.github,.gitignore,.gitattributes,.gitmodules, andnode_modules. - Writes your project name into the new
package.json. - Prints next steps:
cd,pnpm install,pnpm dev.