ESP-IDF utility for generating VSCode tasks and LittleFS support
Project description
๐งฐ ESP-IDF LittleFS CLI Tool
This project provides a modern Python CLI tool to quickly configure LittleFS partitions in ESP-IDF projects, including:
- โ Automatic creation of partition data folders
- โ
Generation of
tasks.jsonfor Visual Studio Code - โ
Safe insertion of LittleFS support in
CMakeLists.txt - โ ๐ง Smart platform detection (Windows/Linux)
[!WARNING]
Requires Python 3.6+ and ESP-IDF installed in your system
๐ Project Structure
esp_littlefs_cli/
โโโ littlefscli/
โ โโโ enable_littlefs.py # Main CLI logic (with def main())
โ โโโ config.ini # Example config
โ โโโ templates/
โ โโโ tasks.base.template.json
โ โโโ task.partition.template.json
โโโ setup.py # Installation config
โโโ README.md # This file
โโโ MANIFEST.in # Includes templates in package
๐ Installation
๐ฆ Install globally with pip
git clone https://github.com/...
cd esp_littlefs_cli
pip install .
๐ก Or use pipx (recommended)
git clone https://github.com/...
cd esp_littlefs_cli
pipx install /.
โ๏ธ Configuration (config.ini)
Create or edit a config file like this:
[LittleFS]
platform = windows
export_script = C:\Users\YOUR_USER\Espressif\v5.4\esp-idf\export.ps1
[LittleFS_interna]
partition_label = littlefs_chip
partition_dir = littlefs_data
tag = INTERNOS (chip)
[LittleFS_externa]
partition_label = littlefs_user
partition_dir = littlefs_user
tag = EXTERNOS (user)
Parameters
| Key | Description |
|---|---|
platform |
windows or linux (affects VSCode task port) |
export_script |
Absolute path to the ESP-IDF export script |
partition_label |
Name of the partition (e.g., littlefs) |
partition_dir |
Folder with files to flash |
tag |
Friendly name for VSCode task label |
[!IMPORTANT]
export_scriptshould point to the ESP-IDF export script, usually located in the installation path (export.ps1orexport.sh).
partition_labelandpartition_dirmust match yourpartitions.csventries and your code's mount points.
[!CAUTION] Before it, don't forget execute
install.ps1orinstall.shfrom your terminal
๐งช Usage
Once installed, simply run:
enable-littlefs /path/to/your/project [.vscode/partition.ini]
[!NOTE]
.vscode/partition.iniis optional. If not provided, the tool will useconfig.inifrom the CLI script's directory.
What it does:
-
๐ Creates missing littlefs_* directories
-
๐ง Generates .vscode/tasks.json with correct build targets
-
๐ Patches CMakeLists.txt only if needed (non-invasive)
๐ป Platform Support
โ
Native Linux
โ
Windows
โ
macOS
โป๏ธ Idempotency
The CLI safely detects existing configurations:
-
Skips tasks.json if already configured
-
Avoids duplicate entries in CMakeLists.txt
-
Can be re-run without side effects
๐ง Real-world Example
Letโs say you want to set this up in an existing ESP-IDF project:
cd ~/esp/myproject
enable-littlefs . .vscode/partition.ini
โ๏ธ Expected output
Even enable-littlefs project/path or enable-littlefs project/path config/path
Case with archives folders already created
๐ Project directory: /.../
๐ Config file: /.../xxxx.ini
๐ง Platform: /.../
๐ป Shell: /.../
๐ Export script: /.../
๐งฉ Checking LittleFS partitions...
๐ฆ Directory already exists: littlefs_data
๐ฆ Directory already exists: littlefs_user
โ
All partitions processed.
๐งพ tasks.json written to: /.../
โ
CMakeLists.txt already contains LittleFS logic.
๐ All done. You're ready to roll ๐
๐ License
This project is licensed under the MIT License.
๐ Contributing
Contributions are welcome! Feel free to open issues or pull requests for bugs, features, or improvements. Just make sure you follow standard Python formatting and write clear commit messages.
๐ง Author
Created by PoleG97
Maintained as a CLI tool with โค๏ธ and Python power.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file enable-littlefs-1.0.2.tar.gz.
File metadata
- Download URL: enable-littlefs-1.0.2.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5702ada2c9f8865a077c728d5d1c2bc654ff1844c492226bb167123f3d113e3
|
|
| MD5 |
1d4c1c90c2b6a05ee8ea084cea28bad8
|
|
| BLAKE2b-256 |
6aa9aaea6566ff17299527fd2c410fbcc191f564495bccebeacde06b7010295a
|
File details
Details for the file enable_littlefs-1.0.2-py3-none-any.whl.
File metadata
- Download URL: enable_littlefs-1.0.2-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
796ab53130bfdc738162f4d85fa5eb44597d34cd38c5f50313a21b14f08fa434
|
|
| MD5 |
cc4124ce40b04df50dd6e5f924988207
|
|
| BLAKE2b-256 |
fb1cadbccbe181c1fe1965433579d3c230ddb5aff773d9243a755b362efe735a
|