Configuration

The files espx reads and writes, what lives in ~/.espx, and the environment variables it reads.

espx has two configuration files of its own, both optional: espx.toml in a project and ~/.espx/boards.toml. Everything else lives where the tool that owns it reads it. Command-line flags override every file.

espx.toml

Next to a project's Cargo.toml. It binds the project to a board and holds the AI agent policy.

espx.toml
[board]
id = "58:8C:81:53:AD:2C"   # the board this project flashes by default: an id, a name or a port
baud = 460800              # flashing speed when --baud is not given

[agent]
boards = ["58:8C:81:53:AD:2C"]   # boards an agent may flash, erase or reset; [] = none
erase = false                    # default false
flash = true                     # default true
KeyTypeDefaultMeaning
board.idstringnoneThe board flash, run and monitor use when --port is not given. A board id, a name from boards.toml, or a port path
board.baudintegernoneThe flashing speed for flash and run when --baud is not given
agent.boardsarray of strings[board.id], or noneBoards AI agents may touch, by id, name or port
agent.flashbooleantrueAgents may flash the allowed boards
agent.erasebooleanfalseAgents may erase the allowed boards

Written by espx new --board-id (the [board] section), espx agent set, espx agent allow and the desktop app, which edit the [agent] lines in place and keep your comments. A missing file means the defaults. An unknown key is an error that names the file, the line and the key. See Boards and ports and Agent policy.

boards.toml

~/.espx/boards.toml gives physical boards names:

~/.espx/boards.toml
[names]
"58:8C:81:53:AD:2C" = "bench-c6"

Each key is a board id (the USB serial number, or the port path when there is none), each value a name: unique, at most 64 characters of ASCII letters, digits, -, _ and ., starting with a letter or digit. Ids compare without regard to case; names compare exactly. espx boards name and the desktop app's rename write it, replacing the whole file, so comments do not survive. An unknown key is an error.

Files other tools own

espx reads these and leaves their contents to their tools.

FileOwnerWhat espx uses
espflash_ports.tomlespflash[connection] serial, step 3 of the board selection order. espx new --port writes it
espflash.tomlespflash[flash] size and the partition_table and target_app_partition in [idf_format_args] or [idf], for the partition check. espflash itself reads baudrate and the rest of [flash] (mode, size, frequency)
.cargo/config.tomlcargo[build] target, from which espx derives the chip
rust-toolchain.tomlrustupchannel; esp means an Xtensa project that needs Espressif's fork
Cargo.tomlcargoThe binary name, whether defmt is a dependency, esp-hal's features, and the crate requirements before the first build
Cargo.lockcargoThe resolved esp-hal crate versions, also from an enclosing workspace
espflash.toml
baudrate = 460800

[flash]
size = "8MB"

The ~/.espx folder

PathContents
bin/espflash, cargo-espflash, esp-generate, and espup after an Xtensa setup
export-esp.shWritten by espup: LIBCLANG_PATH and PATH for the Xtensa fork
update-checkThe daily update check's cache
boards.tomlBoard names
agent.logThe agent audit log, one JSON object per line
sessions/Recordings made by the desktop app: one folder per board, a .jsonl file per recording and a .toml beside it with its name, board and project
hub.sock, hub.lockThe board hub's Unix socket and lock, present while an espx process serves it. Both are readable and writable by your user only
desktop.tomlThe desktop app's settings; see Desktop app
desktop-state.tomlThe desktop app's recent projects

Set ESPX_HOME to use another folder. espx uninstall --home deletes the whole folder.

Outside ~/.espx, rustup keeps the RISC-V targets and the esp toolchain in ~/.rustup, and espup keeps its files in ~/.espup. espx setup --shell adds one line to ~/.zshrc or ~/.bashrc. Nothing goes into ~/.cargo/bin except the espx binary you installed with cargo.

Environment variables

VariableRead byEffect
ESPX_HOMEespxThe folder espx keeps its tools and state in, instead of ~/.espx
ESPX_NO_UPDATE_CHECKespxSet to any value to turn off the daily background update check and its notices
MONITOR_BAUDespx, espflashThe monitor speed when --baud is not given. Default 115200
ESPFLASH_BAUDespflashThe flashing speed when neither --baud nor [board] baud is set
ESPFLASH_PORTespflashThe port when espx leaves the choice to espflash (erase and info without --port, flash -i). espx's own board selection does not read it
SHELLespxWhich shell config espx setup --shell and espx uninstall --shell edit: zsh or bash
CLAUDE_CONFIG_DIR, CODEX_HOMEespxWhere espx looks for Claude Code's and Codex's configuration when it checks or changes an MCP client
ESPX_BASE_URL, ESPX_TOOLS_URLespxPoint espx at another release server or tool mirror

espx gives cargo and rustup one environment: yours, plus the lines of ~/.espx/export-esp.sh when it exists, with ~/.espx/bin first on PATH and RUSTUP_TOOLCHAIN removed so the project's rust-toolchain.toml decides the toolchain.