@finos/calm-cli
v1.74.4
Published
A set of tools for interacting with the Common Architecture Language Model (CALM)
Readme
CALM CLI
A command line interface to interact with the CALM schema. You can use these tools to create an architecture from a CALM pattern, or validate that an architecture conforms to a given pattern.
Config file reference
The CLI will load user config from ~/.calm.json to allow profile-level config of CalmHub and other details.
These properties can also be loaded from environment variables; if set they will override the config file.
Note that if they're set on the command line, e.g. --calm-hub-url, this will override both the file and env vars.
| Config file property | Environment variable | Description |
| -------------------- | --------------------------- | ------------ |
| allowedRemoteHosts | CALM_ALLOWED_REMOTE_HOSTS | List of allowed hosts to use when loading files directly from raw URLs. Note that in env variable form this should be a comma-separated list. |
| authPluginPath | CALM_AUTH_PLUGIN_PATH | Path to authentication plugin (should be a JS file.) See Authentication Plugins. |
| calmHubUrl | CALM_HUB_URL | CalmHub instance to use. Note that setting this property will automatically configure CalmHub as a loading mechanism for commands such as validate. |
| directUrlAuthModule | CALM_DIRECT_URL_AUTH_MODULE | Path to the direct-URL authentication module for protected remote document fetches. See Direct URL authentication modules. |
| directUrlAuthConfigPath | CALM_DIRECT_URL_AUTH_CONFIG_PATH | Optional path passed to the direct-URL authentication module constructor. |
| directUrlAuthAuthenticatedHosts | CALM_DIRECT_URL_AUTH_AUTHENTICATED_HOSTS | Required hostnames for direct-URL authentication. In environment-variable form, use a comma-separated list. |
Rather than hand-editing this file, use calm init-config to create or update it.
Using the CLI
Getting Started
Install the CLI on to your machine with this command:
% npm install -g @finos/calm-clior if you use Homebrew:
brew install calm-cliType calm into your terminal, and you should see the help text printed out.
% calm
Usage: calm [options] [command]
A set of tools for interacting with the Common Architecture Language Model (CALM)
Options:
-V, --version output the version number
-h, --help display help for command
Commands:
generate [options] Generate an architecture from a CALM pattern file.
validate [options] Validate a CALM document.
template [options] Generate files from a CALM model using a template bundle, a single file, or a directory of templates
docify [options] Generate a documentation website from your CALM model using a template or template directory
init-ai [options] Augment a git repository with AI assistance for CALM
diff [options] Compare two CALM documents (architectures or patterns), or the moments of a CALM timeline, and report what changed.
timeline [options] Synthesise an implied CALM timeline from a set of local versioned architecture files.
init-config [options] Create or update the CALM CLI configuration file (~/.calm.json).
hub [command] Interact with CALM Hub
workspace [command] Manage CALM workspace bundle and development helpers
help [command] display help for commandGenerating an architecture from a CALM pattern file
This command lets you create a shell of an architecture from a pattern file.
You can try it out using the example patterns provided in this repo under calm/pattern.
calm
Usage: calm generate [options]
Generate an architecture from a CALM pattern file.
Options:
-p, --pattern <file> Path to the pattern file to use. May be a file path or a URL.
-o, --output <file> Path location at which to output the generated file. (default: "architecture.json")
-s, --schema-directory <path> Path to the directory containing the meta schemas to use. (default: the bundled schemas)
-c, --calm-hub-url <url> URL to CalmHub to use when loading documents.
--option-choices <choices> Pre-defined option choices as a JSON object mapping option unique-ids to choice descriptions. Skips interactive prompts.
-v, --verbose Enable verbose logging. (default: false)
-h, --help display help for commandThe most simple way to use this command is to call it with only the pattern option, which will generate an architecture with the default filename architecture.json in the current working directory.
% calm generate -p ./conferences/osff-ln-2025/workshop/conference-signup.pattern.jsonPattern options
Some CALM patterns define options — decision points where the architecture can vary. When a pattern contains options, the generate command will prompt you interactively to make your selections. At the end of the prompts, the CLI prints the choices you made in a format you can save and reuse:
info: Selected choices (reusable with --option-choices): {"connection-options":"Application A connects to Application C","node-options":["Node 1","Node 2"]}To skip the interactive prompts, pass your choices via --option-choices as an inline JSON string or a path to a JSON file.
- For a
oneOfoption (pick exactly one), supply a string value. EveryoneOfoption needs one. - For an
anyOfoption (pick zero or more), supply a string or an array of strings. An empty array, or leaving the option out, chooses none.
# Inline JSON — single oneOf choice
% calm generate -p pattern.json --option-choices '{"connection-options": "Application A connects to Application C"}'
# Inline JSON — mixed oneOf and anyOf
% calm generate -p pattern.json --option-choices '{"connection-options": "Application A connects to Application C", "node-options": ["Node 1", "Node 2"]}'
# From a saved choices file
% calm generate -p pattern.json --option-choices ./my-choices.jsonValidating a CALM architecture
This command will tell you if an architecture matches a pattern that you provide. If it doesn't, then it will output a list of problems that you can address to help your architecture conform to the pattern.
% calm validate --help
Usage: calm validate [options]
Validate a CALM document.
Validation requires:
- an architecture: to validate against CALM schema
- an architecture and pattern: to validate the architecture against the CALM pattern
- a pattern: to validate the pattern against CALM schema
- a timeline: to validate the timeline against CALM timeline schema
Options:
-p, --pattern <file> Path to the pattern file to use. May be a file path or a URL.
-a, --architecture <file> Path to the architecture file to use. May be a file path or a URL.
--timeline <file> Path to the timeline file to validate. May be a file path or a URL.
-s, --schema-directory <path> Path to the directory containing the meta schemas to use. (default: the bundled schemas)
-c, --calm-hub-url <url> URL to CalmHub to use when loading documents.
--assets-path <path> Local path to CALM assets directory for resolving CURIEs without a Hub
-u, --url-to-local-file-mapping <path> Path to mapping file which maps URLs to local paths
--strict When run in strict mode, the CLI will fail if any warnings are reported. (default: false)
-f, --format <format> The format of the output (choices: "json", "junit", "pretty", default: "json")
-o, --output <file> Path location at which to output the generated file.
-v, --verbose Enable verbose logging. (default: false)
-h, --help display help for commandThis command can output warnings and errors - the command will only exit with an error code if there are errors present in the output. Warnings are sometimes provided as hints about how to improve the architecture, but they are not essential for the architecture to match the pattern.
If you were to try and generate an architecture from the conference pattern, and then validate the architecture against that pattern like this
% calm generate -p ./conferences/osff-ln-2025/workshop/conference-signup.pattern.json -o ./conferences/osff-ln-2025/workshop/architecture/conference-signup.arch.json
% calm validate -p ./conferences/osff-ln-2025/workshop/conference-signup.pattern.json -a ./conferences/osff-ln-2025/workshop/architecture/conference-signup.arch.jsonYou would get an output which includes a warning like this:
...
{
"jsonSchemaValidationOutputs": [],
"spectralSchemaValidationOutputs": [
{
"code": "architecture-has-no-placeholder-properties-string",
"severity": "warning",
"message": "String placeholder detected in architecture.",
"path": "/nodes/conference-website/interfaces/conference-website-url/url",
"schemaPath": "",
"line_start": 11,
"line_end": 11,
"character_start": 17,
"character_end": 28
},
{
"code": "architecture-has-no-placeholder-properties-string",
"severity": "warning",
"message": "String placeholder detected in architecture.",
"path": "/nodes/load-balancer/interfaces/load-balancer-host-port/host",
"schemaPath": "",
"line_start": 23,
"line_end": 23,
"character_start": 18,
"character_end": 30
},
{
"code": "architecture-has-no-placeholder-properties-numerical",
"severity": "warning",
"message": "Numerical placeholder (-1) detected in architecture.",
"path": "/nodes/load-balancer/interfaces/load-balancer-host-port/port",
"schemaPath": "",
"line_start": 24,
"line_end": 24,
"character_start": 18,
"character_end": 20
},
{
"code": "architecture-has-no-placeholder-properties-string",
"severity": "warning",
"message": "String placeholder detected in architecture.",
"path": "/nodes/attendees/interfaces/attendees-image/image",
"schemaPath": "",
"line_start": 36,
"line_end": 36,
"character_start": 19,
"character_end": 32
},
{
"code": "architecture-has-no-placeholder-properties-numerical",
"severity": "warning",
"message": "Numerical placeholder (-1) detected in architecture.",
"path": "/nodes/attendees/interfaces/attendees-port/port",
"schemaPath": "",
"line_start": 40,
"line_end": 40,
"character_start": 18,
"character_end": 20
},
{
"code": "architecture-has-no-placeholder-properties-string",
"severity": "warning",
"message": "String placeholder detected in architecture.",
"path": "/nodes/attendees-store/interfaces/database-image/image",
"schemaPath": "",
"line_start": 52,
"line_end": 52,
"character_start": 19,
"character_end": 32
},
{
"code": "architecture-has-no-placeholder-properties-numerical",
"severity": "warning",
"message": "Numerical placeholder (-1) detected in architecture.",
"path": "/nodes/attendees-store/interfaces/database-port/port",
"schemaPath": "",
"line_start": 56,
"line_end": 56,
"character_start": 18,
"character_end": 20
}
],
"hasErrors": false,
"hasWarnings": true
}
...You can also request pretty text output, which shows the same paths and the exact source lines/columns:
Summary
- Errors: no (0)
- Warnings: yes (7)
- Info/Hints: 0
WARN issues:
- In conference-signup.arch.json (./conferences/osff-ln-2025/workshop/architecture/conference-signup.arch.json):
WARN architecture-has-no-placeholder-properties-string: String placeholder detected in architecture.
path: /nodes/conference-website/interfaces/conference-website-url/url
at line 11, col 18 (./conferences/osff-ln-2025/workshop/architecture/conference-signup.arch.json)
11 | "url": "[[ URL ]]"
| ^^^^^^^^^^^
WARN architecture-has-no-placeholder-properties-string: String placeholder detected in architecture.
path: /nodes/load-balancer/interfaces/load-balancer-host-port/host
at line 23, col 19 (./conferences/osff-ln-2025/workshop/architecture/conference-signup.arch.json)
23 | "host": "[[ HOST ]]",
| ^^^^^^^^^^^^
WARN architecture-has-no-placeholder-properties-numerical: Numerical placeholder (-1) detected in architecture.
path: /nodes/load-balancer/interfaces/load-balancer-host-port/port
at line 24, col 19 (./conferences/osff-ln-2025/workshop/architecture/conference-signup.arch.json)
24 | "port": -1
| ^^
WARN architecture-has-no-placeholder-properties-string: String placeholder detected in architecture.
path: /nodes/attendees/interfaces/attendees-image/image
at line 36, col 20 (./conferences/osff-ln-2025/workshop/architecture/conference-signup.arch.json)
36 | "image": "[[ IMAGE ]]"
| ^^^^^^^^^^^^^
WARN architecture-has-no-placeholder-properties-numerical: Numerical placeholder (-1) detected in architecture.
path: /nodes/attendees/interfaces/attendees-port/port
at line 40, col 19 (./conferences/osff-ln-2025/workshop/architecture/conference-signup.arch.json)
40 | "port": -1
| ^^
WARN architecture-has-no-placeholder-properties-string: String placeholder detected in architecture.
path: /nodes/attendees-store/interfaces/database-image/image
at line 52, col 20 (./conferences/osff-ln-2025/workshop/architecture/conference-signup.arch.json)
52 | "image": "[[ IMAGE ]]"
| ^^^^^^^^^^^^^
WARN architecture-has-no-placeholder-properties-numerical: Numerical placeholder (-1) detected in architecture.
path: /nodes/attendees-store/interfaces/database-port/port
at line 56, col 19 (./conferences/osff-ln-2025/workshop/architecture/conference-signup.arch.json)
56 | "port": -1
| ^^which is just letting you know that you have left in some placeholder values which might have been generated with the generate command. This isn't a full break, but it implies that you've forgotten to fill out a detail in your architecture.
CALM Template
The CALM Template system allows users to generate different machine or human-readable outputs from a CALM model by providing a template bundle.
calm template --help
Usage: calm template [options]
Generate files from a CALM model using a template bundle, a single file, or a directory of templates
Options:
-a, --architecture <path> Path to the CALM model JSON file.
-o, --output <path> Path to output directory.
--clear-output-directory Clear the output directory before processing (default: false)
-b, --bundle <path> Path to the template bundle directory.
-t, --template <path> Path to a single .hbs or .md template file
-d, --template-dir <path> Path to a directory of .hbs/.md templates
-u, --url-to-local-file-mapping <path> Path to mapping file which maps URLs to local paths.
-v, --verbose Enable verbose logging. (default: false)
-h, --help display help for commandcalm template will create the output directory if it does not exist.
If the output directory exists, files will be modified if they already
exist. Files that are not in the template bundle will be unmodified.
The --clear-output-directory option changes this behaviour to delete all
files and subdirectories from the output directory first. calm template --template
rejects --clear-output-directory when --output is a file, and the CLI refuses
to clear a filesystem root or any directory that is or contains the current
working directory, the architecture file, or the template/bundle path.
Creating a Template Bundle
A template bundle consists of:
index.json: Defines the structure of the template and how it maps to CALM model elements.A CalmTemplateTransformer implementation: Transforms the CALM model into a format that can be rendered by Handlebars.
Handlebar templates define the final output format. Templates and partials can be in subdirectories. Refer to them in
index.jsonby their path from the bundle root, with/separators (for examplepartials/node.hbs). Call a partial by the same path, for example{{> partials/node.hbs}}.The
--url-to-local-file-mappingoption allows you to provide a JSON file that maps external URLs to local files.
This is useful when working with files that are not yet published but are referenced in the model.Example content
```json { "https://calm.finos.org/docuflow/flow/document-upload": "flows/flow-document-upload.json" } ```Sample usage would be as follows (assuming at root of project)
calm template -a ./cli/test_fixtures/template/model/document-system.json -b cli/test_fixtures/template/template-bundles/doc-system -o one_pager -u cli/test_fixtures/template/model/url-to-file-directory.json -vCALM Docify
The CALM Docify command generates documentation from a CALM model.
calm docify --help
Usage: calm docify [options]
Generate a documentation website from your CALM model using a template or template directory
Options:
-a, --architecture <path> Path to the CALM model JSON file.
-o, --output <path> Path to output directory.
--clear-output-directory Clear the output directory before processing (default: false)
--scaffold Generate scaffold only (templates with placeholders, no rendering).
-t, --template <path> Path to a single .hbs or .md template file
-d, --template-dir <path> Path to a directory of .hbs/.md templates
-u, --url-to-local-file-mapping <path> Path to mapping file which maps URLs to local paths.
--c4-mapping <file|url> C4 mapping for c4-diagram widgets. Defaults to c4.mapping in .calm-workspace/config.json, then the CALM Hub namespace default, then the default mapping
--export-diagrams <svg|png> Render mermaid diagrams to image files using a local Chromium-based browser (adds roughly 10-40s depending on diagram count).
--browser-path <path> Path to a Chromium-based browser executable, only needed if automatic detection fails.
--diagram-render-timeout <ms> Per-diagram render timeout in milliseconds, only used with --export-diagrams (default: 30000).
-v, --verbose Enable verbose logging. (default: false)
-h, --help display help for commandcalm docify will create the output directory if it does not exist.
If the output directory exists, files will be modified if they already
exist. Other files will be unmodified.
The --clear-output-directory option changes this behaviour to delete all
files and subdirectories from the output directory first. When --template
is used with a file --output path, --clear-output-directory is rejected,
and the CLI refuses to clear a filesystem root or any directory that is or
contains the current working directory, the architecture file, or the
template/bundle path.
Two-Stage Workflow (Scaffold Mode)
Scaffold mode enables a two-stage documentation workflow where you can review and edit generated templates before final rendering:
# Stage 1: Generate scaffold with widget placeholders
calm docify --scaffold -a ./architecture.json -o ./website
# Edit generated MDX files in ./website/docs/ as needed
# Stage 2: Render final website from scaffolded templates
calm docify -a ./architecture.json --template-dir ./website -o ./final-siteThis allows architects to customize the documentation before deployment, ensuring that what's previewed in the VSCode extension matches the final output.
Single-Stage Workflow
Sample usage for you to try is as follows (assuming at root of project)
calm docify -a ./cli/test_fixtures/template/model/document-system.json -o ./output/documentation -u ./cli/test_fixtures/template/model/url-to-file-directory.jsonExporting Diagrams as Images
By default, generated documentation contains Mermaid diagrams as ```mermaid code
blocks. The --export-diagrams <svg|png> option renders these diagrams to image
files using a local Chromium-based browser, replacing each code block with a
centered image reference (e.g. <p align="center"><img src="_diagrams/my-page-1.svg" alt="Diagram 1" /></p>).
calm docify -a ./architecture.json -o ./output/documentation --export-diagrams svgThis requires Google Chrome or Microsoft Edge to be installed locally (both are detected automatically). If neither is found, the command prints guidance for locating another Chromium-based browser, and the documentation is still generated with the Mermaid code blocks left as-is.
--browser-path <path>: use a specific Chromium-based browser (e.g. Brave, Vivaldi, Chromium) instead of relying on automatic detection.--diagram-render-timeout <ms>: per-diagram render timeout, useful for very large or complex diagrams (default:30000).
Rendering adds roughly 10-40 seconds to the command depending on the number of diagrams. If an individual diagram fails to render (e.g. a timeout or invalid syntax), it is left as a Mermaid code block and a warning is logged — the rest of the documentation is unaffected.
Default options for widgets in templates
Frontmatter can be used in templates to provide default options for any widgets used:
---
widget-options:
block-architecture:
render-node-type-shapes: true
---
These two are the same:
{{ block-architecture }}
and
{{ block-architecture render-node-type-shapes=true }}
This differs:
{{ block-architecture render-node-type-shapes=false }}CALM init-ai
The init-ai command sets up AI-powered development assistance for CALM architecture modeling by configuring specialized prompt files with comprehensive tool prompts. At present six AI Assistant providers are supported: GitHub Copilot, Claude Code, AWS Kiro, Codex, IBM Bob, and OpenCode.
calm init-ai --help
Usage: calm init-ai [options]
Augment a git repository with AI assistance for CALM
Options:
-p, --provider <provider> AI provider to initialize (choices: "copilot", "kiro", "claude", "codex", "bob", "opencode")
-d, --directory <path> Target directory (defaults to current directory) (default: ".")
-v, --verbose Enable verbose logging. (default: false)
-h, --help display help for commandThis command creates a custom chat prompt configuration for the specified that provides AI assistance with specialized knowledge about CALM architecture modeling, including:
- Schema-accurate guidance: Complete JSON schema definitions for all CALM components
- Critical validation requirements: Emphasis on oneOf constraints and other validation rules
- Best practice enforcement: Naming conventions, relationship patterns, and proper structure
- Comprehensive examples: Realistic architecture examples based on actual CALM patterns
- Tool specialization: Separate tools for nodes, relationships, interfaces, controls, flows, patterns, and metadata
Setting up CALM AI assistance
To set up AI assistance for your CALM project:
# In your project directory
calm init-ai -p <provider>
# Or specify a different directory
calm init-ai -p <provider> --directory /path/to/your/calm-projectThis will create the necessary assistant-specific configuration files to enable CALM-specific AI assistance. Once set up, your selected assistant can use specialized CALM tools that understand schema requirements, validation rules, and best practices. For Codex, this creates a CALM skill under .agents/skills/calm and does not create or modify root AGENTS.md. For OpenCode, this creates a CALM skill under .opencode/skills/finos-calm.
Tool Prompts
The agent includes specialized tools for each CALM component:
- Node Creation: Guide for creating nodes with proper validation and interface definitions
- Relationship Creation: Guide for creating relationships with correct types and constraints
- Interface Creation: Critical guidance for interface oneOf constraints and schema compliance
- Control Creation: Guide for security controls, requirements, and configurations
- Flow Creation: Guide for business process flows and transitions
- Pattern Creation: Guide for reusable architectural patterns using JSON schema constructs
- Metadata Creation: Guide for metadata structure options (single object vs. array)
- Standards Creation: Guide for creating JSON Schema 2020-12 Standards that extend CALM components with organizational requirements
Each tool includes complete schema definitions, validation rules, realistic examples, and cross-references to related tools.
Diffing two CALM documents
This command compares two versions of a CALM document and reports what changed between them. It works on architectures, patterns, and the moments of a CALM timeline, matching nodes and relationships by their unique-id and classifying each as added, removed, modified, or renamed. Architecture diffs also report flows, matched by unique-id and classified as added, removed, modified, or unchanged. For two-document diffing, the document type is auto-detected; use --type to override detection.
% calm diff --help
Usage: calm diff [options]
Compare two CALM documents (architectures or patterns), or the moments of a CALM timeline, and report what changed.
Diff modes:
- two documents: diff -a <doc-a> -b <doc-b>
- a timeline: diff --timeline <file> (diffs every adjacent moment pair)
- timeline pair: diff --timeline <file> --from <id> --to <id> (diffs any two moments)
Timeline moment 'detailed-architecture' references are resolved relative to the timeline file's directory.
Options:
-a, --document-a <file> Path to the first (baseline) CALM document.
-b, --document-b <file> Path to the second CALM document to compare against the baseline.
--timeline <file> Path to a CALM timeline file. Diffs adjacent moments, or a specific pair with --from/--to.
--from <momentId> With --timeline, the unique-id of the baseline moment (requires --to).
--to <momentId> With --timeline, the unique-id of the moment to compare against (requires --from).
-f, --format <format> Output format (choices: "json", "summary", default: "json")
-t, --type <type> Force the document type instead of auto-detecting it. (choices: "architecture", "pattern")
-o, --output <file> Path location at which to write the diff output. If omitted, prints to stdout.
--exit-code Exit with a non-zero status code when changes are detected. Useful in CI to gate version bumps.
-v, --verbose Enable verbose logging. (default: false)
-h, --help display help for command--document-a/--document-b were previously named --architecture-a/--architecture-b. Those flags still work as deprecated, hidden aliases, but print a warning — switch to --document-a/--document-b.
For a quick human-readable overview, use --format summary:
% calm diff -a ./baseline.arch.json -b ./updated.arch.json --format summary
CALM architecture diff
----------------------
Key: + added - removed ~ modified ↔ renamed = unchanged
Nodes: +1 -0 ~1 ↔0 =3
Relationships: +1 -0 ~0 ↔0 =2
Flows: +0 -0 ~1 =1
Nodes added:
- audit-service
...The same command compares two patterns — pass the pattern files instead:
% calm diff -a ./v1.pattern.json -b ./v2.pattern.json --format summaryThe --exit-code flag makes the command exit non-zero when any change (including items skipped for a missing unique-id) is detected, so it can gate version bumps in CI:
% calm diff -a ./baseline.arch.json -b ./updated.arch.json --exit-codeDiffing a CALM timeline
Pass --timeline instead of -a/-b to diff the moments of a CALM timeline (see below for generating one). With no --from/--to, every adjacent pair of moments is diffed in turn:
% calm diff --timeline ./calm-timeline.json --format summaryTo diff any two specific moments (not just adjacent ones), pass both --from and --to with the moments' unique-ids:
% calm diff --timeline ./calm-timeline.json --from moment-1 --to moment-3 --format summarySynthesising a CALM timeline
The timeline command builds a CALM timeline document from a set of local, versioned architecture files — one moment per input file, in the order the files are given.
% calm timeline --help
Usage: calm timeline [options]
Synthesise an implied CALM timeline from a set of local versioned architecture files.
One moment is generated per input architecture, in the order the files are given
(plain files have no semver versions to sort by). Each moment's name/description
is taken from the architecture's own name/description when present, else derived
from the filename. The 'detailed-architecture' reference is written relative to
the --output file's directory so the timeline is portable and reloadable by
'calm validate --timeline' / 'calm diff --timeline'.
Options:
-a, --architecture <files...> Paths to architecture files, in moment order. Repeat the flag or pass several paths after one flag.
-o, --output <file> Path location at which to write the generated timeline. If omitted, prints to stdout.
-v, --verbose Enable verbose logging. (default: false)
-h, --help display help for command% calm timeline -a v1.json -a v2.json -a v3.json -o calm-timeline.jsonThe resulting timeline file can be validated with calm validate --timeline or diffed moment-by-moment with calm diff --timeline (see above).
Managing the config file with init-config
Rather than hand-editing ~/.calm.json, use calm init-config to create or update it. Existing values are preserved and merged with anything new you provide.
% calm init-config --help
Usage: calm init-config [options]
Create or update the CALM CLI configuration file (~/.calm.json).
Options:
--allowed-remote-hosts <hosts> Comma-separated list of trusted remote hosts to allow for direct URL loading
--calm-hub-url <url> URL to a trusted file location (e.g. CALMHub) to allow for direct URL loading of CALM documents
--auth-plugin-path <path> Path to the CALM Hub authentication plugin
--direct-url-auth-module <path> Optional path to the direct URL authentication plugin module
--direct-url-auth-config-path <path> Optional config path for the direct URL authentication plugin module
--direct-url-auth-authenticated-hosts <hosts> If direct-url-auth-module is specified, this specifies a comma-separated list of hostnames requiring direct URL authentication plugin module
-h, --help display help for commandcalm init-config \
--calm-hub-url https://calmhub.example.com \
--allowed-remote-hosts raw.githubusercontent.com,calm.finos.org \
--auth-plugin-path /full/path/to/plugins/auth-plugin.js \
--direct-url-auth-module /full/path/to/plugins/direct-url-auth.js \
--direct-url-auth-config-path ~/plugins/direct-url-auth.config.json \
--direct-url-auth-authenticated-hosts protected.example.com,secure.example.com--direct-url-auth-module and --direct-url-auth-authenticated-hosts must be set together. You can add --direct-url-auth-config-path and additional hosts the next time you run calm init-config.
The two host-list options trim whitespace, remove empty entries, and merge new hosts with the existing values without duplicates. Scalar options replace their existing values when supplied. Plugin and module paths are stored as provided and validated at use time by the CLI. Fully qualified paths are recommended to avoid unpredictable behavior caused by relative path resolution.
Authentication plugins
The CLI supports an external authentication plugin to allow authentication to CalmHub in enterprise environments, where seamless auth will likely require specific logic.
Writing an authentication plugin
Authentication plugins are JavaScript files. You can find an example in the test fixtures.
Plugins must export a default class implementing the AuthPlugin interface, i.e. a getAuthHeaders(url, requestBody) method that returns a Promise<Record<string, string>>.
The function getAuthHeaders will be invoked with the request URL and body for every request made to CalmHub by the CLI.
Using an authentication plugin
To configure your CLI to use an auth plugin, use ~/.calm.json in the same fashion as configuring a CalmHub URL:
{
"calmHubUrl": "http://calmhub.com",
"authPluginPath": "~/plugins/auth-plugin.js"
}Direct URL authentication modules
Direct URL authentication is configured separately from CalmHub authentication. Use this when the CLI needs to fetch a protected http(s) document through DirectUrlDocumentLoader. The required authenticatedHosts list identifies the hosts that use this module and automatically adds them to the direct URL allowlist.
Direct URL auth modules are local JavaScript files. They must export a default class whose constructor accepts an optional configPath string and whose instances implement getAuthHeaders(url, requestBody). See Direct URL Document Loader - Custom Authentication Plugin for details.
The CLI loads the module the first time a document on an authenticated host needs headers. It instantiates the module once per process as new DefaultExport(configPath) and calls getAuthHeaders for each protected direct-URL request after host and URL safety checks pass.
Example ~/.calm.json:
{
"directUrlAuthModule": "~/plugins/direct-url-auth.js",
"directUrlAuthConfigPath": "~/plugins/direct-url-auth.config.json",
"directUrlAuthAuthenticatedHosts": ["protected.example.com"]
}The entries must be exact hostnames (case-insensitive); URLs, ports, paths, and wildcards are not supported. Other allowlisted hosts continue through the unauthenticated direct URL path.
This flow does not replace authPluginPath: authPluginPath still applies only to CalmHub requests, and direct-URL authentication applies only to configured direct http(s) hosts.
CALM Hub
The calm hub commands let you push, pull, list, and create resources on a CalmHub instance directly, one document/resource at a time. (If you're managing a whole set of interrelated documents, see CALM Workspace below, which wraps these same operations for a tracked bundle of files.)
% calm hub --help
Usage: calm hub [command]
Interact with CALM Hub
Commands:
push [command] Push a CALM document to CALM Hub
pull [command] Pull a CALM document from CALM Hub
list [command] List CALM Hub resources
whoami [options] Show your personal namespace in CALM Hub, and whether it exists
create [command] Create CALM Hub resources
extensions [command] List and describe the extensions that CALM Hub enabled
ext [options] <id> <command> Run an extension command through CALM Hub and print the reply
help [command] display help for commandEvery subcommand accepts -c, --calm-hub-url <url> (falls back to calmHubUrl in ~/.calm.json if omitted).
calm hub push
Pushes a document whose $id contains a full CalmHub document ID (namespace, type, mapping slug, and version). The type in the $id must match the subcommand, or the push fails before it contacts CalmHub. By default, push auto-bumps: it computes a new version off the latest published release (or creates the mapping at 1.0.0 if it doesn't exist yet). If CalmHub holds only snapshots, it publishes the release of the highest snapshot, for example 1.0.0 for 1.0.0-SNAPSHOT. CalmHub deletes V-SNAPSHOT when V is published, so push refuses to publish a version that has a snapshot unless the document's $id is already at that version. A document whose $id is at a -SNAPSHOT version is never bumped: it is pushed at that version and overwrites the snapshot in CalmHub, or is skipped if unchanged. --change-type and --fail-if-modified do not apply to it.
calm hub push <architecture|pattern|standard|interface|flow|timeline|control-requirement|control-configuration> <file> [options]| Option | Applies to | Description |
|--------|------------|-------------|
| --name <name> | architecture, pattern, standard, interface, flow, timeline | Overrides the document's title field in CalmHub (a flow's name field). |
| --description <description> | architecture, pattern, standard, interface, flow, timeline | Overrides the document's description field. |
| -c, --calm-hub-url <url> | all | CalmHub instance to push to. |
| -f, --format <format> | all | Output format: json (default) or pretty. |
| -t, --change-type <type> | all | Version bump type when auto-bumping: patch (default), minor, or major. |
| --fail-if-modified | all | Strict mode: don't auto-bump. Skip if the document is unchanged from the latest published version; fail if it's changed. A brand-new mapping is still created at 1.0.0. |
# Auto-bump: creates the next patch version off the latest published version
calm hub push architecture ./architectures/payment-service.json
# Strict merge-time push: fail if this exact version already exists with different content
calm hub push pattern ./patterns/microservice-pattern.json --fail-if-modified
calm hub push interface ./interfaces/payment-api.interface.json
calm hub push flow ./flows/payment-processing.flow.json
calm hub push timeline ./timelines/roadmap.timeline.json
# Control documents don't take --name/--description
calm hub push control-requirement ./controls/encryption-at-rest.requirement.json
calm hub push control-configuration ./controls/encryption-at-rest.config.jsonThe local document is normalised the same way CalmHub stores it before comparing content, so a version-only or defaulted-field difference between disk and CalmHub is not mistaken for a real change.
calm hub pull
Pulls a specific (or latest) version of a resource from CalmHub.
calm hub pull <architecture|pattern|standard|interface|flow|timeline|control-requirement|control-configuration> [options]| Option | Applies to | Description |
|--------|------------|-------------|
| --namespace <namespace> | architecture, pattern, standard, interface, flow, timeline (required) | Source namespace. |
| -m, --mapping <mapping> | architecture, pattern, standard, interface, flow, timeline (required) | Mapping slug of the document to pull. |
| --domain <domain> | control-requirement, control-configuration (required) | Source domain. |
| --control-name <controlName> | control-requirement, control-configuration (required) | Control name. |
| --config-name <configName> | control-configuration (required) | Configuration name. |
| --ver <version> | all | Version to retrieve (defaults to the latest). |
| -c, --calm-hub-url <url> | all | CalmHub instance to pull from. |
| -o, --output <file> | all | Write output to this file instead of stdout. |
calm hub pull architecture --namespace com.example --mapping payment-service --ver 2.1.0 -o ./payment-service.json
calm hub pull interface --namespace com.example --mapping payment-api
calm hub pull flow --namespace com.example --mapping payment-processing --ver 1.0.0
calm hub pull timeline --namespace com.example --mapping roadmap --ver 1.0.0
calm hub pull control-configuration --domain security --control-name encryption-at-rest --config-name defaultcalm hub list
Lists resources of a given kind.
calm hub list <architectures|patterns|standards|interfaces|flows|timelines|namespaces|domains|controls|control-configurations> [options]| Option | Applies to | Description |
|--------|------------|-------------|
| --namespace <namespace> | architectures, patterns, standards, interfaces, flows, timelines | Target namespace (default: "default"). |
| --domain <domain> | controls (required), control-configurations (required) | Target domain. |
| --control-name <controlName> | control-configurations (required) | Control name. |
| -c, --calm-hub-url <url> | all | CalmHub instance. |
| -f, --format <format> | all | Output format: json (default) or pretty. |
calm hub list architectures --namespace com.example
calm hub list interfaces --namespace com.example
calm hub list flows --namespace com.example
calm hub list timelines --namespace com.example
calm hub list namespaces
calm hub list control-configurations --domain security --control-name encryption-at-restConventions
A convention is versioned JSON that tools read, such as a c4-mapping. A convention has no $id, so the commands take the convention type and --namespace. push convention finds the convention by its name, which defaults to the convention's unique-id. A new name creates the convention at 1.0.0. A known name gets the next version (see --change-type), or is skipped when the content is unchanged. --set-default also makes the pushed version the namespace default, which child namespaces inherit. It needs namespace admin.
pull convention without --id pulls the default that applies to the namespace, which can come from a parent namespace. It writes the convention JSON to stdout, and on stderr it says where the default comes from.
calm hub push convention c4-mapping ./acme-c4-mapping.json --namespace org --set-default
calm hub list conventions c4-mapping --namespace org
calm hub pull convention c4-mapping --namespace org.payments # the namespace default
calm hub pull convention c4-mapping --namespace org --id 1 --ver 1.0.0calm hub create
Creates a new namespace or domain, or your personal namespace.
calm hub create <namespace|domain|my-namespace> [options]| Option | Applies to | Description |
|--------|------------|-------------|
| --name <name> | both (required) | Namespace or domain name. |
| --description <description> | namespace (required) | Namespace description. |
| -c, --calm-hub-url <url> | all | CalmHub instance. |
| -f, --format <format> | all | Output format: json (default) or pretty. |
calm hub create namespace --name com.example --description "Example org namespace"
calm hub create domain --name securitycalm hub create my-namespace creates your personal namespace when the CALM Hub operator has turned on personal namespaces. It takes only -c and -f, and does nothing if you already own the namespace.
calm hub whoami
Shows your personal namespace and whether it exists, is yours, or is held by another user. Takes -c and -f.
calm hub whoami --format prettycalm hub extensions and calm hub ext
Run the commands of the extensions that a CalmHub operator enabled. The commands are fixed, so --help works without a CalmHub. An extension command runs only under calm hub ext <id>, so it cannot replace a built-in command.
calm hub extensions list [options]
calm hub extensions describe <id> [command] [options]
calm hub ext <id> <command> [--input <file|->] [--arg key=value]... [--timeout <seconds>] [options]| Option | Applies to | Description |
|--------|------------|-------------|
| --input <file> | ext | JSON file with the command input object, or - for stdin. |
| --arg <key=value> | ext | Sets a top-level input property. Repeatable, and overrides --input. The value gets the type that the input schema declares for the property. A number converts only when it is written as it is sent, so 0x10, 1e3, 1.0, NaN, Infinity and an integer above 2^53 stay strings. It cannot set __proto__. If you repeat a key, only the last value stays: for an array, use --arg k='["a","b"]'. |
| --timeout <seconds> | ext | Stops waiting for the reply, after a decimal number of seconds up to 2147483. With none, CalmHub ends the call at the request-timeout-seconds of the extension. A write can still complete after the CLI stops waiting. |
| -c, --calm-hub-url <url> | all | CalmHub instance. |
| -f, --format <format> | all | Output format: json (default) or pretty. For ext, it changes only the error format. |
ext reads the command's route from CalmHub. Input properties that match a {param} in the route path fill the path. A value that fills the path must not be empty or ., or contain .., /, \, %, @, a look-alike of /, \, ., %, @ or ;, a code point whose NFKC form contains / or \ (such as U+2100, a/c), a control character or a lone surrogate. A value that makes the path match another route of the extension is refused too. A query name or value must not contain a control character or a lone surrogate. ext refuses such a value before the call (see the CLI hub docs). The other properties go to the query for GET and DELETE, and to the JSON body for other methods. A number fills the path or query in plain notation, as for an MCP tool. CalmHub checks the route, the path and the scope, but not the input: the extension checks it. An error is printed with its body as CalmHub sent it. CalmHub sends a generic 502 in place of the reply when the extension refuses the connection, when the reply is too large, when the extension replies with a 3xx, 401, 407 or 5xx status, or when the reply has a content type that CalmHub does not pass on. It sends 504 when the connection or the reply takes too long.
calm hub extensions list -f pretty
calm hub extensions describe example-services list-services
calm hub ext example-services list-services --arg namespace=finos
echo '{"namespace":"finos","name":"payments"}' | calm hub ext example-services add-service --input -CALM Workspace
The calm workspace commands give you a local development environment for working with a set of CALM documents. A workspace tracks which documents you care about, keeps copies (or references) of those files in a single bundle directory, and can sync them to a CalmHub instance.
Concepts
Workspace — a named collection of CALM documents living inside a git repository. Metadata lives under .calm-workspace/ at the repository root; the active workspace is recorded in .calm-workspace/workspace.json.
Bundle — the on-disk directory for a workspace (<repo-root>/.calm-workspace/bundles/<name>/). It contains:
workspace-manifest.json— an index of every tracked document, keyed by document ID, with each entry recording its file path, document type, and (optionally) its CalmHub namespace.files/— documents copied into the bundle (when--copyis used). Referenced documents are stored at their original location.
Document ID — the key used to identify a document within a workspace. Resolved in order: --id flag → title field in the JSON → user prompt.
Commands
calm workspace init <name>
Create or update a workspace. Creates the bundle directory and sets it as the active workspace.
calm workspace init <name> [--dir <path>]| Option | Description |
|--------|-------------|
| --dir <path> | Directory in which to create the workspace. Defaults to the repository root (detected via git). |
calm workspace init my-system
# Workspace 'my-system' created/updated at .calm-workspace
# Bundle directory ensured at .calm-workspace/bundles/my-systemcalm workspace add <file>
Register a CALM JSON document or narrative Markdown document with the active workspace. By default the file is referenced at its current location on disk (no copying). Prompts interactively for document type and (manifest) name if they cannot be determined automatically.
calm workspace add <file> [--id <id>] [--type <type>] [--namespace <namespace>] [--copy] [--calm-hub-document-id <id> --ver <version> [--calm-hub-url <url>]]| Option | Description |
|--------|-------------|
| --id <id> | Explicit manifest registration id. Overrides automatic resolution. |
| --type <type> | Document type. If omitted, it comes from a conformant CalmHub $id, or else an interactive dropdown is shown. One of: pattern, architecture, interface, flow, control, schema, timeline, adr, knowledge, sad. |
| --namespace <namespace> | CalmHub namespace to record in the manifest. It is required for narrative Markdown and otherwise derived from the document $id when omitted. |
| --copy | Copy the file into the bundle's files/ directory instead of referencing it in place. |
| --calm-hub-document-id <id> and --ver <version> | Recover an existing narrative document. Both options are required together. |
| --calm-hub-url <url> | Optional CalmHub URL used only for narrative recovery. It otherwise uses the configured URL. |
Narrative Markdown documents. Use --type knowledge or sad. add reads YAML frontmatter. A non-empty title becomes the manifest name unless you supply --id. --namespace is required. The initial manifest version is 1.0.0. Markdown has no CALM $id and is never rewritten.
To restore a removed narrative document without creating a new CalmHub document, supply its verified Hub id and version. The local Markdown must exactly match the stored Hub version.
JSON document $id handling. For JSON mapping documents, add inspects the file's CalmHub $id:
- No
$id→ you are prompted interactively to build one from its components (see below); the$idis written into the file and the document is added. - Conformant
$id→ left untouched; the manifest namespace is derived from it. The document type must agree with the$id, oraddfails and adds nothing: for a namespace resource,pushandbumpuse the type in the$id, butcheckvalidates by the manifest type. The$idtypes map topattern,architecture,flow,schema(standards),interfaceandcontrol(requirements and configurations). Atimelineoradrhas no CalmHub$idtype of its own, so a conformant CalmHub$idis rejected as a type mismatch. - Non-conformant
$id→ left as-is; a warning is printed and the document is still tracked, but it cannot be pushed to CalmHub until the$idis fixed (silently rewriting it would lose data for types that don't use CalmHub URLs, e.g.adr,timeline).
Manifest name resolution (when --id is not given): the title field from the JSON file (name for a flow with no title) or Markdown frontmatter, else an interactive prompt.
# Interactive — prompts for type, builds the $id if needed, then the manifest name
calm workspace add ./architectures/payment-service.json
# Reference an already-conformant document without copying
calm workspace add ./architectures/payment-service.json --type architecture
# Register a narrative Markdown document; the frontmatter title becomes its manifest name
calm workspace add ./docs/payments-sad.md --type sad --namespace finos
# Restore an existing narrative document
calm workspace add ./docs/payments-sad.md --type sad --namespace finos --calm-hub-document-id 42 --ver 1.2.0calm workspace new [type] [name] [template]
Create a new stub CALM document in the current directory, then register it with the active workspace. The document's CalmHub $id is always built interactively. Any other argument not provided on the command line is requested interactively.
calm workspace new [type] [name] [template]The created file is named <slug>.<type>.json (where <slug> is the mapping id, or the control/config name) and contains a minimal document whose $id is the one you built and whose title is the name you provide. A flow is a CALM flow instead: the name goes in name, the slug becomes its unique-id, and it has one empty transition to fill in. The namespace (for namespace resources) is stored in the manifest so the document can be pushed to CalmHub without extra flags.
# Fully interactive
calm workspace new
# Provide the type and title up front; still prompts for the $id components
calm workspace new architecture "Payment Gateway"Building a CalmHub $id interactively
When new (always) or add (when needed) builds a $id, it asks for the resource scope and then each component, defaulting the version to 1.0.0 and the base URL to your configured CalmHub URL (calmHubUrl in ~/.calm.json). The result is one of:
namespace resource: $BASE_URL/calm/namespaces/$NAMESPACE/$TYPE/$MAPPING/versions/$VERSION
control requirement: $BASE_URL/calm/domains/$DOMAIN/controls/$CONTROL/requirement/versions/$VERSION
control configuration: $BASE_URL/calm/domains/$DOMAIN/controls/$CONTROL/configurations/$CONFIG/versions/$VERSIONwhere $TYPE is one of patterns, architectures, flows, standards, interfaces. When the document type fixes the resource type (for example flow gives flows), the scope and resource type are not asked. A control document is asked only whether it is a requirement or a configuration. A timeline or adr has no CalmHub resource type, so it asks only for a document id.
calm workspace push
Push every document in the workspace manifest to a CalmHub instance. JSON mapping documents derive their identity — namespace, type, mapping id and version — from $id (of the form $BASE_URL/calm/namespaces/$NAMESPACE/$TYPE/$MAPPING_ID/versions/$VERSION). Push does not auto-bump: it creates exactly the version each document declares. Documents without a well-formed mapping $id (or whose type has no CalmHub resource type) are skipped with a warning.
Narrative Markdown documents use --type knowledge or --type sad. They require YAML frontmatter with a title and --namespace. The first push stores the Hub numeric document id, location, and version (1.0.0) in workspace-manifest.json. Later changes require workspace bump; the command updates the manifest version without rewriting the Markdown.
If a create request has an uncertain outcome, the entry stays pending and another push requires explicit reconciliation. The document might exist in CalmHub, or the request might not have reached the server. Check CalmHub before choosing a recovery path:
- If the document exists, confirm its numeric document ID and run
calm workspace add <file> --id <workspace-id> --type <type> --namespace <namespace> --calm-hub-document-id <document-id> --ver <version>. Use the pending entry's workspace ID, type, namespace, and version. The local Markdown must match the Hub version; differences in line-ending style (LF vs CRLF) are ignored. Add--calm-hub-url <url>if it is not configured. - If you confirm that no document was created, run
calm workspace rm <workspace-id>, thencalm workspace add <file> --id <workspace-id> --type <type> --namespace <namespace>. Removal clears the pending entry and keeps the file. Re-adding starts at version1.0.0. Correct the Hub URL or connection problem before pushing again.
calm workspace push [--calm-hub-url <url>] [--fail-if-modified] [--base-url <url>]| Option | Description |
|--------|-------------|
| --calm-hub-url <url> | CalmHub base URL. If omitted, falls back to calmHubUrl in ~/.calm.json. |
| --fail-if-modified | Fail the push if a document that already exists in CalmHub at its declared version has changed on disk. Overrides push.failIfModified in the workspace config. |
| --base-url <url> | The base URL each document's $id must start with. Defaults to the CalmHub URL, with trailing slashes removed. Set it when CalmHub's calm.hub.base-url is different from the URL you use to reach it, for example behind a proxy. |
Push does not send a JSON mapping document whose $id base URL does not match, because CalmHub would reject it. It reports an error and the push fails.
For each tracked document, push looks up the existing versions in CalmHub:
- Version does not exist → creates it.
- Version already exists, content unchanged → skips it (idempotent; good for local re-runs).
- Version already exists, content changed on disk → behaviour depends on
push.failIfModified(defaultfalse):false— logs and skips.true— reports the conflict and fails the push (strict; good for merge-time CI). Runbumpfirst to create a new version.
A changed -SNAPSHOT version is overwritten regardless of --fail-if-modified — CalmHub treats it as mutable. An unchanged snapshot is skipped. Push also refuses to publish a non-snapshot document that references a -SNAPSHOT version, of a tracked document or pinned in the ref; run workspace release on that dependency first, or pin a released version.
calm workspace push # URL from ~/.calm.json
calm workspace push --calm-hub-url https://calmhub.example.com
calm workspace push --fail-if-modified # strict merge-time mode# First-class document POC: add, publish, inspect, edit, bump, and publish again
calm workspace add ./docs/payments-sad.md --type sad --namespace finos
calm workspace push --calm-hub-url http://localhost:8080
calm workspace show # shows the published Hub location
calm workspace check --calm-hub-url http://localhost:8080
# Edit ./docs/payments-sad.md, then bump and publish the new version
calm workspace bump --minor --calm-hub-url http://localhost:8080
calm workspace push --calm-hub-url http://localhost:8080calm workspace check
Check whether any tracked document has changed on disk relative to CalmHub but has not been version-bumped. Intended as a CI/PR gate — it exits non-zero when a bump is required, so a PR cannot merge with unversioned changes.
calm workspace check [--calm-hub-url <url>] [--base-url <url>]| Option | Description |
|--------|-------------|
| --calm-hub-url <url> | CalmHub base URL. If omitted, falls back to calmHubUrl in ~/.calm.json. |
| --base-url <url> | The base URL each document's $id must start with. Defaults to the CalmHub URL. |
check fails for each JSON mapping document whose $id base URL does not match, because CalmHub would reject it. A bump does not correct this, so check does not also report that document as needing a bump.
A document is flagged when its on-disk $id version still matches a version in CalmHub but its content differs. Brand-new documents (not yet in CalmHub) and already-bumped documents (whose version is ahead of CalmHub) are not flagged. A modified -SNAPSHOT document is never flagged — it's mutable, so push just overwrites it.
check also fails if a document that is not itself a snapshot references a tracked document that still is, or has a ref pinned to a -SNAPSHOT version of any resource — that would bake a reference to mutable content into what's meant to be an immutable release. Run workspace release on the dependency first, or pin a released version.
After checking for unbumped documents, check also validates every architecture and pattern in the workspace and prints a summary. It loads documents with the same ~/.calm.json settings as calm validate, so an architecture whose $schema is a CalmHub pattern is validated against that pattern. It can print some of the same configuration lines as calm validate, for example Configuring CALMHub document loader with base URL. The summary looks like this:
All 3 document(s) passed validation.or, if a document fails:
1 document(s) failed validation:
my-arch (2 error(s)) — run `calm validate -a .calm-workspace/files/my-arch.json` to see full outputThe command exits non-zero if any documents need bumping, if a $id base URL does not match, or if any document fails validation. It also exits non-zero if validation cannot run. A ~/.calm.json setting that stops calm validate, for example a direct-URL authentication setting that is not valid, also stops check before it compares the workspace with CalmHub.
check also warns when a tracked file is in a directory where CALM Hub GitHub mode will not import it as its type (architectures/, patterns/, standards/ [or standard-nodes/], flows/, interfaces/, controls/, adrs/, timelines/, decorators/):
Tracked file 'drafts/payments.json' has $id type 'architectures' but is not in an 'architectures/' directory. CALM Hub GitHub mode will not import the file.Directory layout warnings alert authors to misplaced files before merge and do not change the exit code.
calm workspace bump
Bump the version of every document that has changed on disk relative to CalmHub, and update every reference to those documents across the workspace so everything stays in sync.
calm workspace bump [--calm-hub-url <url>] [--major | --minor | --patch] [--inherit-change-type] [--base-url <url>]| Option | Description |
|--------|-------------|
| --calm-hub-url <url> | CalmHub base URL. If omitted, falls back to calmHubUrl in ~/.calm.json. |
| --major | Apply a major bump to all changed documents without prompting (e.g. 1.2.3 → 2.0.0). |
| --minor | Apply a minor bump to all changed documents without prompting (e.g. 1.2.3 → 1.3.0). |
| --patch | Apply a patch bump to all changed documents without prompting (e.g. 1.2.3 → 1.2.4). |
| --inherit-change-type | Suppress prompts for cascade-bumped dependents; they silently inherit the trigger's bump type. |
| --base-url <url> | The base URL each document's $id must start with. Defaults to the CalmHub URL. |
If a document's $id base URL does not match, bump fails before it changes a file. A new version does not correct the base URL, and push would reject it.
When none of --major, --minor, or --patch is given, bump prompts interactively for each changed document:
? Bump type for 'my-pattern' (currently 1.0.0): › minor (default)
? Bump type for 'my-arch' (depends on my-pattern): › minor (inherited)Documents bumped as a cascade dependency of another document also get a prompt, with the trigger's increment pre-selected as the default. Pass --inherit-change-type to skip cascade prompts and auto-inherit silently.
The default increment when no flag is given is MINOR (overridable via bump.defaultIncrement in the workspace config). For each changed document the new version is computed relative to CalmHub's latest version, the file's $id is rewritten, and any $ref / $schema / requirement-url / config-url in all tracked documents that pointed at the old version is repointed to the new one (fragments preserved).
Bump is idempotent: editing → bumping → editing again → bumping again only moves the version by a single increment, because once a document's on-disk version is ahead of CalmHub it is left alone until that version is pushed.
If CalmHub holds a -SNAPSHOT of a new version, bump warns: pushing that version deletes the snapshot. Use a different increment unless you mean to release it.
After bumping, bump validates every architecture and pattern in the workspace and prints the same pass/fail summary as workspace check. This is informational only: a document that fails validation does not change the exit code. A ~/.calm.json setting that stops calm validate, for example a direct-URL authentication setting that is not valid, also stops bump before it changes any file. A direct-URL authentication module that cannot load does not stop bump. The module loads only when validation needs it, after bump writes the new versions, so each document that needs the module shows (could not validate).
