Simplify the Integration of Arduino-cli into external tools : Interactive Mode Flag #2839
Open
3 tasks done
Labels
topic: CLI
Related to the command line interface
topic: code
Related to content of the project itself
type: enhancement
Proposed improvement
Describe the request
I am working on an editor / ide for arduino development. I am using Arduino-CLI for the various actions like compile, upload, queries etc.
This is done by shelling out the Arduino-cli for each command with the according command line parameters and capturing the JSON output. The response then runs into a json-parser which feeds the provided results into the application.
As this is done on every request, there is a huge overhead both in code and resource usage.
To simplify this, i would recommend adding an "interactive" flag to the Arduino-CLI that the CLI will
This way the CLI could be started only once, when the editor is starting up, and the communication between the editor and the CLI would be a simple stdin - stdout communication, avoiding creating a new instance of the CLI for every request, and of course getting rid of them after.
The application is currently Windows only, so the following code examples are like that, but the concepts behind would be useful also for other platforms.
The "shelling out" is done like that:
Of course this could be implemented on GRPC but there are other issues including the missing support for gcc and massive development effort for the integration.
Describe the current behavior
A new instance of the Arduino CLI has to be created for each request.
Arduino CLI version
all
Operating system
Windows
Operating system version
10 , 11
Additional context
No response
Issue checklist
The text was updated successfully, but these errors were encountered: