Skip to content

Commit a460ac6

Browse files
committed
feat(v1.8): Scripting & Automation
- Add scripting module with Python API types and batch processing - Add CLI tool (openflash-cli) with clap-based interface - Add Python bindings (pyopenflash) via PyO3 - Add batch processing with job dependencies - Add plugin system with hooks (PreRead, PostRead, Analysis, etc.) - Add CI/CD integration types - Add 12 new protocol commands (0xB0-0xBB) - Add is_scripting() method to Command enum - Update core library to v1.8.0 - Add 20+ unit tests for scripting module - Update ROADMAP.md with v1.8 completion - Update CHANGELOG.md with v1.8 release notes - Update Getting-Started wiki with CLI and Python examples
1 parent b399c9f commit a460ac6

12 files changed

Lines changed: 2974 additions & 24 deletions

File tree

openflash/CHANGELOG.md

Lines changed: 96 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,98 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [1.8.0] - 2026-Q2
11+
12+
### Added
13+
- **Scripting & Automation**
14+
- New `scripting` module in core library for automation support
15+
- **Python API (pyopenflash)**: Full Python bindings via PyO3
16+
- `openflash.connect()` - Connect to device
17+
- `device.detect()` - Detect chip
18+
- `device.read_full()` / `device.read()` - Read operations
19+
- `device.write()` - Write operations
20+
- `openflash.ai.analyze()` - AI analysis
21+
- `analysis.export_report()` - Export reports
22+
- `openflash.Batch` - Batch processing
23+
- `openflash.load_dump()` / `openflash.compare_dumps()` - Utilities
24+
25+
- **CLI Tool (openflash)**: Full-featured command-line interface
26+
- `openflash scan` - Scan for devices
27+
- `openflash detect` - Detect chip
28+
- `openflash read -o dump.bin` - Read chip
29+
- `openflash write -i firmware.bin` - Write chip
30+
- `openflash erase` - Erase chip
31+
- `openflash verify -f file.bin` - Verify contents
32+
- `openflash analyze dump.bin` - AI analysis
33+
- `openflash compare file1.bin file2.bin` - Compare dumps
34+
- `openflash clone` - Chip-to-chip clone
35+
- `openflash batch jobs.toml` - Batch processing
36+
- `openflash script script.py` - Run scripts
37+
- `openflash chips` - List supported chips
38+
- JSON/CSV/Table output formats
39+
- Progress bars and colored output
40+
41+
- **Batch Processing**: Job queue with dependencies
42+
- `BatchProcessor` - Job queue manager
43+
- `BatchJob` - Job definition with dependencies
44+
- Read, Write, Erase, Verify, Analyze, Clone, Report job types
45+
- Stop-on-error and parallel execution modes
46+
47+
- **Plugin System**: Extensible analysis plugins
48+
- `PluginManager` - Plugin lifecycle management
49+
- `PluginMetadata` - Plugin information
50+
- `PluginHook` - Pre/Post read/write, Analysis, Pattern/FS detection
51+
- `PluginContext` / `PluginResult` - Plugin I/O
52+
53+
- **CI/CD Integration**: Types for automation pipelines
54+
- `CiJobConfig` - CI job configuration
55+
- `CiOperation` - Verify, Read, Write, Analyze, Compare operations
56+
- `CiArtifact` - Output artifacts (dumps, reports, logs)
57+
- `CiJobResult` / `CiOperationResult` - Execution results
58+
59+
- **New Protocol Commands (0xB0-0xBB)**
60+
- `BatchStart` (0xB0) - Start batch operation
61+
- `BatchStatus` (0xB1) - Get batch status
62+
- `BatchAbort` (0xB2) - Abort batch
63+
- `ScriptLoad` (0xB3) - Load script to device
64+
- `ScriptRun` (0xB4) - Run loaded script
65+
- `ScriptStatus` (0xB5) - Get script status
66+
- `PluginList` (0xB6) - List plugins
67+
- `PluginLoad` (0xB7) - Load plugin
68+
- `PluginUnload` (0xB8) - Unload plugin
69+
- `RemoteConnect` (0xB9) - Remote connection
70+
- `RemoteDisconnect` (0xBA) - Disconnect remote
71+
- `GetDeviceInfo` (0xBB) - Get device info
72+
73+
- **New Types and Structures**
74+
- `ScriptError`, `ScriptResult` - Error handling
75+
- `ConnectionConfig`, `DeviceInfo`, `DeviceHandle` - Device connection
76+
- `ReadOptions`, `WriteOptions`, `DumpResult`, `ReadStats` - I/O options
77+
- `ChipDetectionResult` - Chip detection
78+
- `AnalysisOptions`, `ScriptAnalysisResult` - Analysis configuration
79+
- `PatternInfo`, `FilesystemInfo`, `AnomalyInfo`, `KeyCandidate` - Analysis results
80+
- `ReportFormat`, `ReportOptions` - Report export
81+
- `CliCommand`, `CliConfig`, `CliOutputFormat` - CLI types
82+
- `OpenFlash` - High-level API class
83+
84+
### Changed
85+
- Protocol version updated to 0x18
86+
- Core library version updated to 1.8.0
87+
- CLI version: 1.8.0
88+
- pyopenflash version: 1.8.0
89+
- Added `is_scripting()` method to Command enum
90+
- Extended lib.rs exports with scripting types
91+
- Added serde_json dependency to core
92+
93+
### Tests
94+
- 20+ new unit tests for scripting module
95+
- Connection and device handle tests
96+
- Batch processor tests
97+
- Plugin manager tests
98+
- Read/Write/Analysis options tests
99+
- CLI config tests
100+
- CI job config tests
101+
10102
## [1.7.0] - 2026-Q2
11103

