中文 | English
Arduino Lightning Compilation Tool
Compilation speed far exceeds Arduino CLI, superior to PlatformIO
Make Arduino Great Again!
If this tool helps you, please give it a ⭐️ for support!
- Ultra-Fast Analysis: Uses Tree-sitter syntax parsing for precise dependency detection
- Build System: Uses Ninja build system with parallel compilation to maximize CPU utilization
- Smart Caching: Avoids redundant compilation, significantly reducing build time
- Incremental Builds: Only compiles modified files
npm install -g aily-builder
aily-builder --helpFor local development:
git clone https://github.com/ailyProject/aily-builder
cd aily-builder
npm install
npm link
aily-builder --help# Compile Arduino project
aily-builder compile sketch.ino
# Specify board
aily-builder compile sketch.ino --board arduino:avr:uno
# Parallel compilation (8 tasks)
aily-builder compile sketch.ino --jobs 8
# With external libraries
aily-builder compile sketch.ino --libraries-path "C:\Arduino\libraries"
# Enable verbose output
aily-builder compile sketch.ino --verboseThe tool supports separating preprocessing from compilation, which is useful for:
- CI/CD pipelines: Run preprocessing once, compile multiple times
- Parallel builds: Share preprocessing results across build workers
- Debugging: Inspect preprocessing results before compilation
- Performance optimization: Skip preprocessing when dependencies haven't changed
Perform preprocessing without compilation (dependency analysis, config generation, prebuild hooks):
# Basic preprocessing
aily-builder preprocess sketch.ino --board arduino:avr:uno
# With external libraries
aily-builder preprocess sketch.ino --board esp32:esp32:esp32 --libraries-path "C:\Arduino\libraries"
# Output as JSON for programmatic use
aily-builder preprocess sketch.ino --output-json
# Save result for later compilation (useful for CI/CD)
aily-builder preprocess sketch.ino --save-result ./preprocess.jsonUse saved preprocessing results to skip the preprocessing phase:
# Compile using saved preprocess result (skips preprocessing)
aily-builder compile sketch.ino --preprocess-result ./preprocess.json
# Full workflow example
aily-builder preprocess sketch.ino --board arduino:avr:uno --save-result ./preprocess.json
aily-builder compile sketch.ino --board arduino:avr:uno --preprocess-result ./preprocess.jsonPreprocessing Steps:
- Validate sketch file
- Extract macros from sketch
- Parse board and platform configuration
- Prepare build directory
- Analyze dependencies
- Generate compile configuration
- Run prebuild hooks (if configured)
Multi-mode syntax analysis with fast static check or accurate compiler-based validation:
# Fast mode - Quick syntax check (~3-5ms, default)
aily-builder lint sketch.ino --board arduino:avr:uno
# Accurate mode - Compiler-based analysis (~3-5s, high precision)
aily-builder lint sketch.ino --mode accurate
# Auto mode - Fast first, then accurate if issues found
aily-builder lint sketch.ino --mode auto
# Different output formats (human, vscode, json)
aily-builder lint sketch.ino --format json# Upload firmware to Arduino board
aily-builder upload -p COM3 -f firmware.hex --board arduino:avr:uno
# With verbose output
aily-builder upload -p /dev/ttyUSB0 -f firmware.bin --board esp32:esp32:esp32 --verbose# View cache statistics
aily-builder cache-stats
# Clean cache older than 30 days
aily-builder cache-clean --days 30
# Preview what would be deleted (dry run)
aily-builder cache-clean --days 7 --dry-run
# Clear all cache
aily-builder cache clear --all
# Compile without cache
aily-builder compile sketch.ino --no-cacheArguments:
sketch Path to Arduino sketch (.ino file)
Options:
-b, --board <board> Target board (default: "arduino:avr:uno")
-p, --port <port> Serial port for upload
--sdk-path <path> Path to Arduino SDK
--tools-path <path> Path to additional tools
--build-path <path> Build output directory
--libraries-path <path> Additional libraries path (can be used multiple times)
--build-property <key=value> Additional build property (can be used multiple times)
--build-macros <macro[=value]> Custom macro definitions (e.g., DEBUG, VERSION=1.0.0)
--board-options <key=value> Board menu options (e.g., flash=2097152_0)
--tool-versions <versions> Specify tool versions (format: tool1@version1,tool2@version2)
--preprocess-result <path> Use preprocess result JSON file (skip preprocessing)
-j, --jobs <number> Number of parallel compilation jobs (default: "4")
--verbose Enable verbose output
--no-cache Disable compilation cache
--clean-cache Clean cache before compilation
--log-file Write logs to file in build directory
-h, --help Display help for commandArguments:
sketch Path to Arduino sketch (.ino file)
Options:
-b, --board <board> Target board (default: "arduino:avr:uno")
--sdk-path <path> Path to Arduino SDK
--tools-path <path> Path to additional tools
--build-path <path> Build output directory
--libraries-path <path> Additional libraries path (can be used multiple times)
--build-property <key=value> Additional build property
--build-macros <macro[=value]> Custom macro definitions
--board-options <key=value> Board menu options
--tool-versions <versions> Specify tool versions
--output-json Output preprocess result as JSON
--save-result <path> Save full preprocess result to JSON file
--verbose Enable verbose output
--log-file Write logs to file in build directory
-h, --help Display help for commandArguments:
sketch Path to Arduino sketch (.ino file)
Options:
-b, --board <board> Target board (default: "arduino:avr:uno")
--build-path <path> Build output directory
--sdk-path <path> Path to Arduino SDK
--tools-path <path> Path to additional tools
--libraries-path <path> Additional libraries path (can be used multiple times)
--build-property <key=value> Additional build property
--build-macros <macro[=value]> Custom macro definitions
--board-options <key=value> Board menu options
--tool-versions <versions> Specify tool versions
--format <format> Output format: human, vscode, json (default: "human")
--mode <mode> Analysis mode: fast, accurate, auto (default: "fast")
--verbose Enable verbose output
-h, --help Display help for commandOptions:
-b, --board <board> Target board (default: "arduino:avr:uno")
-p, --port <port> Serial port for upload (required)
-f, --file <file> Firmware file path (.hex or .bin) (required)
--build-property <key=value> Additional build property
--verbose Enable verbose output
--log-file Write logs to file
-h, --help Display help for command# Cache statistics
aily-builder cache-stats [--verbose]
# Cache cleanup
aily-builder cache-clean [options]
--days <number> Clean files older than N days (default: 30)
--pattern <pattern> File name pattern matching
--dry-run Preview mode, don't actually delete
# Clear all cache
aily-builder cache clear --allBuild output is stored by default in:
- Windows:
%LOCALAPPDATA%\aily-builder\project\<sketchname>_<hash> - macOS:
~/Library/aily-builder/project/<sketchname>_<hash>
Issues and Pull Requests are welcome!
GNU GENERAL PUBLIC LICENSE V3
- Ninja Build System - High-performance build system
- Tree-sitter - Syntax parser
- Arduino CLI - Arduino development tools