Imported from robotics-4-all/demol (
demol/cli/AGENTS.md). Install upstream withnpx skills add robotics-4-all/demol --skill cli. Copyright stays with the author.
demol/cli/ — Click CLI
OVERVIEW
Click-based CLI providing the demol command with subcommands for validation, code generation, power analysis, auto-fix, and model diff.
FILES
| File | Role |
|---|---|
cli.py |
Main Click group + all command and subcommand definitions (611 lines) |
autofix.py |
Auto-fix engine: detects and corrects common validation errors |
modeldiff.py |
Semantic diff engine: compares two .dev models structurally and semantically |
Entry point declared in pyproject.toml: demol = "demol.cli.cli:main".
COMMANDS REFERENCE
| Command | Description |
|---|---|
demol validate <file> |
Parse + semantic validation with rich error display |
demol validate <file> --skip-semantics |
Syntax-only validation |
demol generate rpi <file> --output-dir <dir> |
Raspberry Pi Python code + deployment artifacts |
demol generate riot <file> --output-dir <dir> |
RiotOS C code + Makefile |
demol generate svg <file> --output-dir <dir> |
SVG wiring diagram |
demol generate docs <file> --output-dir <dir> |
Markdown hardware construction guide |
demol generate pinmap <file> --output-dir <dir> |
Pin-mapping report (MD + JSON) |
demol generate json <file> --output-dir <dir> |
JSON serialization of model |
demol generate smauto <file> --output-dir <dir> |
SmartAuto automation model |
demol analyze power <file> |
Power budget & battery runtime report |
demol analyze power <file> --json-output |
Power analysis as JSON |
demol fix <file> |
Auto-fix common validation errors in-place |
demol fix <file> --dry-run |
Preview fixes without modifying the file |
demol diff <a.dev> <b.dev> |
Semantic diff between two .dev models |
demol diff <a.dev> <b.dev> --json-output |
Diff output as JSON |
CONVENTIONS
- CLI uses
ValidationReporterfromdemol/lang/validation.pyfor all error output — no direct printing autofix.pyandmodeldiff.pyare imported bycli.py, not used standalone--skip-semanticsis the only supported bypass — never suppress errors silently
ANTI-PATTERNS
- Do NOT add validation logic directly in
cli.py— delegate todemol/lang/modules - Do NOT print validation output directly — use
ValidationReporter autofix.pymust use--dry-runas the safe default path for testing