12104
### Added
@@ -350,6 +442,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
350442

351443
## Version History
352444

445+
- **1.8.0** - Scripting & Automation: Python API, CLI tool, batch processing, plugins, CI/CD
353446
- **1.7.0** - Advanced write operations, bad block management, wear leveling, incremental backup, cloning
354447
- **1.6.0** - SPI NOR flash, UFS, ONFI 5.0, 16-bit NAND support
355448
- **1.5.0** - ESP32 support, STM32F4 support, WiFi connectivity
@@ -361,7 +454,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
361454
- **1.0.0** - Initial public release
362455
- **0.x.x** - Development versions (not released)
363456

364-
[Unreleased]: https://github.com/openflash/openflash/compare/v1.6.0...HEAD
457+
[Unreleased]: https://github.com/openflash/openflash/compare/v1.8.0...HEAD
458+
[1.8.0]: https://github.com/openflash/openflash/compare/v1.7.0...v1.8.0
459+
[1.7.0]: https://github.com/openflash/openflash/compare/v1.6.0...v1.7.0
365460
[1.6.0]: https://github.com/openflash/openflash/compare/v1.5.0...v1.6.0
366461
[1.5.0]: https://github.com/openflash/openflash/compare/v1.4.0...v1.5.0
367462
[1.4.0]: https://github.com/openflash/openflash/compare/v1.3.0...v1.4.0

openflash/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
[workspace]
22
members = [
33
"core",
4+
"cli",
5+
"pyopenflash",
46
"gui/src-tauri",
57
# Firmware requires specific embassy versions, build separately
68
# "firmware/rp2040",
@@ -11,4 +13,5 @@ resolver = "2"
1113
[workspace.dependencies]
1214
# Shared dependencies for the entire workspace
1315
serde = { version = "1.0", features = ["derive"] }
16+
serde_json = "1.0"
1417
tokio = { version = "1.0", features = ["full"] }

openflash/ROADMAP.md

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Детальный план развития проекта OpenFlash.
44

5-
## Текущий статус: v1.7.0
5+
## Текущий статус: v1.8.0
66

77
---
88

@@ -60,7 +60,7 @@
6060
- 10 property-based тестов
6161
- GUI: SPI NOR operations panel, UFS LUN selector
6262

63-
### v1.7 — Advanced Write Operations ← ТЕКУЩАЯ
63+
### v1.7 — Advanced Write Operations
6464
- Full chip programming с верификацией
6565
- Bad block management (автоматическое управление)
6666
- Wear leveling write (отслеживание износа)
@@ -69,24 +69,17 @@
6969
- 12 новых протокольных команд (0xA0-0xAB)
7070
- 15 unit тестов для write_ops модуля
7171

72-
---
73-
74-
## 🔜 Ближайшие планы
75-
76-
### v1.8 — Scripting & Automation
77-
**Цель:** Автоматизация и интеграция
78-
79-
| Фича | Приоритет | Сложность |
80-
|------|-----------|-----------|
81-
| Python API (pyopenflash) | 🔴 High | Medium |
82-
| CLI tool | 🔴 High | Low |
83-
| Batch processing | 🟡 Medium | Medium |
84-
| Custom analysis plugins | 🟡 Medium | High |
85-
| CI/CD integration | 🟢 Low | Low |
72+
### v1.8 — Scripting & Automation ← ТЕКУЩАЯ
73+
- **Python API (pyopenflash)** — полноценные Python bindings через PyO3
74+
- **CLI tool (openflash)** — командная строка с clap
75+
- **Batch processing** — очередь задач с зависимостями
76+
- **Custom analysis plugins** — система плагинов с хуками
77+
- **CI/CD integration** — типы для автоматизации
78+
- 12 новых протокольных команд (0xB0-0xBB)
79+
- 20+ unit тестов для scripting модуля
8680

87-
**Детали:**
81+
**Python API пример:**
8882
```python
89-
# Пример pyopenflash API
9083
import openflash
9184

9285
device = openflash.connect()
@@ -95,8 +88,20 @@ analysis = openflash.ai.analyze(dump)
9588
analysis.export_report("report.md")
9689
```
9790

91+
**CLI примеры:**
92+
```bash
93+
openflash scan # Поиск устройств
94+
openflash detect # Определение чипа
95+
openflash read -o dump.bin # Чтение дампа
96+
openflash write -i firmware.bin # Запись прошивки
97+
openflash analyze dump.bin # AI анализ
98+
openflash batch jobs.toml # Пакетная обработка
99+
```
100+
98101
---
99102

103+
## 🔜 Ближайшие планы
104+
100105
### v1.9 — Advanced AI Features
101106
**Цель:** ML и глубокий анализ
102107

@@ -223,10 +228,10 @@ analysis.export_report("report.md")
223228
| v1.5 | Q1 2026 | ✅ Released |
224229
| v1.6 | Q1 2026 | ✅ Released |
225230
| v1.7 | Q2 2026 | ✅ Released |
226-
| v1.8 | Q3 2026 | 📋 Planned |
227-
| v1.9 | Q4 2026 | 📋 Planned |
228-
| v2.0 | Q1 2027 | 📋 Planned |
229-
| v2.1 | Q2 2027 | 📋 Planned |
231+
| v1.8 | Q2 2026 | ✅ Released |
232+
| v1.9 | Q3 2026 | 📋 Planned |
233+
| v2.0 | Q4 2026 | 📋 Planned |
234+
| v2.1 | Q1 2027 | 📋 Planned |
230235
| v3.0 | 2028 | 🔮 Future |
231236

232237
---

openflash/cli/Cargo.toml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[package]
2+
name = "openflash-cli"
3+
version = "1.8.0"
4+
edition = "2021"
5+
description = "Command-line interface for OpenFlash NAND/eMMC programmer"
6+
license = "MIT"
7+
authors = ["OpenFlash Team"]
8+
repository = "https://github.com/openflash/openflash"
9+
keywords = ["nand", "flash", "programmer", "cli", "embedded"]
10+
categories = ["command-line-utilities", "embedded", "hardware-support"]
11+
12+
[[bin]]
13+
name = "openflash"
14+
path = "src/main.rs"
15+
16+
[dependencies]
17+
openflash-core = { path = "../core" }
18+
clap = { version = "4.4", features = ["derive", "env"] }
19+
serde = { version = "1.0", features = ["derive"] }
20+
serde_json = "1.0"
21+
tokio = { version = "1.0", features = ["full"] }
22+
indicatif = "0.17"
23+
console = "0.15"
24+
colored = "2.0"
25+
anyhow = "1.0"
26+
thiserror = "1.0"
27+
dirs = "5.0"
28+
toml = "0.8"
29+
30+
[dev-dependencies]
31+
assert_cmd = "2.0"
32+
predicates = "3.0"
33+
tempfile = "3.0"

0 commit comments

Comments
 (0)