|
8 | 8 | </p> |
9 | 9 |
|
10 | 10 | <p align="center"> |
11 | | - <a href="https://github.com/raylanlin/smarttune-cli/releases"><img src="https://img.shields.io/badge/version-2.3.1-blue?logo=github" alt="v2.3.1" /></a> |
| 11 | + <a href="https://github.com/raylanlin/smarttune-cli/releases"><img src="https://img.shields.io/badge/version-3.0.0-blue?logo=github" alt="v3.0.0" /></a> |
12 | 12 | <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/license-MIT-green" alt="License" /></a> |
13 | 13 | <a href="https://www.python.org"><img src="https://img.shields.io/badge/python-3.9%2B-3776AB?logo=python" alt="Python 3.9+" /></a> |
14 | | - <a href="https://github.com/raylanlin/smarttune-cli/actions"><img src="https://img.shields.io/badge/tests-96%20passed-brightgreen" alt="Tests" /></a> |
| 14 | + <a href="https://github.com/raylanlin/smarttune-cli/actions"><img src="https://img.shields.io/badge/tests-141%20passed-brightgreen" alt="Tests" /></a> |
15 | 15 | </p> |
16 | 16 |
|
17 | 17 | <p align="center"> |
|
25 | 25 |
|
26 | 26 | --- |
27 | 27 |
|
28 | | -> **Pip-install SmartTune, point it at a flight log, and your agent comes back with exact parameter deltas — not vague "try lowering P."** |
29 | | -> Every output is structured JSON or Markdown. No TUI, no blocking prompts, no ANSI escape codes to strip. The CLI was designed from day one to be invoked by an LLM agent as a subprocess tool — OpenClaw, Hermes, QwenPaw, Codex, Claude Code. Any agent that can shell out to `subprocess.run()` can use it. |
| 28 | +> **Pip-install SmartTune, point it at a flight log, and your agent comes back with exact parameter deltas — validated against real firmware parameter tables.** |
| 29 | +> No more guessing: `stune params --validate` checks every recommendation before it reaches the user. |
30 | 30 | > |
31 | 31 | > Under the hood: ArduPilot step-response analysis replicates WebTools PIDReview.js via Wiener deconvolution. Betaflight blackbox logs are parsed by a 1000+ line pure-Python decoder (no C extensions, no Node.js). All three platforms output to one `FlightData` dataclass so analyzers work identically across APM/BF/PX4. The 6-layer knowledge base is plain JSON — agents can read rules and propose new ones by editing `~/.smarttune/knowledge/`. |
32 | 32 |
|
@@ -103,16 +103,31 @@ smarttune-mcp # stdio transport (for agent frameworks) |
103 | 103 | python -m smarttune.mcp_server |
104 | 104 | ``` |
105 | 105 |
|
106 | | -**Available MCP tools:** |
| 106 | +**Available MCP tools (13 total):** |
107 | 107 |
|
108 | 108 | | Tool | Purpose | |
109 | 109 | |------|---------| |
110 | 110 | | `smarttune_list_platforms` | List supported platforms, extensions, and capabilities | |
111 | | -| `smarttune_log_quality` | Parse a log and return quality score, data availability, validation issues | |
112 | | -| `smarttune_analyze_log` | Run full analysis (PID + FFT + MagFit + hardware) and return structured JSON or Markdown | |
| 111 | +| `smarttune_log_quality` | Parse log and return quality score, data availability, validation issues | |
| 112 | +| `smarttune_analyze_log` | Full analysis (PID + FFT + Filter + Mag + SysID + Hardware) as JSON/Markdown | |
| 113 | +| `smarttune_analyze_pid` | PID step response analysis per axis | |
| 114 | +| `smarttune_analyze_fft` | FFT vibration spectrum with peak detection | |
| 115 | +| `smarttune_analyze_magfit` | Magnetometer calibration analysis | |
| 116 | +| `smarttune_analyze_sysid` | ARX system identification (natural freq, damping ratio) | |
| 117 | +| `smarttune_analyze_filter` | Filter transfer function analysis (Bode plot data) | |
| 118 | +| `smarttune_analyze_hardware` | Hardware configuration report | |
| 119 | +| `smarttune_generate_plot` | Generate analysis chart as base64 PNG | |
| 120 | +| `smarttune_list_params` | **NEW v3.0** — List firmware parameters for a platform | |
| 121 | +| `smarttune_search_params` | **NEW v3.0** — Search parameters by keyword across platforms | |
| 122 | +| `smarttune_validate_param` | **NEW v3.0** — ⚠️ Validate param exists + value in range before recommending | |
113 | 123 |
|
114 | 124 | All tools are annotated `readOnlyHint=True`, `destructiveHint=False`, `idempotentHint=True`. |
115 | 125 |
|
| 126 | +**⚠️ Parameter validation is mandatory.** Before recommending ANY parameter change, call `smarttune_validate_param(param_name, value, platform)`. This prevents agents from suggesting parameters that don't exist in the target firmware — a critical issue because: |
| 127 | +- Betaflight 4.5+ renamed many parameters (`d_min_roll` → `d_max_roll`, `gyro_lowpass_hz` → `gyro_lpf1_static_hz`) |
| 128 | +- Parameter names differ between firmware versions |
| 129 | +- Some parameters have strict value ranges that must be respected |
| 130 | + |
116 | 131 | **Security boundary:** |
117 | 132 |
|
118 | 133 | - No shell execution — library calls only |
@@ -297,6 +312,30 @@ List all available platform adapters and their capabilities. |
297 | 312 | stune platforms |
298 | 313 | ``` |
299 | 314 |
|
| 315 | +### `stune params` 🆕 v3.0 |
| 316 | + |
| 317 | +Query and validate firmware parameter tables. Data scraped from official firmware source code. |
| 318 | + |
| 319 | +```bash |
| 320 | +# List all parameters for a platform |
| 321 | +stune params ap # ArduPilot (2,574 params) |
| 322 | +stune params bf # Betaflight (45 params, BF 4.5+ names) |
| 323 | +stune params px4 # PX4 (20 params) |
| 324 | + |
| 325 | +# Show parameter details |
| 326 | +stune params ATC_RAT_RLL_P # Auto-detects platform |
| 327 | + |
| 328 | +# ⚠️ Validate before recommending (exit 0 = valid, 1 = invalid) |
| 329 | +stune params --validate ATC_RAT_RLL_P 0.15 -p ardupilot |
| 330 | +stune params --validate p_roll 999 -p betaflight # fails: exceeds max |
| 331 | + |
| 332 | +# Search and filter |
| 333 | +stune params --search notch # Cross-platform search |
| 334 | +stune params --category pid -p betaflight |
| 335 | +``` |
| 336 | + |
| 337 | +**Architecture**: Parameters stored in `smarttune/knowledge/params/<platform>.json`. Update JSON to refresh — no code changes needed. See [Knowledge Base](#knowledge-base). |
| 338 | + |
300 | 339 | --- |
301 | 340 |
|
302 | 341 | ## Supported Platforms |
@@ -575,10 +614,11 @@ stune analyze -i flight.bin |
575 | 614 | | v1.x | ArduPilot full support | ✅ | |
576 | 615 | | v2.0 Phase 1 | Multi-platform architecture | ✅ | |
577 | 616 | | v2.0 Phase 2 | Betaflight BBL parser + analytics | ✅ | |
578 | | -| **v2.1** | Platform-specific analyzers + Protocol constraints | ✅ | |
579 | | -| **v2.2** | Full English docs, CLI --help, OpenClaw SKILL.md | ✅ | |
580 | | -| v2.x | PX4 ULog adapter | 🔲 | |
581 | | -| v3.0 | Tool-calling manifest, plugin system, web UI | 🔲 | |
| 617 | +| v2.1 | Platform-specific analyzers + Protocol constraints | ✅ | |
| 618 | +| v2.2 | Full English docs, CLI --help, OpenClaw SKILL.md | ✅ | |
| 619 | +| v2.4 | Technical debt cleanup + HTML report parity | ✅ | |
| 620 | +| **v3.0** | **Firmware parameter tables + MCP validation tools + knowledge base** | ✅ | |
| 621 | +| v3.x | PX4 ULog adapter, tool-calling manifest, web UI | 🔲 | |
582 | 622 |
|
583 | 623 | --- |
584 | 624 |
|
|
0 commit comments