Templates are now composed declaratively via template.toml -- no Rust code
changes needed to add new templates. The weather station is the first
composed template, demonstrating the full pattern.
Template engine:
- Composed templates declare base, required libraries, and per-board pins
- Overlay mechanism replaces base files (app, sketch, tests) cleanly
- Generic orchestration: extract base, apply overlay, install libs, assign pins
- Template name tracked in .anvil.toml for refresh awareness
Weather template (--template weather):
- WeatherApp with 2-second polling, C/F conversion, serial output
- TMP36 driver: TempSensor interface, Tmp36 impl, Tmp36Mock, Tmp36Sim
- Managed example tests in test_weather.cpp (unit + system)
- Minimal student starters in test_unit.cpp and test_system.cpp
- Per-board pin defaults (A0 for uno, A0 for mega, A0 for nano)
.anvilignore system:
- Glob pattern matching (*, ?) with comments and backslash normalization
- Default patterns protect student tests, app code, sketch, config
- anvil refresh --force respects .anvilignore
- anvil refresh --force --file <path> overrides ignore for one file
- anvil refresh --ignore/--unignore manages patterns from CLI
- Missing managed files always recreated even without --force
- .anvilignore itself is in NEVER_REFRESH (cannot be overwritten)
Refresh rewrite:
- Discovers all template-produced files dynamically (no hardcoded list)
- Extracts fresh template + libraries into temp dir for byte comparison
- Config template field drives which files are managed
- Separated missing-file creation from changed-file updates
428 tests passing on Windows MSVC, 0 warnings.
Board presets:
- anvil new --board mega (uno, mega, nano, nano-old, leonardo, micro)
- anvil new --list-boards shows presets with compatible clones
- FQBN and baud rate flow into .anvil.toml via template variables
- Defaults to uno when --board is omitted
Devices --clear:
- anvil devices --clear deletes .anvil.local, reverts to auto-detect
- Remove build/upload/monitor subcommands (projects are self-contained)
- Remove ctrlc dependency (only used by removed monitor watch mode)
- Update next-steps messaging to reference project scripts directly
- Add 'anvil refresh [DIR] [--force]' to update project scripts
to latest templates without touching user code
- Fix Windows port detection: replace fragile findstr/batch TOML
parsing with proper comment-skipping logic; add _detect_port.ps1
helper for reliable JSON-based port detection via PowerShell
- Add .anvil.local for machine-specific config (gitignored)
- 'anvil devices --set [PORT] [-d DIR]' saves port + VID:PID
- 'anvil devices --get [-d DIR]' shows saved port status
- VID:PID tracks USB devices across COM port reassignment
- Port resolution: -p flag > VID:PID > saved port > auto-detect
- Uppercase normalization for Windows COM port names
- Update all .bat/.sh templates to read from .anvil.local
- Remove port entries from .anvil.toml (no machine-specific config in git)
- Add .anvil.local to .gitignore template
- Expand 'anvil devices' output with VID:PID, serial number, and
usage instructions
Single-binary CLI that scaffolds testable Arduino projects, compiles,
uploads, and monitors serial output. Templates embed a hardware
abstraction layer, Google Mock infrastructure, and CMake-based host
tests so application logic can be verified without hardware.
Commands: new, doctor, setup, devices, build, upload, monitor
39 Rust tests (21 unit, 18 integration)
Cross-platform: Linux and Windows