agents/docs/commands-reference.md
Detailed reference for all build, test, and development commands. For quick reference, see the Key Commands section in CLAUDE.md.
Run tests inside a Docker container for consistent Linux environment with ASAN/LSAN sanitizers:
# Run all C++ tests in Docker (implies --debug with sanitizers)
bash test --docker
# Run specific unit test in Docker
bash test --docker tests/fl/async
# Run with quick mode (no sanitizers, faster)
bash test --docker --quick
# Run with release mode (optimized)
bash test --docker --build-mode release
# Run only unit tests
bash test --docker --unit
# Run only examples
bash test --docker --examples
Notes:
--docker implies --debug mode (ASAN/LSAN sanitizers enabled) unless --quick or --build-mode is specified.venv and .build to persist between runsAI AGENTS: Avoid bash test --docker unless necessary — Docker testing is slow (3-5 minutes per test). Use bash test for quick local testing. Only use Docker when:
The project uses fbuild as the build system for all board compiles. New board targets must take the fbuild path by default; do not add board allowlists or PlatformIO fallbacks for board compatibility issues. Fix those in fbuild instead.
File board build compatibility problems at https://github.com/FastLED/fbuild/issues.
fbuild provides:
Default behavior:
Usage via debug_attached.py:
# All board builds use fbuild
uv run ci/debug_attached.py esp32s3 --example Blink
# Compatibility flag only; fbuild is still used
uv run ci/debug_attached.py esp32s3 --use-fbuild --example Blink
Build caching: fbuild stores builds in .fbuild/build/<env>/ and caches toolchains in .fbuild/cache/.
When multiple tests match a query, use these methods:
Path-based queries:
bash test tests/fl/async — Run unit test by pathbash test examples/Blink — Run example by pathFlag-based filtering:
bash test async --cpp — Filter to unit tests onlybash test Async --examples — Filter to examples onlyFastLED supports fast host-based compilation of .ino examples using Meson build system:
Quick Mode (Default - Fast Iteration):
bash test --examples — Compile and run all examples (quick mode, 80 examples in ~0.24s)bash test --examples Blink DemoReel100 — Compile specific examplesbash test --examples --no-parallel — Sequential compilation (easier debugging)bash test --examples --verbose — Show detailed compilation outputbash test --examples --clean — Clean build cache and recompileDebug Mode (Full Symbols + Sanitizers):
bash test --examples --debug — Compile all examples with debug symbols and sanitizersbash test --examples Blink --debug — Compile specific example in debug modebash test --examples Blink --debug --full — Debug mode with executionRelease Mode (Optimized Production Builds):
bash test --examples --build-mode release — Compile all examples optimizedbash test --examples Blink --build-mode release — Compile specific example (release)Build Modes:
-O1 -g1 — Build dir: .build/meson-quick/examples/-O0 -g3 -fsanitize=address,undefined — Build dir: .build/meson-debug/examples/-O2 -DNDEBUG — Build dir: .build/meson-release/examples/All three modes use separate build directories (no cache conflicts, can coexist simultaneously).
Performance Notes:
Direct Invocation:
uv run python ci/util/meson_example_runner.py — Compile all examples directly (quick mode)uv run python ci/util/meson_example_runner.py Blink --full — Compile and execute specific exampleuv run python ci/util/meson_example_runner.py Blink --debug --full — Debug mode with executionbash run wasm <example> — Compile WASM example and serve with live-server:
bash run wasm AnimartrixRing # Compile and serve with live-server
bash run wasm Blink # Opens browser automatically
What it does:
bash compile wasm <example>examples/<example>/fastled_js/) with live-serverRequirements: Install live-server: npm install -g live-server
bash profile <function> — Generate profiler and run performance benchmarks:
# Profile a function (local build, 20 iterations)
bash profile sincos16
# Profile in Docker (consistent environment, recommended)
bash profile sincos16 --docker
# More iterations for better statistics
bash profile sincos16 --docker --iterations 50
# With callgrind analysis (slower, detailed hotspots)
bash profile sincos16 --docker --callgrind
What it does:
tests/profile/profile_<function>.cpp from templateprofile_<function>_results.ai.json for AI consumptionOptions:
--docker — Run in Docker (consistent Linux environment, recommended)--iterations N — Number of benchmark runs (default: 20)--build-mode MODE — Build mode: quick, debug, release, profile (default: release)--no-generate — Skip test generation (use existing profiler)--callgrind — Run valgrind callgrind analysis (requires valgrind)Output Files:
tests/profile/profile_<function>.cpp — Generated profiler source (template, needs customization)profile_<function>_results.json — Raw benchmark data (all iterations)profile_<function>_results.ai.json — Statistical summary for AI analysisIMPORTANT: Generated profilers are TEMPLATES — The generated code is a starting point that MUST be customized. Add appropriate test inputs and ensure the benchmark calls the target function correctly.
When to use:
/git-historian keyword1 keyword2 — Search codebase and recent git history for keywords/git-historian "error handling" config — Search for multi-word phrases (use quotes)/git-historian memory leak --paths src tests — Limit search to specific directoriesAll forbidden commands can be bypassed using FL_AGENT_ALLOW_ALL_CMDS=1:
FL_AGENT_ALLOW_ALL_CMDS=1 clang++ test.cpp -o test.exe # Compiler feature testing
FL_AGENT_ALLOW_ALL_CMDS=1 ninja --version # Build system debugging
FL_AGENT_ALLOW_ALL_CMDS=1 meson introspect .build/meson-quick
When to use: Compiler feature testing, build system debugging, investigating specific build failures. NOT for regular development — always prefer bash wrapper scripts.
See ci/hooks/README.md for complete hook documentation.