RaftCLI - robdobsn/RaftCore GitHub Wiki

Raft command-line interface (CLI)

The RaftCLI project installs an executable program on your machine called raft. It is partly a wrapper around the Espressif ESP IDF build tools and also provides a consistent developer experience for scaffolding, building, flashing, serial monitoring, remote logging and OTA update of Raft applications.

What RaftCLI does

RaftCLI handles the following tasks so you don't have to interact with ESP IDF directly:

  • SysType resolution — determines which SysType to build (from the -s flag, a previously recorded choice, or the first SysType folder found)
  • Build method selection — automatically chooses Docker or native ESP IDF, with options to override
  • ESP IDF version matching — reads the required ESP IDF version from the project's Dockerfile and locates a matching local installation for native builds
  • Build invocation — calls idf.py -B build/<SysType> build with the correct environment
  • Flash — uses esptool for flashing
  • Serial Monitor provides a built-in serial monitor with command history and auto-reconnect
  • Remote Logging provides logging and command handling over an IP (WiFi, etc) link directly to the terminal
  • OTA update — sends firmware to a device over WiFi/Ethernet

For a detailed description of each build stage that happens after RaftCLI invokes the build, see Raft Build Process.

Installation

RaftCLI is written in Rust and installed via:

cargo install raftcli

You will also need either Docker (for containerised builds) or a locally installed ESP IDF (for native builds). For flashing, install esptool:

python3 -m pip install esptool

Commands

Command Alias Description
raft new <folder> raft n Scaffold a new Raft app
raft build raft b Build the firmware
raft run raft r Build, flash and monitor
raft flash raft f Flash without rebuilding
raft monitor raft m Serial monitor
raft debug <args> raft d Debug over IP
raft ota <ip> raft o Over-the-air firmware update
raft ports raft p List serial ports
raft esptool <args> raft e Run esptool directly

Use --no-docker (or -d) to build with a local ESP IDF instead of Docker. Use -s <SysType> to select a specific SysType.

Full documentation including all command options is available on the RaftCLI GitHub page.

⚠️ **GitHub.com Fallback** ⚠️