Skip to main content

termapy

Project Status: CI coverage ty license docs

Powered by: Textual pySerial zensical

Built with: python uv pytest coverage

Pronounced "ter-map-ee"

Runs on Windows, macOS, and Linux. A serial interface terminal like PuTTY or Tera Term, but it runs in your terminal, installs in seconds, works well with git and teams, and comes with scripting, protocol testing, and a plugin system built in.

Low time commitment: about 1 minute from scratch, or under 10 seconds if you already have uv installed.

termapy screenshot

Install

uv is the preferred package manager: a clean install takes under 10 seconds, and subsequent updates are well under a second.

  1. Install Python package manager uv (skip if already installed) - < 1 minute:

    # Windows (PowerShell)
    powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
    
    # macOS / Linux
    curl -LsSf https://astral.sh/uv/install.sh | sh
    
  2. Install termapy - < 10 seconds:

    uv tool install -q "termapy[all]"
    

    [all] adds the optional MCP server (drive termapy from an LLM) and web mode (HTTP-served TUI). Lazy imports mean unused deps cost nothing at runtime — TUI/CLI users don't pay for MCP, MCP users don't pay for Textual. If you specifically need a slim install (embedded, container), drop the [all] and add [mcp] or [web] only when needed.

  3. Run termapy - starts a simulated device, no hardware needed. You're typing commands in seconds:

    termapy --demo
    
  4. Remove termapy if you don't like it:

    uv tool uninstall termapy
    

Connect your own device

1. Find its port. You may not know which port your device is, and a machine often has more than one. Ask termapy what is plugged in:

termapy --ports

Each port gets one line: the maker, the chip and its USB serial number, so two adapters can be told apart. If you still can't tell which is yours, watch while you plug it in:

termapy --watch     # Ctrl+C to stop
[15:57:57] monitoring 3 port(s); Ctrl+C to exit
[15:58:06] +  COM7
[15:58:06]    COM7    closed  FTDI       USB Serial Port     FTDI FT232R / FT245R              Full-Speed  0403:6001  BG03U7VTA

The + line is the port that just arrived.

2. Open it. Name the port, as with screen:

termapy COM7                   # connected, at 115200 8N1
termapy COM7 9600 7E1 crlf     # settings after the port, when yours differ
termapy BG03U7VTA              # by serial number, whatever COM number Windows gives it

On Linux and macOS a port shows by its short name, ttyUSB0 or usbserial-A50285BI, and you can type that or the full path. termapy keeps the settings for next time, in a config of the port's own beside your other configs. Beside the output, the EOL, Echo and Color buttons show those three settings, and a click steps one.

3. Give it a project when it earns one. For scripts, plugins, a device profile or an MCP agent, make a config in the current folder:

termapy --new my_device COM7 9600
termapy my_device              # next time

Prefer not to type? In the app, Cfg → New opens the New Config dialog with the same list of ports to pick from.

For a new dev board, a starter project gives it a command monitor that answers you and an MCP agent on day one. The Raspberry Pi Pico and the ESP32-S3 DevKitC-1 have one; see the Dev boards help page:

termapy --board pico

For a plain-text terminal (no TUI), use CLI mode:

termapy --cli --demo

There's a lot more, and none of it is in the way until you need it: scripting, data capture, binary protocol testing, every CRC algorithm in the reveng catalog, memory and symbols, file transfer, dev boards, plugins and an MCP server. The sections below cover the terminal; the rest is one page away in More, when you need it.


First 60 seconds - connect, type, change settings
  1. Connect: termapy COM7 starts connected. In the app, the port button in the title bar picks another port, and the status button beside it connects and disconnects (green when connected)
  2. Type: enter commands in the input box at the bottom and press Enter
  3. Change settings: the EOL, Echo and Color buttons step their setting; click the config name in the title bar (or Cfg → Edit) for the port, the baud rate and everything else

Everything works through the UI. No config files to edit unless you want to.

Why not just use PuTTY? - what termapy adds

PuTTY works. So does minicom, screen, and CoolTerm. Use them if they do what you need. Here's where termapy goes further:

  • Runs anywhere Python does. Same tool on Windows, macOS, Linux. No GUI installer, no system dependencies.
  • Session logging and screenshots. Every session is logged. Ctrl+S saves an SVG screenshot you can paste into a report or email.
  • Scripting. Record a sequence of commands in a text file and replay it with one click, or rerun the last few commands you typed with /run.last. Add delays, prompts, and REPL commands.
  • Paste to run, no script file needed. Paste a block of commands into the prompt and every line runs as if you typed it: device lines go to the device, / lines run as termapy commands, Escape stops the rest. Paste a copied session, prompts, replies and all, and only its commands run again; the replies are skipped, never sent to the device. Copy what you did, paste it, and it happens again. See Pasting several lines.
  • Data capture. Capture serial text (timed) or binary data (by byte/record count) to files. Binary captures use the same format spec language as protocol testing to decode mixed-type records into CSV/TSV.
  • Binary protocol testing. Send raw hex, run scripted send/expect tests with pass/fail, decode Modbus and custom protocols with pluggable visualizers.
  • File transfer. XMODEM, YMODEM and ZMODEM send and receive from the prompt, into the config's own folder: a bootloader's loadx, a device's sz, or rz on a Linux console.
  • Plugin system. Add custom commands with a simple Python API. Drop a file in a folder, define a handler, done. Includes examples to get started.
  • Everything in one folder. Each device config gets its own subfolder with logs, screenshots, scripts, and plugins. Check it into git so the whole team has the same config.
  • Line-based, so device code stays small. Editing, history and type-ahead happen in termapy, and a line goes out only when you press Enter, so the device needs a line buffer and nothing more: no backspace, cursor or completion code. Name a C variable or a register and termapy sends the address. The same lines replay from a log or a paste and are what an MCP agent sends. See Why termapy is line-based.

