A lightweight and versatile command-line interface for Arduino-based projects.
- New implementation of automatic command registration.
- API Clean up.
- platformio registration.
- See commit logs.
- Designed for microcontrollers, prioritizing efficiency and essential functionality
- Works with any stream-based transport (Serial, Telnet, etc.)
- Includes some selected VT100 sequences for improved terminal usability
- Automatic command registration via
CLI_COMMAND(name)
macro - Minimalistic history support to repeat the last command
- Configurable command separator (default: space)
- Configurable prompt (default: #>)
- Simple integration with
cli.begin()
andcli.loop()
Add the library to your platformio.ini
:
lib_deps = https://github.com/fjulian79/libcli.git
Clone the repository and place it in your libraries
folder:
git clone https://github.com/fjulian79/libcli.git
#include <Arduino.h>
#include <cli/cli.hpp>
Cli cli;
CLI_COMMAND(ver) {
ioStream.printf("libcli_example v1.0.0\n");
return 0;
}
void setup() {
Serial.begin(115200);
cli.begin();
}
void loop() {
cli.loop();
}
- Backspace, a standard behavior in terminal environments. See https://vt100.net/docs/vt510-rm/chapter4.html for details.
CTRL + L
to delete the sceenCTRL + K
to delte the line- Ring the bell of the users terminal (see example)
Custom settings can be set within yor project by addind a header file called cli_config.hpp
or in platformio.ini
For a list of configurable options along with their documentation see cli/config.hpp
If you use the header file you have to add the include path in platformio.ini
.
E.g. when you have ./cfg/cli_config.hpp
build_flags = -Icfg
For a basic example see examples For full example projects, visit clidemo.
This library is licensed under GPL-3.0.
Developed by Julian Friedrich. For contributions or issues, visit the GitHub repository.