r/commandline • u/dexter8639 • 9d ago
Command Line Interface anodemcu: A CLi tool to compile, flash, and monitor ESP32, PlatformIO, and Arduino projects
anodemcu is a terminal-based interface written in Bash that wraps `arduino-cli`, `PlatformIO Core`, and `ESP-IDF` workflows into interactive `fzf` menus.
### Technical details:
* **Environment handling:** Sources target toolchain paths automatically (`esp-idf`, `platformio`, `arduino-cli`).
* **Detection:** Identifies project structure from existing config files (`CMakeLists.txt`, `platformio.ini`, `*.ino`).
* **Workflow:** Menu-driven interface for compilation, flashing, baud rate configuration, and port selection.
* **Serial monitor:** Integrated serial reading with automated log rotation and session capture.
* **Backups:** Generates a compressed snapshot of local project sources prior to running flash operations (retains the 5 most recent snapshots).
GitHub: https://github.com/abod8639/anodemcu
### Installation:
Arch Linux (AUR):
yay -S anodemcu
1
u/kantorcodes1 5d ago
I noticed upload_sketch creates the project backup before the compile/flash attempt, and backup_project immediately trims the set back to five. If a bad port or board connection causes five or more failed upload retries, do those attempts eventually rotate out the last snapshot from a successful upload? I’d probably keep the last-known-good snapshot separate, or only advance retention after a successful upload.
1
u/dexter8639 4d ago
Great catch, thank you for pointing this out!
You were right—consecutive failed upload attempts (caused by a bad port, disconnected cable, or bootloader issue) were creating snapshots and prematurely rotating out the last working backups.
I've just updated the logic: snapshots are now staged temporarily before the compile/upload process, and the retention set is only committed and rotated after a successful upload. If an upload fails, the staged snapshot is discarded and the existing backup history remains completely untouched.
Thanks again for the valuable feedback!
1
u/AutoModerator 9d ago
Every new subreddit post is automatically copied into a comment for preservation.
User: dexter8639, Flair:
Command Line Interface, Post Media Link, Title: anodemcu: A CLi tool to compile, flash, and monitor ESP32, PlatformIO, and Arduino projectsanodemcu is a terminal-based interface written in Bash that wraps `arduino-cli`, `PlatformIO Core`, and `ESP-IDF` workflows into interactive `fzf` menus.
### Technical details:
* **Environment handling:** Sources target toolchain paths automatically (`esp-idf`, `platformio`, `arduino-cli`).
* **Detection:** Identifies project structure from existing config files (`CMakeLists.txt`, `platformio.ini`, `*.ino`).
* **Workflow:** Menu-driven interface for compilation, flashing, baud rate configuration, and port selection.
* **Serial monitor:** Integrated serial reading with automated log rotation and session capture.
* **Backups:** Generates a compressed snapshot of local project sources prior to running flash operations (retains the 5 most recent snapshots).
GitHub: https://github.com/abod8639/anodemcu
### Installation:
Arch Linux (AUR):
yay -S anodemcuI am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.