See the detailed feature comparison against RealTerm, CoolTerm, Tera Term, Docklight, and HTerm.

Who this is not for - save yourself some time
  • You just need a simple serial terminal. If you open PuTTY, type AT, see OK, and you're done, keep using PuTTY (or screen /dev/ttyUSB0 115200 on Linux/macOS). Termapy is built for people who hit the limits of simple terminals and need scripting, protocol testing, data capture, or a plugin system.
  • You don't want Python on your machine. Termapy is a Python app. uv makes installation isolated and fast (it manages its own Python, won't touch your system), but if "install Python" is a deal-breaker, a native app like CoolTerm or RealTerm is a better fit.
  • You need a GUI with menus and mouse-driven workflows. Termapy runs in your terminal. It has a TUI with buttons and dialogs, but it's keyboard-first and text-based. If you want drag-and-drop or a Windows-native look, try Tera Term or Docklight.

Feature status

Termapy is in beta: everything not listed here is stable and ready for public testing. These parts work and are used daily, but they are still being developed and may change in any release.

Feature Commands Status
MCP server /mcp preview
Device files /dev preview
Symbols /sym preview
Memory access /mem preview
ZMODEM transfer /xfer.zmodem prototype
Dev board starters /board prototype
Device-side firmware /firmware prototype

Preview works but may change in any release; prototype is new and incomplete, and may change or be removed. /help states the level on the command's page and, in a listing, puts the name in italics with the level in its tooltip; the MCP catalog carries it, and a prototype says so once a session when it first runs.

Security

Termapy runs with your privileges and does whatever you — or a connected MCP client — tell it, so point it at devices, profiles, and MCP clients you trust. The MCP server is a preview, and its limits on host access are not complete yet: by default it refuses the access below on the main routes, but known gaps remain (listed in the MCP server help), so the MCP client's own permissions are the real boundary.

