CLI tools

The BlockML CLI is the toolchain for scaffolding, exploring, checking and compiling Blocks. Bootstrap a repo with npx @blockml/cli init, then invoke npx blockml from the project. BML stays the source of truth — companions such as TypeScript, HTML or XSD are derived.

terminal npx
npx blockml --help

Every command

These are the tools printed by npx blockml --help. Run npx blockml <command> --help for flags, defaults and constraints.

init Scaffold a project
search Where something is
scan Which packages or types match
inspect The Block already resolved
graph How it connects
new Create a Block .bml
validate Parser + semantic check
compile Render a target
transform Run a ModelTransformation

Everyday workflow

Discover the model with the CLI first. Generic grep, find and file reads remain allowed — they are not the first way in.

  1. search / scan Find FQNs
  2. inspect Read the resolved Block
  3. graph See structure if needed
  4. edit BML Smallest change
  5. validate Check the model
  6. compile Update companions
Start

Turn a folder into a project

Bootstrap a new repo with npx @blockml/cli init. Afterward use npx blockml. Empty folders get a Node.js package; existing package.json files are merged.

Discover

Find your way in the model

Use these four before opening files. The corpus is the same as validate --all.

Change

Create, check, compile

Edit BML first. Then validate. Then compile or update companions to match. Do not patch generated output to fix the model.

Shared flags

Most commands accept the same corpus and output flags. Exit 0 on success, 1 on diagnostic errors, 2 on usage or configuration errors.

Start with init

Run npx @blockml/cli init with a package FQN, then npm install && npx blockml validate. After that, npx blockml is the everyday CLI.