CLI Workflow
The cfu commands a definition developer uses day to day: validating definitions and configurations, inspecting the workspace, generating artifacts, and formatting.
All commands take files or directories as positional arguments and default to the current directory; workspace discovery starts from there.
Common Options
Every command supports -v/--verbose <level>, -q/--quiet, --color auto|always|never, and --no-auto-update.
All commands which process the workspace support -t/--continuous, which re-runs the command whenever an input file changes; combined with an editor this gives near-IDE feedback
from a plain terminal.
cfu def validate, cfu cfg validate, and cfu format support --output-format json|sarif, which renders the diagnostics as a machine-readable report on stdout instead of the
human text on stderr, see the CLI reference of the user manual.
cfu def validate and cfu cfg validate support -D/--deny warnings|infos, which fails a run that reports only warnings, or only informational messages.
Use it in CI to keep a branch free of warnings or infos.
Initialize a Workspace
cfu init # scaffold with the default definition name "Example"
cfu init --name MyProduct # choose the definition name (UpperCamelCase)
Scaffolds a new workspace in the current directory:
* a .confu marking the workspace root,
* .editorconfig for JSON/JSON5,
* An example definition plus a matching configuration.
* It runs git init unless the directory or an ancestor is already a git repository, and the .editorconfig is marked root = true only when no ancestor already has one.
* After writing the files it formats and validates them, so a fresh workspace starts out clean.
It refuses to run when the directory already contains a .confu.
List Definitions
cfu def list .
Lists the definition names of the workspace with their configurationFileMode and their file.
The name is what a configuration binds to with $definition, so this is the list the config authors of your definition need.
Inspect a Definition
cfu def inspect . # every definition of the workspace
cfu def inspect --def MyDefinition --depth 3 .
Prints the resolved definitions as a tree: entities, structs and unions with their multiplicity, and every parameter with its type, range and default.
Use --at <TypePath> to print a single type instead of the whole definition.
Validate Definitions
cfu def validate .
Parses and checks all .def.json5/.def.json files in the workspace: structure, naming rules, type resolution, inheritance, ranges, patterns.
When the definitions are valid, the .default.def.json(5)/.preconfig.def.json(5) files are validated as a second stage.
Configuration .cfg.json(5) files in the same tree are deliberately not part of def validate.
Errors and warnings are printed with file, line, and column, and the exit code reflects the result, which makes the command CI friendly.
Validate Configurations
cfu cfg validate .
Validates all configuration files in their CfgSpaces against their definitions, including the definition checks above, cross-file checks, and merged-model checks in mergeable modes. This is the command to run in the build of a product that consumes your definition.
Inspect the Workspace
cfu workspace list
Shows the discovered workspace roots, CfgSpaces, and the .cfg/.def/ .confu folder tree.
Use it whenever validation behaves unexpectedly: a file that does not appear here is not part of any validation, no matter how valid it is (see the
pitfalls chapter).
cfu tui # same workspace, interactive
cfu tui ../other-workspace
tui is the default command, so a bare cfu is cfu tui ..
It adds the configurations, the definitions, and all diagnostics as browsable tabs, see the CLI reference of the user manual.
Export the Merged Model
cfu cfg export-merged -o merged.json .
Writes the merged configuration of a CfgSpace as a single file: what the consuming software effectively sees after entity merging and priority resolution.
The extension of the -o output file selects the format, .json for strict JSON and .json5 for human-readable JSON5.
--with-origin adds _origin annotations that record the file and the position of every value, which is invaluable when debugging where a merged value came from.
--with-type, only together with --with-origin, adds a $type with the definition type path to every element below the definition roots.
Inspect the Merged Configuration
cfu cfg inspect .
cfu cfg inspect --origin --at /MyDef/Root/Part .
The same merged model as export-merged, rendered as a tree instead of a file: values inline, --origin appending the file:line each one won from, and every required property
that no file configures marked [Missing].
Reach for it while debugging a configuration, and for export-merged when a machine consumes the result.
Generate Schemas and Code
cfu def generate . -i MyDefinition --schema-output ./schemas \
--rust-code-output ./generated/rust --python-code-output ./generated/python
Generates JSON Schemas and language bindings; see Code Generation for the details.
Format
cfu format . # rewrite files in place
cfu format --check # CI mode: fail if anything is unformatted
Formats .cfg.json5, .def.json5, and .confu files with the canonical style used throughout this documentation.
Support Package
cfu support
Bundles the discovered workspace files and the local exec and crash logs into a cfu-supportPackage-<unixtime>.zip in the current directory, to attach to a bug report or feature
request.
Afterward the local logs are pruned to the most recent exec and crash log, so the next package is not dominated by already-reported logs.
Shell Completions
eval "$(cfu completions bash)" # in ~/.bashrc
cfu completions powershell | Out-String | Invoke-Expression # in your $PROFILE
Prints a completion script for bash, elvish, fish, powershell, or zsh.
It is a snapshot of the version that generated it, so evaluating it from the shell startup file, as above, keeps it in sync.
A file written once goes stale on the next upgrade.
Servers
cfu lsp starts the language server used by the IDE integrations, and cfu mcp starts (or installs with --install) the Model Context Protocol server that exposes discovery,
validation, navigation and formatting tools to AI assistants.
Definition developers rarely start either by hand, but both operate on the same workspace model as the commands above, so their diagnostics always agree.
cfu server starts an HTTP server that serves the definition and configuration models as JSON.
It defaults to port 8787 and falls back to a free port if that one is taken.
The language server hosts the same endpoints too, reusing its live model without a second parse.