|
| 1 | +ESP-IDF Chat Commands |
| 2 | +================================= |
| 3 | + |
| 4 | +This feature lets you run ESP-IDF commands directly from the VS Code chat window. |
| 5 | +Instead of typing terminal commands, you can simply ask in chat - and the tool will execute common ESP-IDF actions for you, like building, flashing, or monitoring your project. |
| 6 | + |
| 7 | +.. _available-language-commands: |
| 8 | + |
| 9 | +Available Commands |
| 10 | +------------------ |
| 11 | + |
| 12 | +The tool supports the following ESP-IDF commands: |
| 13 | + |
| 14 | +Command Parameters |
| 15 | +~~~~~~~~~~~~~~~~~~ |
| 16 | + |
| 17 | +Some commands support additional parameters to customize their behavior: |
| 18 | + |
| 19 | +* **target** - Specifies the ESP32 target device (for ``setTarget`` command). Supported values: esp32, esp32s2, esp32s3, esp32c3, esp32c6, esp32h2, esp32p4, esp32c2, esp32c5, esp32c61, esp32h21, esp32h4, linux |
| 20 | +* **partitionToUse** - Specifies which partition to build or flash (for ``build``, ``flash``, and ``buildFlashMonitor`` commands). Supported values: app, bootloader, partition-table |
| 21 | +* **flashType** - Specifies the flash method to use (for ``flash`` and ``buildFlashMonitor`` commands). Supported values: UART, JTAG, DFU |
| 22 | + |
| 23 | +Build and Flash Commands |
| 24 | +~~~~~~~~~~~~~~~~~~~~~~~~ |
| 25 | + |
| 26 | +* **build** - Build the ESP-IDF project (``espIdf.buildDevice``) |
| 27 | + * Optional parameter: ``partitionToUse`` (app, bootloader, partition-table) |
| 28 | +* **flash** - Flash the built application to the device (``espIdf.flashDevice``) |
| 29 | + * Optional parameters: ``partitionToUse`` (app, bootloader, partition-table), ``flashType`` (UART, JTAG, DFU) |
| 30 | +* **monitor** - Monitor the device output (``espIdf.monitorDevice``) |
| 31 | +* **buildFlashMonitor** - Build, flash, and monitor the project in one command (``espIdf.buildFlashMonitor``) |
| 32 | + * Optional parameters: ``partitionToUse`` (app, bootloader, partition-table), ``flashType`` (UART, JTAG, DFU) |
| 33 | + |
| 34 | +Project Management Commands |
| 35 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 36 | + |
| 37 | +* **fullClean** - Perform a full clean of the project (``espIdf.fullClean``) |
| 38 | +* **menuconfig** - Open the ESP-IDF menuconfig interface (``espIdf.menuconfig.start``) |
| 39 | +* **size** - Analyze the application size (``espIdf.size``) |
| 40 | +* **eraseFlash** - Erase the device flash memory (``espIdf.eraseFlash``) |
| 41 | + |
| 42 | +Configuration Commands |
| 43 | +~~~~~~~~~~~~~~~~~~~~~~ |
| 44 | + |
| 45 | +* **selectPort** - Select the serial port for communication (``espIdf.selectPort``) |
| 46 | +* **setTarget** - Set the ESP32 target device (``espIdf.setTarget``) |
| 47 | + * Optional parameter: ``target`` (esp32, esp32s2, esp32s3, esp32c3, esp32c6, esp32h2, esp32p4, esp32c2, esp32c5, esp32c61, esp32h21, esp32h4, linux) |
| 48 | +* **doctor** - Run the ESP-IDF doctor command to diagnose issues (``espIdf.doctorCommand``) |
| 49 | + |
| 50 | +Development Commands |
| 51 | +~~~~~~~~~~~~~~~~~~~~ |
| 52 | + |
| 53 | +* **newProject** - Create a new ESP-IDF project (``espIdf.newProject.start``) |
| 54 | +* **partitionTable** - Open the partition table editor (``esp.webview.open.partition-table``) |
| 55 | +* **componentManager** - Open the ESP component manager (``esp.component-manager.ui.show``) |
| 56 | +* **apptrace** - Start application tracing (``espIdf.apptrace``) |
| 57 | +* **heaptrace** - Start heap tracing (``espIdf.heaptrace``) |
| 58 | + |
| 59 | +Usage |
| 60 | +------ |
| 61 | + |
| 62 | +Press menu ``View`` > ``Chat`` to open the chat window. |
| 63 | + |
| 64 | +You can type in the chat windows using natural language, and the tool will interpret your request to execute the appropriate ESP-IDF command. |
| 65 | + |
| 66 | +**Natural Language Patterns**: |
| 67 | + |
| 68 | +- "build the project" |
| 69 | +- "flash the device" |
| 70 | +- "monitor the output" |
| 71 | +- "clean the project" |
| 72 | +- "configure the project" |
| 73 | +- "analyze size" |
| 74 | +- "erase flash" |
| 75 | +- "select port" |
| 76 | +- "set target to esp32c6" |
| 77 | +- "run doctor" |
| 78 | +- "create new project" |
| 79 | +- "edit partition table" |
| 80 | +- "manage components" |
| 81 | +- "start app trace" |
| 82 | +- "start heap trace" |
| 83 | + |
| 84 | +You can alternatively type ``#espIdfCommands <tag>`` to invoke the command directly. Replace ``<tag>`` with one of the supported command tags from :ref:`Available Commands <available-language-commands>`. |
| 85 | + |
| 86 | +.. note:: |
| 87 | + |
| 88 | + * While the Chat can understand natural language, using the specific ``#espIdfCommands <tag>`` command format ensures accurate command execution. |
| 89 | + * The tool is designed to handle one command at a time. For multiple actions, please enter them separately. |
| 90 | + * Ensure your ESP-IDF environment is properly set up in VS Code for the commands to work correctly. Review the documentation to :ref:`Install ESP-IDF and Tools <installation>`. |
| 91 | + |
| 92 | +For example, to build the project, you can type: |
| 93 | + |
| 94 | +.. code-block:: text |
| 95 | +
|
| 96 | + build the project |
| 97 | +
|
| 98 | +.. code-block:: text |
| 99 | +
|
| 100 | + #espIdfCommands build |
| 101 | +
|
| 102 | +A dialog will appear to ``Confirm ESP-IDF Command``. Click ``Allow`` to proceed. |
| 103 | + |
| 104 | +.. figure:: ../../_static/confirm-idf-cmd-message.png |
| 105 | + :align: center |
| 106 | + :alt: Confirm ESP-IDF Command |
| 107 | + :figclass: align-center |
| 108 | + |
| 109 | +The command will execute, and the output will be displayed in the terminal (if the command uses a terminal) and the chat window. Some commands may not produce output and launch a UI (like ``newProject``). |
| 110 | + |
| 111 | + |
| 112 | +Examples |
| 113 | +~~~~~~~~~~~~~~ |
| 114 | + |
| 115 | +Here are some examples of how to use the commands with parameters: |
| 116 | + |
| 117 | +**Setting Target:** |
| 118 | + |
| 119 | +* "set target to esp32s3" |
| 120 | +* "#espIdfCommands setTarget esp32c6" |
| 121 | + |
| 122 | +**Building Specific Partitions:** |
| 123 | + |
| 124 | +* "build partition-table" |
| 125 | +* "#espIdfCommands build bootloader" |
| 126 | +* "build bootloader" |
| 127 | +* "#espIdfCommands build partition-table" |
| 128 | + |
| 129 | +**Flashing with Different Methods:** |
| 130 | + |
| 131 | +* "flash with UART" |
| 132 | +* "#espIdfCommands flash UART" |
| 133 | +* "flash with JTAG" |
| 134 | +* "#espIdfCommands flash JTAG" |
| 135 | +* "flash with DFU" |
| 136 | +* "#espIdfCommands flash DFU" |
| 137 | + |
| 138 | +**Combined Operations:** |
| 139 | + |
| 140 | +* "build and flash app with UART" |
| 141 | +* "#espIdfCommands buildFlashMonitor app UART" |
| 142 | +* "build and flash bootloader with JTAG" |
| 143 | +* "#espIdfCommands buildFlashMonitor bootloader JTAG" |
| 144 | +* "build and flash partition table with DFU" |
| 145 | +* "#espIdfCommands buildFlashMonitor partition-table DFU" |
0 commit comments