How-To: Use CALM CLI

Overview

The CALM CLI (@finos/calm-cli) is a tool for interacting with the Common Architecture Language Model (CALM). It allows for validating architectural conformance, generating architectures from patterns, and creating documentation from CALM models.

Additional Context: See SDS-039: CALM CLI Service for the service specification related to this tool.


Prerequisites


Installation

The tool is already included in the project’s devDependencies. To ensure it is installed:

1
pnpm install

Basic Usage

You can run the globally installed workspace version using pnpm exec:

1
pnpm exec calm [command] [options]

To check the version:

1
pnpm exec calm --version

Common Commands

1. Validate Architecture

Validate that an architecture conforms to a given CALM pattern.

1
pnpm exec calm validate --architecture <path/to/architecture.json> --pattern <path/to/pattern.json>

2. Generate Architecture

Generate an architecture from a CALM pattern file.

1
pnpm exec calm generate --pattern <path/to/pattern.json> --output <path/to/output.json>

3. Generate Documentation (Docify)

Generate a documentation website or artifacts from your CALM model.

1
pnpm exec calm docify --input <path/to/calm/file> --output <directory>

4. Template Generation

Generate files from a CALM model using templates.

1
pnpm exec calm template --calm <path/to/calm/file> --template <path/to/template>

Help

To see all available commands and options:

1
pnpm exec calm --help

For help on a specific command:

1
pnpm exec calm [command] --help