Host access (refused by default on the main routes) Opt in with
Files outside the config directory TERMAPY_MCP_FS_UNCONFINED=1
Serial ports TERMAPY_ALLOWED_PORTS naming them
Network sockets (socket://, rfc2217://) TERMAPY_MCP_NET_EGRESS=1, and TERMAPY_ALLOWED_PORTS naming the host exactly
Environment variables (/env, $(env.X)) TERMAPY_MCP_ENV_ENABLED=1
The machine beyond the allowed devices (whole USB bus, programs holding a port, /log.fingerprint, /app.alive) TERMAPY_MCP_HOST_INFO=1

Each TERMAPY_MCP_* flag takes any boolean token (1, on, true, yes, ...); a value outside that vocabulary refuses to start, naming the variable, rather than silently meaning off.

termapy --web served on a network address is confined the same way for files: a browser on another computer reaches the port with no login, so a path outside the config folder is refused unless TERMAPY_WEB_FS_UNCONFINED=1 is set in the server's shell. Served on localhost, the viewer is you, and nothing is confined.

termapy --serve shares serial ports on the network over RFC 2217 with no login: with --listen set to this machine's address, anyone who can reach it can drive the ports it names. --listen is required, so termapy never guesses which address to open: --listen localhost serves this machine only, and leaving it out lists the choices. See --serve.

TERMAPY_ALLOWED_PORTS limits the ports termapy opens and lists in every frontend: one regular expression over port names and USB serial numbers (COM7|BG03U7VTA). Unset, the TUI and CLI may open any port and an MCP server none. Keep it where an agent can't edit it; see Serial ports and MCP server.

No flag opens the rest to an MCP client: a shell (/os), renaming or deleting files, writing into plugin/ or viz/, replacing or adding to a file outside the config's folder, and setting a command your own sessions run at connect. These limit termapy's own commands; a client that can write files some other way is outside them.

The basics - keyboard shortcuts, title bar, REPL commands

Keyboard shortcuts

Key Action
Ctrl+Q Quit (also closes any open dialog)
Ctrl+S Save SVG screenshot
Ctrl+T Save text screenshot
Ctrl+P Command palette
Ctrl+C Copy the selected text; with nothing selected, send Ctrl-C to the device
Ctrl+D On an empty prompt, send Ctrl-D to the device
Ctrl+Z On an empty prompt, send Ctrl-Z to the device (an AT modem's send-SMS key)
Ctrl+A Select all output (click it first)
Ctrl+F Find in the config editor (Alt+F in VS Code)
Shift+Up Select output lines from the prompt; then Shift+arrows grow it
F1–F4 Help / Cfg / Run / Proto buttons (Ctrl+Shift+1–4 in VS Code); F10 edits the config
Up/Down Cycle through command history
Escape Stop what is running; otherwise clear the prompt, or, when it is empty, send Esc to the device
Right Accept type-ahead suggestion

See Environment and compatibility for OS / terminal quirks (VS Code integrated terminal key capture, macOS Option-as-Meta, KVM cross-platform keyboards, etc.).

Title bar

Button Action
Help Open the help guide
Cfg Open the config picker (Load / Edit / New / Rename / Delete)
Run Open the script picker (Run / Edit / New / Rename / Delete)
Proto Open the protocol-test picker
Update Appears only when a newer termapy is on PyPI
Center Click to edit the current config
Port Click to select a serial port
Status Click to connect/disconnect (red = disconnected, green = connected)

REPL commands

Type / to access built-in commands (the prefix is configurable). Type /help to list them all.

The most common ones:

Command Description
/help {cmd} List commands or show help for one
/port.list List available serial ports
/port.connect {name} {baud} {mode} Connect with optional baud rate and mode (e.g. N81)
/port.info Show port status and parameters
/cfg {key {value}} Open Cfg picker (bare TUI), or get/set values
/ss.svg {name} Save SVG screenshot
/cls Clear the terminal
/run {filename} Open Run picker (bare TUI), or run a named script
/term.echo {on|off|toggle} Local echo of device commands sent to the wire
/grep <pattern> Search scrollback
/exit Exit termapy
Terminal commands
Command Description
/help {cmd} List commands or show extended help for one
/help.dev <cmd> Show a command handler's Python docstring
/port {name} Open Port picker (bare TUI), list ports (bare CLI), or open by name
/port.help Same as /help port
/port.list List available serial ports
/port.connect {name} {baud} {mode} {custom=<bool>} Connect with optional baud and mode (e.g. /port.connect COM3 9600 N81); a non-standard rate needs custom=true
/port.mode {baud} {mode} {custom=<bool>} Show or set serial mode (e.g. /port.mode 9600 N81); a non-standard rate needs custom=true
/port.disconnect Disconnect from the serial port
/port.test <port> Open a port and close it again, to see that it answers
/port.info Show port status, serial parameters, and hardware lines
/port.baud_rate {value|cycle} {custom=<bool>} Show or set baud rate (hardware only): a standard one, or any from 300 with custom=true; cycle steps to the next standard rate
/port.byte_size {5|6|7|8|cycle} Show or set data bits (hardware only)
/port.parity {N|E|O|M|S|cycle} Show or set parity (hardware only)
/port.stop_bits {1|1.5|2|cycle} Show or set stop bits (hardware only)
/port.flow_control {none|rtscts|xonxoff|manual|cycle} Show or set flow control
/port.dtr {on|off|toggle} Show or set DTR line
/port.rts {on|off|toggle} Show or set RTS line
/port.cts Show CTS state (read-only)
/port.dsr Show DSR state (read-only)
/port.ri Show RI state (read-only)
/port.cd Show CD state (read-only)
/port.break {ms} Send break signal (default 250ms)
/cfg {key {value}} Open Cfg picker (bare TUI), list configs (bare CLI), or get/set with args
/cfg.save Write the settings this session changed into the config file
/cfg.list List all config files
/cfg.load <name> Switch to a different config by name
/cfg.loaded Show what the config load loaded: plugin files, symbols, device files
/cfg.show Open the current config file in the system viewer
/cfg.help Same as /help cfg
/ss.svg {name} Save SVG screenshot
/ss.txt {name} {N} Save text screenshot (all, or an N-line slice)
/ss.list List screenshots, newest first, with size and age
/ss.explore Open the screenshot folder in the system file explorer
/log {start|stop|print|...} Session log: start, stop, print, fingerprint, or open it
/cls Clear the terminal screen
/run {filename} Open Run picker (bare TUI), list scripts (bare CLI), or run; nests 5 deep; --echo shows each command line as it runs
/run.list List .run files in run/, newest first, with size, age and title; a name runs, its edit cell opens the editor
/run.rename <old> <new> Rename a script (.run kept; never overwrites)
/run.help Same as /help run
/delay <duration> Wait for a duration (e.g. 500ms, 1.5s); Escape or Ctrl+C cancels
/repeat <N> <cmd> Repeat a command N times with optional delay (Escape cancels)
/stop Abort a running script
/print <text> Print a message to the terminal
/print.r <text> Print Rich markup text (e.g. [bold red]Warning![/])
/term Terminal display / session toggles (echo, line_no, timestamps, ...)
/term.info Snapshot every /term.* toggle, and the bytes sent and received
/term.echo {on|off|toggle} Local echo of device commands to the wire; session only, seeded by cfg echo
/term.echo_repl {on|off|toggle} Local echo of REPL (slash) commands, session only; off inside scripts
/term.line_no {on|off|toggle} Toggle line numbers in serial output (TUI only)
/term.eol.markers {on|off|toggle} Toggle visible \r \n markers for line-ending troubleshooting
/term.output {level|cycle} Show or set output level (silent/quiet/normal/verbose)
/term.timestamps {on|off|toggle} Toggle [HH:MM:SS.mmm] timestamp prefix
/term.traffic {on|off|toggle} Show live TX/RX byte counts in the bottom bar (TUI only)
/term.hex {on|off|toggle} Toggle hex display of incoming bytes
/term.encoding {name} Show or set byte-decoding encoding (utf-8, latin-1, ...)
/term.json_fmt {compact|indent|color|cycle} How JSON answers print: one line, indented, or indented and colored
/term.send_bare_enter {on|off|toggle} Send line ending on empty Enter
/grep <pattern> Search scrollback for regex matches (case-insensitive, skips own output)
/find {pattern} Navigate scrollback matches with an interactive find bar
/search {--dev} <pattern> Deep-search every command's metadata (name, help, args, flags, long help)
/cfg.info {--display} Write the project report (folder tree, config, buttons, log and history tails) and show the folder tree, each file a link; --json gives the files by folder; also written at exit; --display opens it
/cap.text <f> ... Capture serial text to file for a timed duration
/cap.bin <f> ... Capture raw binary bytes to a file
/cap.struct <f> ... Capture binary data, decode with format spec to CSV
/cap.hex <f> ... Capture hex text lines, decode with format spec to CSV
/cap.stop Stop the capture; report its bytes and lines
/term.raw <text> Send text exactly as typed: no line ending, expansion or transforms
/exit Exit termapy

The protocol, device and advanced groups (/proto, /mem, /sym, /dev, /var, /env, /edit, /os, ...) are on the REPL commands page; /help shows them folded under the terminal group.

Screenshots and logs are saved in the config's subfolder (termapy_cfg/<name>/).

Project files - config layout, version control, env vars, examples

On first run, termapy prompts for a config name and creates one with defaults. If one config exists it loads automatically; if multiple exist, a picker appears. You can edit the config file through the UI (Cfg button), or change in-memory settings for the current session with /cfg baud_rate 9600.

Everything termapy creates (configs, scripts, test files, plugins, logs) lives in one folder. Run termapy --demo and you'll see this structure:

termapy_cfg/
├── plugin/                             # global plugins (all configs), once you add one
├── log/                                # diagnostic log, one file per run: what went wrong, with tracebacks
└── demo/
    ├── demo.cfg                        # config file
    ├── demo_legacy.profile.json        # /mem.* through the device's own `mem` grammar
    ├── demo.log                        # session log
    ├── demo.history                    # command history
    ├── demo.md                         # project report (/cfg.info), rewritten at exit
    ├── run/                            # script files for /run
    │   ├── at_demo.run
    │   ├── smoke_test.run
    │   ├── status_check.run
    │   └── ...                         # gps_demo, var_demo, expect_test, crc_tour, ...
    ├── plugin/                         # per-config plugins
    │   ├── cmd.py
    │   ├── probe.py
    │   ├── temp_plot.py
    │   └── traffic.py
    ├── sym/                            # symbol tables (demo.symbols.json, auto-loaded)
    ├── dev/                            # device files (console.device.json: the UART block CONSOLE names)
    └── proto/                          # protocol test scripts
        ├── at_test.pro
        ├── bitfield_inline.pro
        └── modbus_inline.pro

Your own configs follow the same layout, minus the demo content: a new config is its .cfg beside the log and history. Data folders appear on first use (ss/ at the first screenshot, cap/ at the first capture, prof/ at the first /run.profile, viz/ when you drop a visualizer in), and a folder you empty is removed at the next load, so a plain terminal session never sees a folder it has no use for.

Version control

Because everything is in one folder, you can commit it to git alongside your firmware source. Point --cfg-dir at a folder in your repo:

termapy --cfg-dir ./termapy_cfg

Clone on another machine, run the same command, and all configs, scripts, and test files are ready to go.

Since COM port names differ between machines, use $(env.NAME) placeholders in your config so the same file works everywhere. Set a COMPORT environment variable on each machine, and reference it with a fallback:

{
    "serial": {"port": "$(env.COMPORT|COM4)", "baud_rate": 115200},
    "auto_connect": true
}

On a machine with COMPORT=COM7, termapy connects to COM7. On a machine without COMPORT set, it falls back to COM4. The config file on disk keeps the raw $(env.COMPORT|COM4) template. It's expanded in memory at load time, so your checked-in config stays portable. A boolean key can be templated the same way ("echo": "$(env.ECHO|false)"); the expanded text is read with the boolean vocabulary (on, off, true, false, yes, no, 1, 0, ...), and a value outside it refuses the load naming the key.

Environment variables work in any string config value, not just serial.port:

{
    "serial": {"port": "$(env.COMPORT|COM4)"},
    "title": "$(env.DEVICE_NAME|Dev Board)",
    "log_file": "$(env.LOG_DIR|logs)/session.log"
}

You can also manage environment variables at runtime with REPL commands:

Command Description
/env.list {pattern} List variables (all, or a name pattern: COM*)
/env.set <name> <val> Set a session-scoped variable (in-memory only)
/env.reload Re-snapshot variables from the OS environment

Variables set with /env.set are available immediately for $(env.NAME) expansion in REPL commands but do not modify the OS environment or the config file.

User variables ($(NAME))

User variables let you define values once and reuse them across commands and scripts. This is especially useful when a test references the same address, register, or port in multiple places. Change it once at the top instead of everywhere.

Assign a variable by typing $(name) = value (no / prefix needed):

$(slave) = 01
$(reg) = 0064
$(count) = 05

Use variables in any command, REPL or serial:

/proto.send $(slave) 03 00 $(reg) 00 $(count)
/print Reading $(count) registers from $(slave) at $(reg)
AT+ADDR=$(slave)

A typical workflow is a setup script that configures a test, then a test script that uses the variables:

# setup_modbus.run - run this first to configure the test
$(SLAVE) = 01
$(BASE_REG) = 0064
$(NUM_REGS) = 05
/print Configured: slave=$(SLAVE) base=$(BASE_REG) count=$(NUM_REGS)
# test_registers.run - uses variables from setup
/proto.send $(SLAVE) 03 00 $(BASE_REG) 00 $(NUM_REGS)
/delay 500ms
/proto.send $(SLAVE) 06 00 $(BASE_REG) 04 D2

Run /run setup_modbus.run then /run test_registers.run. The variables persist across interactive /run calls.

Command Description
$(NAME) = value Set a variable (no / prefix needed)
/var List all defined variables
/var NAME Show one variable's value (or $(NAME))
/var.set NAME val Set a variable (explicit command form)
/var.clear Clear all variables

Scope: Variables persist until a config loads, which starts clean. A script is not a load: it sees them however it was launched, and what it sets stays after it ends. This lets you run a setup script to define variables, then run a test script that uses them. Use /var.clear to reset manually.

Naming: Variable names are case-sensitive ($(PORT) and $(port) are different variables). Names must start with a letter or underscore and contain only letters, digits, and underscores.

Built-in time variables:

Variable Set when Updates?
$(LAUNCH_DATETIME) App starts Never - frozen
$(SESSION_DATETIME) Script launched (Run picker) Per script launch
$(DATETIME) Every expansion Always current clock

Each group also has _DATE and _TIME variants (e.g. $(LAUNCH_DATE), $(SESSION_TIME)).

Any datetime variable takes an optional strftime format after a colon — $(DATETIME:%Y%m%d_%H%M%S) yields a filename-safe, colon-free stamp (the default $(DATETIME) has colons). This replaces the retired {datetime} / {clock} template placeholders; old scripts and configs are migrated automatically.

vs. environment variables: $(env.NAME) pulls from the OS environment and works in config files. $(NAME) is for user-defined session variables in commands and scripts. Both use the $(...) syntax. The env. prefix is required to access environment variables explicitly.

Escaping: Use \$ to prevent expansion of a single reference, or /term.send to send an entire line without expansion (/term.raw does the same with no line ending).

Add a .gitignore for session files you don't need to track:

# termapy_cfg - keep configs and scripts, ignore session files
termapy_cfg/*/*.log
termapy_cfg/*/*.history
termapy_cfg/*/ss/

To specify a config file directly:

termapy my_device.cfg

To override the config directory:

termapy --cfg-dir /path/to/configs

Config validation

Termapy checks every key the same way on load, in the config editor and at /cfg. A bad value (a parity that does not exist, max_lines of 0, a regex that does not compile) produces a yellow warning on load, turns red in the editor and blocks its Save, and is refused by /cfg. Unknown keys (typos) warn too. Non-standard baud rates are flagged but allowed, since some hardware uses custom rates.

To validate a config from the command line without launching the UI:

termapy --check my_device.cfg

This prints a JSON result to stdout and exits:

{"status": "ok"}
{"status": "warn", "warnings": ["baud_rate: 115201 is not a standard rate (110, 300, ...)"]}

The --check flag is read-only. It never modifies the config file.

Config examples

When you create a new config, termapy writes a complete .cfg file with all defaults. Here are some of the settings you can change:

{
    "serial": {"port": "COM4", "baud_rate": 115200},
    "auto_connect": true,
    "auto_reconnect": true,
    "title": "Sensor A",
    "border_color": "blue",
    "on_connect_cmd": "/run startup"
}

Custom buttons

The demo project's "Info" button runs the /cfg.info command via a custom button:

{"enabled": true, "name": "Info", "command": "/cfg.info", "tooltip": "Project info"}

Custom Info button in the toolbar

Add toolbar buttons that send commands, run scripts, or chain multiple actions. Use \n to separate multiple commands:

{
    "custom_buttons": [
        {"enabled": true, "name": "Reset", "command": "ATZ", "tooltip": "Reset device"},
        {"enabled": true, "name": "Init", "command": "ATZ\\nAT+BAUD=115200\\n/delay 500ms\\nAT+INFO", "tooltip": "Full init sequence"},
        {"enabled": true, "name": "Status", "command": "/run status_check.run", "tooltip": "Run status script"}
    ]
}

Hardware line control

Set serial.flow_control to "manual" to get DTR, RTS, and Break buttons in the toolbar. This is useful for devices that use these lines for reset or bootloader entry:

{
    "serial": {"port": "COM4", "baud_rate": 115200, "flow_control": "manual"},
    "title": "Hardware Debug"
}
Full config reference
{
    "config_version": 42,
    "title": "",
    "border_color": "",
    "serial": {
        "port": "COM4",
        "baud_rate": 115200,
        "custom_baud": false,
        "byte_size": 8,
        "parity": "N",
        "stop_bits": 1,
        "flow_control": "none"
    },
    "auto_connect": false,
    "auto_reconnect": false,
    "on_connect_cmd": "",
    "tui_on_connect_cmd": "",
    "cli_on_connect_cmd": "",
    "mcp_on_connect_cmd": "",
    "encoding": "utf-8",
    "eol": "\r",
    "tx_char_delay_ms": 0,
    "tx_line_delay_ms": 0,
    "tx_chunking": true,
    "eol_rx": "auto",
    "eol_markers": false,
    "send_bare_enter": false,
    "cmd_delay_ms": 0,
    "multiline_paste": true,
    "multiline_paste_delay_ms": 10,
    "control_keys": true,
    "echo": false,
    "echo_fmt": "[purple]$(CFG)> {cmd}[/]",
    "timestamps": false,
    "line_no": false,
    "hex": false,
    "color": true,
    "output_level": "normal",
    "max_lines": 10000,
    "max_grep_lines": 100,
    "protocol": "text",
    "ndjson_field_routing": {
        "response_id": "id",
        "error_field": "error",
        "event_field": "event"
    },
    "request_mode": false,
    "request_err_pattern": "(?i)^(ERROR|ERR|FAULT)\\b",
    "strip_device_echo": false,
    "json_fmt": {
        "highlight": true,
        "indent": 2
    },
    "profile_path": "",
    "validate_typed_args": false,
    "default_response_timeout_ms": 1000,
    "log_file": "",
    "file_xfer_root": "",
    "proto_frame_gap_ms": 50,
    "proto_results_template": "{name}_results.json",
    "default_ui": "tui",
    "quiet_start": true,
    "vt100_hint": true,
    "cmd_prefix": "/",
    "cli_prompt": "$(CFG)> ",
    "cli_completion": true,
    "cfg_enabled": true,
    "run_enabled": true,
    "proto_enabled": true,
    "record_enabled": true,
    "config_read_only": false,
    "custom_buttons_side": "bottom",
    "custom_buttons": []
}

See the config field reference for every key, its default, and a one-line description (also in-app under Help -> Configuration, and per-key in the config editor).

Note on eol_markers: This is a debug mode for troubleshooting line-ending mismatches (\r vs \n vs \r\n). When enabled, dim \r and \n markers appear inline in serial output before the characters are consumed by line splitting. Sent commands also show the configured line ending. Since the markers use ANSI escape sequences, they may interfere with device ANSI color output, so turn eol_markers off when not actively debugging.

Note on device color (ANSI): The TUI and CLI render ANSI color (SGR) from device output inline, so colored log lines appear colored. termapy is line-oriented by design and does not emulate cursor addressing or full-screen redraws in the TUI - for devices that drive the terminal that way (menus, top/vi on an embedded console, bootloader UIs), use --vt100 (see the VT100 mode section below), which hands raw bytes to your own terminal to emulate. /term.color off drops every color in either frontend, termapy's own included, and the CLI's --no-color starts it that way for clean piping. Over MCP, color defaults off so device ANSI is stripped from the JSON an agent receives (/term.color on re-enables passthrough); silence it at the source with the device's own color off in mcp_on_connect_cmd.

Scripting - automate command sequences with text files

Run picker: newest first, with size, updated, and title

Create text files with one command per line and run them from the Run button or with /run. In the file, lines starting with / are REPL commands, lines starting with # are comments and everything else is sent to the device. The first comment line is the script's title, which the Run picker and /run.list show beside its name; the comment lines after it describe it.

# Status Check
# A quick look at the device.
AT+STATUS
/delay 300ms
AT+TEMP
/delay 300ms

Scripts support delays (/delay 500ms), screen clearing (/cls), confirmation prompts (/confirm Reset device?), screenshots, and sequence counters with auto-increment for batch testing. See the demo scripts (at_demo.run, smoke_test.run) for examples.

Data capture - timed text capture, structured binary capture to CSV

Capture serial data to files without interrupting normal terminal display.

Text capture (timed, writes decoded text lines):

/cap.text log.txt timeout=3s cmd=AT+INFO              # capture 3 seconds of text
/cap.text session.txt timeout=10s mode=append          # append, just listen (no command)

Binary capture (raw bytes to file):

/cap.bin raw.bin bytes=256 cmd=read_all

Raw traffic log (every byte in both directions, through pyserial's spy://):

/port spy://COM3?file=traffic.txt                      # reopens the port and logs to cap/traffic.txt
/port COM3                                             # reopens it again, and logging stops

Or put the URL in the config's port key. Logging the raw traffic shows the format and what to expect.

Structured capture (binary data decoded via format spec to CSV):

# Single-type column - 50 big-endian unsigned 16-bit values
/cap.struct data.csv fmt=Val:U1-2 records=50 cmd=AT+BINDUMP u16 50

# Mixed-type record - string + u8 + u16 + u32 + float (little-endian)
/cap.struct mixed.csv fmt=Label:S1-10 Counter:U11 Val16:U13-12 Val32:U17-14 Temp:F21-18 records=20 cmd=AT+BINDUMP 20

# Tab-separated output with echo to terminal
/cap.struct log.tsv fmt=A:U1-2 B:F3-6 records=100 sep=tab echo=on cmd=read

The fmt= parameter uses the same format spec language as /proto, with type codes H (hex), U (unsigned), I (signed), S (string), F (float), B (bit) and 1-based byte ranges. Byte range order determines endianness: U1-2 = big-endian, U2-1 = little-endian. Named columns (Temp:U1-2) produce a CSV header row; unnamed columns (U1-2) omit it.

Format spec C type Meaning
U1 uint8_t 1 unsigned byte
U1-2 uint16_t 2-byte unsigned, big-endian
U2-1 uint16_t 2-byte unsigned, little-endian
U1-4 uint32_t 4-byte unsigned, big-endian
U1-8 uint64_t 8-byte unsigned, big-endian
I1 int8_t 1 signed byte
I1-2 int16_t 2-byte signed, big-endian
I1-4 int32_t 4-byte signed, big-endian
I1-8 int64_t 8-byte signed, big-endian
F1-4 float 4-byte IEEE 754 float
F1-8 double 8-byte IEEE 754 double
S1-10 char[10] 10-byte ASCII string
H1-4 4 bytes as hex (e.g. 0A1BFF03)

Auto-numbered filenames: use $(n000) for a 3-digit rotating sequence (000-999), tracked across sessions in a counter file.

/cap.text log_$(n000).txt timeout=3s cmd=AT+INFO          # log_000.txt, log_001.txt, ...
/cap.struct data_$(n00).csv fmt=V:U1-2 records=100 cmd=read

A progress bar and Stop button overlay the toolbar during capture. The Cap button opens the cap/ folder.

Demo mode - simulated device for trying everything without hardware

termapy --demo launches a completely simulated COM port, no hardware needed. The simulated device (BASSOMATIC-77, the natural successor to Dan Aykroyd's '76) responds to AT commands, NMEA/GPS sentences, and binary Modbus RTU frames, so you can exercise every termapy feature: serial I/O, scripting, protocol testing, and plugins.

The demo exists for two reasons: people can evaluate termapy without owning hardware, and the test suite has a deterministic target it can drive end-to-end through the same code paths a real device would.

Note: The demo command sets (AT, NMEA, Modbus) are not validated protocol implementations. They simulate familiar interfaces so you can explore termapy's features without hardware.

ASCII commands

The device supports a full AT command set. Type commands and get responses just like a real device:

Command Description
AT Connection test (returns OK)
AT+PROD-ID Product identifier (returns BASSOMATIC-77)
AT+INFO Device info (version, uptime, free memory)
AT+TEMP Read temperature sensor
AT+LED on|off Control LED
AT+NAME? Query device name
AT+NAME=val Set device name (max 32 chars)
AT+BAUD? Query baud rate
AT+BAUD=val Set baud rate (9600, 19200, 38400, 57600, 115200)
AT+STATUS Device status (LED, uptime, connections)
AT+RESET Reset device (simulates boot sequence)
mem <addr> [len] Hex memory dump (deterministic, max 256 bytes)
help The command landscape, grouped

GPS / NMEA commands

The device responds to standard NMEA queries and PMTK configuration commands. Position is fixed at the 50-yard line of Lumen Field, Seattle.

Command Description
$GPGGA Position fix (lat, lon, altitude, satellites)
$GPRMC Recommended minimum nav (pos, speed, date)
$GPGSA DOP and active satellites
$GPGSV Satellites in view (elevation, azimuth, SNR)
$PMTK220,1000 Set update rate (acknowledged, no effect)
$PMTK314,... Configure sentence output (acknowledged)

Binary protocol testing

The device also speaks Modbus RTU (binary), so you can try protocol test files and visualizers. Use /proto.send with hex bytes (CRC included):

/proto.send 01 03 00 00 00 01 84 0A       # read 1 register from addr 0
/proto.send 01 06 00 05 04 D2 1B 56       # write register 5 = 1234
/proto.send 01 03 00 05 00 01 94 0B       # read back register 5

Modbus RTU supports function 0x03 (read holding registers) and 0x06 (write single register) with CRC16 enforced.

Bundled scripts, tests, and plugins

The demo comes with everything wired up so you can try each feature:

  • Scripts: at_demo.run, smoke_test.run, status_check.run, gps_demo.run, var_demo.run, expect_test.run, crc_tour.run, zmodem_demo.run, and more. Run via the Run button or /run.
  • Proto test files: at_test.pro, bitfield_inline.pro, modbus_inline.pro. Run via the Proto button for pass/fail results.
  • Plugins: /probe sends a command sequence and reports results; /cmd adds a custom shortcut; /temp_plot draws a sparkline; /traffic.* taps RX/TX bytes.
CLI mode - plain-text terminal, no TUI

termapy --cli runs a plain-text serial terminal in your existing terminal window. No Textual UI, no mouse, just keyboard input and text output. The TUI is the intended way to use termapy, but the CLI exists for two cases: people who don't want a TUI (you know who you are), and pipelines that want to feed termapy's output into a file or another tool. The engine doesn't care which frontend it's running under; the TUI and CLI share the same ReplEngine, SerialEngine, plugins, scripts, and configs.

termapy --cli my_device              # interactive REPL
termapy --cli --demo                 # demo device, no hardware needed
termapy --cli smoke_test.run         # run a .run script and exit
termapy my_device -e "AT+VER"  # one-shot: run command, print stdout, exit
termapy --cli my_device --no-color   # strip ANSI color codes (REPL piping)

--cli covers two shapes of non-TUI use:

  • Interactive REPL (the default): blocks on stdin, dispatches each line, exits on /exit or EOF.
  • One-shot: pair --cli with --run <script> (run a .run file and exit) or -e "<command>" (run one command and exit). Exit status reflects success (0) or failure (1); cfg-driven connect-time autorun (on_connect_cmd) is suppressed so piped/captured stdout contains only the user's output.

Passing a .run file to --cli automatically infers the config from the file's location and runs it. Passing a config name or path opens an interactive session.

Features:

  • Rich colored output (toggle with /term.color on|off or --no-color)
  • Command history shared with TUI (up/down arrows, persisted across sessions)
  • Tab completion for REPL commands and for the file names they take (/run, /proto.run, /cap.dump, ...)
  • Script execution with /run (same scripts work in both TUI and CLI)
  • /delay with progress bar for waits of a second or longer (Ctrl+C to cancel)
  • All /port, /cfg, /var, /env, /proto.crc, /edit commands work

TUI-only features (not available in CLI mode):

  • /ss.svg, /ss.txt - screenshots (fail the screen_capture capability gate with a clear error)
  • /grep - scrollback search (no scrollback buffer in CLI)
  • /edit.cfg - opens in system editor instead of built-in config editor
  • Mouse interaction, modal dialogs, custom buttons

Exit: /exit, /quit, or Ctrl+C.

VT100 mode - raw ANSI passthrough for cursor-addressed devices

termapy --vt100 <config> drops the TUI entirely and pipes the device straight to your terminal, so output that uses terminal control beyond plain lines - cursor addressing, full-screen menus, vi/top on an embedded Linux console, bootloader UIs - renders and responds correctly. termapy doesn't emulate the terminal here; your terminal already is one, so it does the work (this is why it stays a passthrough, not a Textual widget).

termapy --vt100 my_device      # raw ANSI terminal on the configured port
termapy --vt100 --demo         # no hardware: an interactive ANSI menu/dashboard

--vt100 --demo connects to a simulated VT100 device that draws a colored, cursor-addressed menu (arrow keys to move, Enter to open) and a live status dashboard - the quickest way to see what passthrough buys you over plain line output. Quit with Ctrl-].

It's a peer of CLI and TUI mode: set "default_ui": "vt100" in a config to make it the default, and --vt100 overrides the config the same way --cli does. The port is termapy's own serial engine, as in every mode; the console is the vendored pyserial miniterm, which enables VT processing on Windows 10+ automatically. It writes the TUI's session log, <cfg>.log: received lines only, since in passthrough each key goes to the device as typed and the device's echo is the record.

It's also a reversible toggle from inside the TUI, like /app.cli <-> /app.tui: /app.vt100 hands the current device to a passthrough terminal, and /demo.vt100 jumps to the widget tour. In both cases Ctrl-] returns you to the TUI (when launched from the shell with --vt100, Ctrl-] quits instead).

Exit: Ctrl+] (or back to the TUI, if entered via /app.vt100). Every other key, including Ctrl+T, goes straight to the device - miniterm's settings menu is disabled so the session reads as a native termapy view.

Caveats: needs a VT-capable host terminal (universal on macOS/Linux; Windows Terminal / VS Code / Win10+ on Windows; legacy conhost is iffy). Run it in a standalone terminal tab for zero extra key interception; VS Code's integrated terminal adds one layer (the same one any serial terminal faces there). For LLM-driven menu navigation, a headless emulator + MCP is the intended path, not passthrough.

More, when you need it

Each of these is there when you need it and otherwise out of the way: /help folds them under the terminal commands (/help.more opens them all), the palette never lists them, and the MCP catalog carries them all.

Group What it does Page
Protocol testing .pro send/expect tests with pass/fail, the debug screen, packet visualizers, format specs that decode bytes into named columns Protocol testing
Serial tools and CRC /proto.send raw hex and text, hex display, every CRC in the reveng catalog (verified against its check value), code generation in eleven languages, identifying a CRC from a captured packet Serial tools
Symbols /sym.import turns an ELF or a linker map into names, sizes and C types, so memory commands take a variable's name Symbols
Devices A vendor's CMSIS-SVD becomes a device file: every register with its bit fields, placed per board Devices
Memory /mem.* reads and writes a target by name or address, typed, with the silicon's hazards respected Memory
Firmware and JSON The device-side kit: a command monitor, the MEM wire spec and JSON replies for C and MicroPython Firmware, JSON integration
Dev boards A starter project for the Raspberry Pi Pico and the ESP32-S3: device code, a config and a profile on day one Dev boards
File transfer XMODEM, YMODEM and ZMODEM send and receive from the prompt File transfer
Plugins Add a command by dropping a .py file in a folder; every built-in is one Writing plugins
MCP server Drive termapy from an LLM through a conservative, sandboxed tool surface MCP server
Portability

Developed and tested on Windows. Basic usage verified on macOS (serial, ANSI rendering, screenshots). macOS support is alpha until further testing. Linux is exercised by GitHub Actions CI on every push (the full test suite, including the CLI gold-standard integration test, runs on Ubuntu against Python 3.11 through 3.15), but interactive use on Linux has not been hand-verified by the author.

Architecture - threading model

Every command runs on a worker thread, the serial reader is the only long-lived thread, and the UI thread never parks on a lock a worker holds. The one description of the threads, their hand-offs, and the rules each relies on is the Threading model section of ARCHITECTURE.md.

Test coverage - 7948 tests

Run the full suite with uv run pytest. (The count above is the one place it is tracked; release_prep refreshes it each release.) The coverage figure is the coverage badge at the top, live from Codecov, measured by CI on every push to main.

Tests are scoped to termapy's own concerns — REPL dispatch, serial engine, CLI flow, plugin loading, capture, protocol toolkit. CRC codegen correctness (generator output for every algorithm in every language) lives in the crcglot test suite and runs on every crcglot release; termapy verifies only "the dispatch reached crcglot and produced output," not every generator permutation.

Core logic (serial engine, capture, REPL, protocol, config) is heavily covered by unit tests — test_migration.py, test_plugins.py, test_handles.py, test_capture.py, test_protocol.py, test_serial_engine.py, test_engine.py, test_serial_port.py, test_scripting.py, and more, one focused file per module.

Built-in plugins: broad coverage via test_builtins.py plus per-plugin test files (test_var.py, test_env_var.py, test_xmodem.py, test_ymodem.py, test_app_plugin.py, test_proto_send_crc.py, etc.).

UI code: app.py is driven headless by tests/test_app_pilot*.py (Textual Pilot boots the real app), every dialog by tests/test_dialogs*.py (each pushed into a bare host app), and proto_debug.py has Pilot coverage for its Run and Stop controls and is otherwise exercised manually. The headline coverage figure is measured with the builtins/ package top level and vendored code omitted (see [tool.coverage.run] in pyproject.toml): builtins/ are plugins covered behaviorally through the commands they register, vendor/ is third-party. app.py and dialogs/ are counted, so the UI layer's number is real and movable rather than a flattering omission.

Continuous integration - GitHub Actions

All tests run automatically on push to main and on pull requests via GitHub Actions.

Job What it does
test Runs pytest across Python 3.11, 3.12, 3.13, 3.14, and 3.15
coverage Runs pytest --cov on Python 3.14 and uploads to Codecov
audit Audits uv.lock with pip-audit (every extra and group; scripts/audit_lock.py)

The CI badge at the top of this README reflects the current status of the test workflow. See .github/workflows/tests.yml for the full configuration.


Built with heavy use of Claude. For how that worked out, see On AI assistance.

Metadata

Release files for termapy 0.82.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for termapy 0.82.0
File Size Uploaded Provenance Actions
termapy-0.82.0.tar.gz 2.8 MB Without provenance Details for termapy-0.82.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for termapy 0.82.0
File Interpreter ABI Platform Actions
termapy-0.82.0-py3-none-any.whl Python 3 none any Details for termapy-0.82.0-py3-none-any.whl

Total release size: 5.6 MB

Release files / termapy-0.82.0.tar.gz

Download URL termapy-0.82.0.tar.gz
Size 2.8 MB
Tags Source
SHA-256 checksum
How to use checksums
e551c6110332ecda24228157007b571f212e5320e767e62eeaa357059ea61210
BLAKE2b-256 checksum
How to use checksums
7c540e8ef0032319d0b5a664b0585c8ee322bc454311d6840527c6dc5db62662
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / termapy-0.82.0-py3-none-any.whl

Download URL termapy-0.82.0-py3-none-any.whl
Size 2.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
d964e2025d4d4c6837b6d40cc239ac863e8559a31b3362149a6dba40c5b67b59
BLAKE2b-256 checksum
How to use checksums
add4d785d24c491a0e1c5553bc3ffbd10685a142d031c4ba68e04de3c4c6ba2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for termapy 0.82.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.82.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page