Validate, scaffold, format, and preview IOModel projects from the terminal.
The iomodel CLI is the command-line entry point for working with a Git-project. It validates the model, scaffolds objects and docs, normalizes YAML, and previews the project locally.
Install
Use it without installing, or install globally:
# one-off
npx @iomodel/cli validate
# global
npm i -g @iomodel/cliCommon commands
| Command | Purpose |
|---|---|
iomodel validate [scope] | Validate the model (whole project or a scope) |
iomodel lint | Style checks (naming, orphans, missing descriptions) |
iomodel new object <id> | Scaffold an object |
iomodel new doc <slug> | Scaffold a spec page |
iomodel format | Normalize model YAML |
iomodel preview | Serve a local preview of the project |
iomodel watch | Re-validate on file changes |
iomodel init [path] | Bootstrap IOModel in a folder |
Validate
iomodel validate # whole project
iomodel validate apps.api # a single object scope
iomodel validate --json # machine-readable output
iomodel validate --watch # re-run on changes| Exit code | Meaning |
|---|---|
0 | No errors (warnings allowed) |
1 | Validation errors |
2 | Fatal error (broken YAML, no project) |
JSON for tools and AI
--json emits structured diagnostics (code, file, line, fix suggestions) —
the same shape the editor and AI use. Ideal for scripts and CI.
Scaffold
iomodel new object collections.apps.payments \
--type container --container-type app --title "Payments Service"
iomodel new doc architecture/overview \
--group architecture --title "Architecture Overview"Format and preview
iomodel format # normalize YAML
iomodel format --check # fail if formatting is needed (CI)Run iomodel validate before committing, or use iomodel watch while editing
so problems surface immediately. See CI Validation to enforce
it in pull requests.
Last updated on