Skip to main content

HARDWARIO CLI Tools

Test Release PyPI License Twitter

Hardwario CLI is a command-line tool for developing, managing, and debugging devices in the HARDWARIO ecosystem. It supports workflows for CHESTER modules, Nordic SoCs (nRF5x, nRF91, etc.), firmware management, logging, and more.


✨ Features

  • Manage CHESTER-specific application SoC features
  • Open interactive device console for logs and shell access
  • Flash, erase, and reset firmware for supported SoCs
  • Work with HARDWARIO's Product Information Block (PIB)
  • Support for multiple chip families (nRF51, nRF52, nRF91, etc.)
  • Integration with SEGGER J-Link (serial number, speed control)
  • Built-in MCP server so AI tools can drive the device console

🛠️ Installation

pip install hardwario

🚀 Quick Start

hardwario --help
Usage: hardwario [OPTIONS] COMMAND [ARGS]...

  HARDWARIO Command Line Tool.

Options:
  --log-level [debug|info|success|warning|error|critical]
                                  Log level to stderr  [default: critical]
  --version                       Show the version and exit.
  --help                          Show this message and exit.

Commands:
  chester  Commands for CHESTER (configurable IoT gateway).
  device   Commands for devices.

🤖 MCP Server (AI Integration)

The device console can expose a built-in Model Context Protocol server, which lets AI tools (Claude, Cursor, etc.) drive the target: send shell commands, read the log, flash firmware, and inspect memory and registers.

The server is off by default. Add --mcp to any console command:

hardwario chester app console --mcp
hardwario device nrf52 console --mcp

It listens on 127.0.0.1:8090 unless --mcp-listen [HOST:]PORT says otherwise.

Claude Code Configuration

Add to your .mcp.json:

{
    "mcpServers": {
        "hardwario-console": {
            "type": "http",
            "url": "http://127.0.0.1:8090/mcp"
        }
    }
}

When the server runs with --mcp-token, add the matching header:

{
    "mcpServers": {
        "hardwario-console": {
            "type": "http",
            "url": "http://127.0.0.1:8090/mcp",
            "headers": {
                "Authorization": "Bearer <TOKEN>"
            }
        }
    }
}

Authentication

The MCP server has no authentication by default and binds to 127.0.0.1, which is fine for local use. Since the tools can flash the device and read or write its memory, set a token whenever the server leaves loopback (e.g. --mcp-listen 0.0.0.0:8090 on a shared debug box):

hardwario device nrf91 console --mcp --mcp-token "$(openssl rand -hex 16)"

Every request must then carry Authorization: Bearer <TOKEN>; anything else gets 401 Unauthorized. Binding off loopback without a token prints a warning. Note the transport is plain HTTP, so on an untrusted network the token is visible on the wire — use an SSH tunnel or a TLS reverse proxy for anything beyond a lab LAN.

Keeping the session alive

Flashing drops the RTT link, which leaves the console dead until it is re-attached. Pair --mcp with --auto-reconnect so the session comes back on its own instead of the AI client having to notice and call reconnect():

hardwario device nrf52 console --mcp --auto-reconnect

Available MCP Tools

Tool Description
send_command(command, timeout) Send a shell command to the device and wait for response
read_terminal(lines) Read recent terminal output (device responses and sent commands)
read_log(lines, after_cursor, pattern) Read log output from the device ring buffer, with optional regex filter
wait_for_state(pattern, timeout, command, ...) Poll the log or terminal until a pattern shows up
wait_for_connection(timeout, source) Block until the RTT link is up
status() Session statistics (line counts, buffer usage, cursors, link state)
flash(file_path, addr) Flash a firmware file (.hex, .bin, .elf, .srec) to the target device
reconnect(address) Re-attach a stuck RTT session without resetting the device
start() / stop() Resume / suspend the RTT readout
jlink_open() / jlink_close() Attach or release the J-Link probe
reset(halt) Reset the target; RTT re-attaches automatically (unless halting)
halt() / go() Stop / resume the target CPU
target_status() CPU halted flag and core identification
read_memory(address, length, width, to_file) Hexdump of RAM, peripherals or memory-mapped flash
write_memory(address, data, width, from_file) Write RAM or peripheral registers
write_flash(address, data, from_file) Program internal flash bytes (reset+halt, program, reboot)
read_registers() Core CPU registers (requires a halted target)
memory_zones() Memory zones supported by the J-Link for the target

License

This project is licensed under the MIT License - see the LICENSE file for details.


Made with ❤  by HARDWARIO a.s. in the heart of Europe.

Metadata

Release files for hardwario 1.7.2

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

Source distribution (sdist)

Source distribution for hardwario 1.7.2
File Size Uploaded
hardwario-1.7.2.tar.gz 31.5 kB Details

Built distribution (wheel)

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

Total release size: 68.7 kB

Release files / hardwario-1.7.2.tar.gz

Download URL hardwario-1.7.2.tar.gz
Size 31.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8e43d3d301d35932b8eb9f1a888ef3ea838aa08808ff630e9d74dc11bbe77e81
BLAKE2b-256 checksum
How to use checksums
c9e2c2f977312b9062fb75de539eefdd4042fe78bbb71517f299b2b29befdd0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 14, 2026.

Transparency log

Release files / hardwario-1.7.2-py3-none-any.whl

Download URL hardwario-1.7.2-py3-none-any.whl
Size 37.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e6c17d0498d4475cf94d600860c93c429306162390080b770fdad8fb761ff7aa
BLAKE2b-256 checksum
How to use checksums
0ff3b7d4939345b77bd86172cd30fed6abddebf40f109cead9ae068864a7079b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.7.2 This release

2 release files

1.7.1

2 release files

1.7.0

2 release files

1.6.6

2 release files

1.6.5

2 release files

1.6.4

2 release files

1.6.3

2 release files

1.6.2

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.0.0

2 release files

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