Skip to content

Commit 8f50426

Browse files
authored
improved version management (#67)
* improved version management * Documentation updated
1 parent 5f7a5f8 commit 8f50426

File tree

104 files changed

+845
-11133
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+845
-11133
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ dist-ssr
1414

1515
# mdbook
1616
/docs/book
17+
/docs/theme
1718

1819
# Editor directories and files
1920
.vscode/*

docs/src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- [Configuration](./configuration.md)
1010
- [GUI Configuration](./gui_configuration.md)
1111
- [CLI Configuration](./cli_configuration.md)
12+
- [CLI Commands](./cli_commands.md)
1213
- [After Installing](./after_installing.md)
1314
- [Headless Usage](./headless_usage.md)
1415
- [FAQ](./faq.md)

docs/src/cli_commands.md

Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
# CLI Commands
2+
3+
The ESP-IDF Installation Manager provides a comprehensive command-line interface with various commands to manage your ESP-IDF installations. This document details all available commands and their usage.
4+
5+
## Available Commands
6+
7+
```bash
8+
eim [OPTIONS] [COMMAND]
9+
```
10+
11+
### Global Options
12+
13+
These options can be used with any command:
14+
15+
- `-l, --locale <LOCALE>`: Set the language for the wizard (en, cn)
16+
- `-v, --verbose`: Increase verbosity level (can be used multiple times)
17+
- `--log-file <LOG_FILE>`: File in which logs will be stored (default: eim.log)
18+
- `-h, --help`: Print help information
19+
- `-V, --version`: Print version information
20+
21+
### Commands Overview
22+
23+
| Command | Description |
24+
|---------|-------------|
25+
| `install` | Install ESP-IDF versions |
26+
| `wizard` | Run the ESP-IDF Installer Wizard (interactive mode) |
27+
| `list` | List installed ESP-IDF versions |
28+
| `select` | Select an ESP-IDF version as active |
29+
| `rename` | Rename a specific ESP-IDF version |
30+
| `remove` | Remove a specific ESP-IDF version |
31+
| `purge` | Purge all ESP-IDF installations |
32+
| `import` | Import existing ESP-IDF installation using tools_set_config.json |
33+
| `discover` | Discover available ESP-IDF versions (not implemented yet) |
34+
35+
## Command Details
36+
37+
### Install Command
38+
39+
Non-interactive installation of ESP-IDF versions. This command runs in non-interactive mode by default.
40+
41+
```bash
42+
eim install [OPTIONS]
43+
```
44+
45+
Options:
46+
- `-p, --path <PATH>`: Base path to which all files and folders will be installed
47+
- `--esp-idf-json-path <ESP_IDF_JSON_PATH>`: Absolute path to save eim_idf.json file
48+
- `-c, --config <FILE>`: Path to configuration file
49+
- `-t, --target <TARGET>`: Target platforms (comma-separated)
50+
- `-i, --idf-versions <IDF_VERSIONS>`: ESP-IDF versions to install (comma-separated)
51+
- `--tool-download-folder-name <TOOL_DOWNLOAD_FOLDER_NAME>`: Name of the folder for tool downloads
52+
- `--tool-install-folder-name <TOOL_INSTALL_FOLDER_NAME>`: Name of the folder for tool installations
53+
- `--idf-tools-path <IDF_TOOLS_PATH>`: Path to idf_tools.py file relative from ESP-IDF installation folder
54+
- `--tools-json-file <TOOLS_JSON_FILE>`: Path to tools.json file relative from ESP-IDF installation folder
55+
- `-n, --non-interactive <NON_INTERACTIVE>`: Run in interactive mode if set to false (default is true for non-interactive mode)
56+
- `-m, --mirror <MIRROR>`: URL for tools download mirror to be used instead of github.com
57+
- `--idf-mirror <IDF_MIRROR>`: URL for ESP-IDF download mirror to be used instead of github.com
58+
- `-r, --recurse-submodules <RECURSE_SUBMODULES>`: Should the installer recurse into submodules of the ESP-IDF repository (default true)
59+
- `-a, --install-all-prerequisites <INSTALL_ALL_PREREQUISITES>`: Should the installer attempt to install all missing prerequisites (Windows only)
60+
- `--config-file-save-path <CONFIG_FILE_SAVE_PATH>`: Path to save the configuration file
61+
- `--idf-features <IDF_FEATURES>`: Comma-separated list of additional IDF features (ci, docs, pytests, etc.) to be installed with ESP-IDF
62+
63+
### Wizard Command
64+
65+
Run the interactive ESP-IDF Installer Wizard.
66+
67+
```bash
68+
eim wizard [OPTIONS]
69+
```
70+
71+
The wizard command accepts the same options as the install command but runs in interactive mode, guiding you through the installation process with a series of prompts.
72+
73+
### List Command
74+
75+
List all installed ESP-IDF versions.
76+
77+
```bash
78+
eim list
79+
```
80+
81+
This command displays all ESP-IDF versions installed on your system, with the currently selected version marked.
82+
83+
### Select Command
84+
85+
Select an ESP-IDF version as active.
86+
87+
```bash
88+
eim select [VERSION]
89+
```
90+
91+
If `VERSION` is not provided, the command will prompt you to select from available versions. Selecting version means setting the `idfSelectedId` in the `eim_idf.json` file. This is used by the IDEs to know which of the IDF versions you prefer to use.
92+
93+
### Rename Command
94+
95+
Rename a specific ESP-IDF version.
96+
97+
```bash
98+
eim rename [VERSION] [NEW_NAME]
99+
```
100+
101+
If `VERSION` is not provided, the command will prompt you to select from available versions.
102+
If `NEW_NAME` is not provided, the command will prompt you to enter a new name.
103+
104+
### Remove Command
105+
106+
Remove a specific ESP-IDF version.
107+
108+
```bash
109+
eim remove [VERSION]
110+
```
111+
112+
If `VERSION` is not provided, the command will prompt you to select from available versions.
113+
114+
### Purge Command
115+
116+
Purge all ESP-IDF installations.
117+
118+
```bash
119+
eim purge
120+
```
121+
122+
This command removes all known ESP-IDF installations from your system.
123+
124+
### Import Command
125+
126+
Import an existing ESP-IDF installation using a tools_set_config.json file.
127+
128+
```bash
129+
eim import [PATH]
130+
```
131+
132+
If `PATH` is not provided, the command will inform you that no config file was specified.
133+
134+
### Discover Command
135+
136+
Discover available ESP-IDF versions (not implemented yet).
137+
138+
```bash
139+
eim discover
140+
```
141+
142+
This command is planned to discover ESP-IDF installations on your system but is not yet implemented.
143+
144+
## Examples
145+
146+
```bash
147+
# Install ESP-IDF v5.3.2 non-interactively (default behavior)
148+
eim install -i v5.3.2
149+
150+
# Install ESP-IDF v5.3.2 in interactive mode
151+
eim install -i v5.3.2 -n false
152+
153+
# Run the interactive wizard
154+
eim wizard
155+
156+
# List installed versions
157+
eim list
158+
159+
# Select a specific version
160+
eim select v5.3.2
161+
162+
# Rename a version
163+
eim rename v5.3.2 "ESP-IDF 5.3.2 Stable"
164+
165+
# Remove a specific version
166+
eim remove v5.3.2
167+
168+
# Purge all installations
169+
eim purge
170+
171+
# Import from a config file
172+
eim import /path/to/tools_set_config.json
173+
```

docs/src/cli_configuration.md

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,38 @@ The command-line interface supports multiple configuration methods with the foll
77
3. Configuration files
88
4. Default values
99

10-
## Command Line Arguments
10+
## Command Structure
11+
12+
ESP-IDF Installation Manager (EIM) now uses a command-based structure with the following format:
1113

12-
View all available options with:
1314
```bash
14-
eim --help
15+
eim [OPTIONS] [COMMAND] [COMMAND_OPTIONS]
1516
```
1617

17-
Common arguments include:
18+
For example:
1819
```bash
19-
# Install specific IDF version
20-
eim -i v5.3.2
20+
# Install ESP-IDF with specific version
21+
eim install -i v5.3.2
22+
23+
# Run the interactive wizard
24+
eim wizard
25+
26+
# List installed versions
27+
eim list
28+
```
2129

22-
# Set installation path
23-
eim -p /opt/esp-idf
30+
For a complete list of available commands and their options, see [CLI Commands](./cli_commands.md).
2431

25-
# Non-interactive installation
26-
eim -n true
32+
## Command Line Arguments
2733

28-
# Use configuration file
29-
eim --config path/to/config.toml
34+
View all available options with:
35+
```bash
36+
eim --help
37+
```
3038

31-
# Install prerequisites (Windows only)
32-
eim -a true
39+
For help with a specific command:
40+
```bash
41+
eim <command> --help
3342
```
3443

3544
## Environment Variables
@@ -43,7 +52,7 @@ Example:
4352
```bash
4453
export ESP_PATH="/opt/esp-idf"
4554
export ESP_IDF_VERSION="v5.3.2"
46-
eim
55+
eim install
4756
```
4857

4958
## Configuration Files
@@ -70,22 +79,25 @@ install_all_prerequisites = false
7079

7180
Load a configuration file:
7281
```bash
73-
eim --config path/to/config.toml
82+
eim install --config path/to/config.toml
7483
```
7584

7685
## Headless Configuration
7786

78-
For automated installations, combine non-interactive mode with other configuration options:
87+
For automated installations, use the `install` command which runs in non-interactive mode by default:
7988

8089
```bash
8190
# Basic headless installation
82-
eim -n true
91+
eim install
8392

8493
# Headless with specific version and path
85-
eim -n true -i v5.3.2 -p /opt/esp-idf
94+
eim install -i v5.3.2 -p /opt/esp-idf
8695

8796
# Headless with config file
88-
eim -n true --config path/to/config.toml
97+
eim install --config path/to/config.toml
98+
99+
# To run in interactive mode, explicitly set non-interactive to false
100+
eim install -n false
89101
```
90102

91-
See [Headless Usage](./headless_usage.md) for more details about automated installations.
103+
See [Headless Usage](./headless_usage.md) for more details about automated installations.

docs/src/headless_usage.md

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,58 @@ The ESP-IDF Installation Manager supports headless mode for automated installati
44

55
## Basic Headless Usage
66

7-
To run the installer in headless mode, use the `-n` or `--non-interactive` flag:
7+
The `install` command runs in non-interactive (headless) mode by default. You don't need to explicitly specify the `-n` or `--non-interactive` flag:
88

99
```bash
10-
eim -n true
10+
eim install
1111
```
1212

13-
This will install the latest version of ESP-IDF with default settings.
13+
This will install the latest version of ESP-IDF with default settings in non-interactive mode.
14+
15+
If you want to run the install command in interactive mode, you would need to explicitly specify:
16+
17+
```bash
18+
eim install -n false
19+
```
1420

1521
## Advanced Headless Usage
1622

1723
### Custom Installation Options
1824

19-
Combine the non-interactive flag with other parameters:
25+
Use the install command with various parameters:
2026

2127
```bash
2228
# Install specific version
23-
eim -n true -i v5.3.2
29+
eim install -i v5.3.2
2430

2531
# Custom installation path
26-
eim -n true -p /opt/esp-idf
32+
eim install -p /opt/esp-idf
2733

2834
# Install prerequisites (Windows only)
29-
eim -n true -a true
35+
eim install -a true
3036
```
3137

3238
### Using Configuration Files
3339

3440
For reproducible installations, use a configuration file:
3541

3642
```bash
37-
eim -n true --config path/to/config.toml
43+
eim install --config path/to/config.toml
44+
```
45+
46+
### Managing Installations
47+
48+
You can also use other commands:
49+
50+
```bash
51+
# List installed versions
52+
eim list
53+
54+
# Select a specific version
55+
eim select v5.3.2
56+
57+
# Remove a specific version
58+
eim remove v5.3.2
3859
```
3960
4061
## CI/CD Integration
@@ -86,7 +107,7 @@ RUN set -x && \
86107
rm /tmp/eim.zip
87108

88109
# Install ESP-IDF
89-
RUN eim -n true -i v5.3.2
110+
RUN eim install -i v5.3.2
90111

91112
WORKDIR /workspace
92113
ENTRYPOINT ["/bin/bash", "-c", "source /root/.espressif/activate_idf_v5.3.2.sh && $0 $@"]
@@ -98,4 +119,4 @@ ENTRYPOINT ["/bin/bash", "-c", "source /root/.espressif/activate_idf_v5.3.2.sh &
98119
2. **Configuration Files**: Use configuration files for complex setups to ensure consistency
99120
3. **Error Handling**: In CI/CD environments, ensure proper error handling and logging
100121
4. **Prerequisites**: On Windows, use `-a true` to automatically install prerequisites
101-
5. **Path Management**: Use absolute paths to avoid any ambiguity
122+
5. **Path Management**: Use absolute paths to avoid any ambiguity

docs_cli/book.toml

Lines changed: 0 additions & 21 deletions
This file was deleted.

docs_cli/book/.nojekyll

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)