Skip to main content

ttypal

Serial port debug tool designed for both humans and AI agents.

Features

  • Interactive terminal (like minicom, but better)
  • Auto-logging with timestamps and rotation
  • External command injection via Unix socket (for AI/scripts)
  • ZMODEM file transfer over serial
  • Record/replay serial sessions
  • Macro recording and playback (F1-F12 hotkeys)
  • Board config management
  • AI agent skill for serial debugging

Install

pip install ttypal-ai

Platform-specific setup:

  • Linux - Native support; serial port permissions required
  • macOS - Native plug-and-play support (untested)
  • Windows - Run through WSL2 + usbipd-win (untested)

Quick Start

# Interactive mode
ttypal

# Headless daemon (for AI automation)
ttypal-daemon start -b myboard

# Send commands from another process
ttypal-send --wait "# " "uname -a"

# Read recent serial output
ttypal-tail -n 50

Python API

Use TtypalClient from Python tests and automation code to talk to a running ttypal-daemon without spawning ttypal-send for every operation.

from ttypal.client import TtypalClient, TtypalTimeoutError

serial = TtypalClient(session="myboard")

try:
    output = serial.send_wait("uname -a", prompt="# ", timeout=30)
except TtypalTimeoutError as exc:
    print(f"timed out via {exc.socket_path}: {exc.output}")
else:
    print(output)

Stable first-version methods:

Method Purpose
send(command) Send a command without waiting for output
send_wait(command, prompt="# ", timeout=None) Send a command and return output collected until prompt
expect_send(expect, command, timeout=None) Wait for text, then send a command
expect_send_wait(expect, command, prompt="# ", timeout=None) Wait for text, send a command, then wait for prompt
probe(timeout=2.0) Send Enter and return the current console response
request(payload, operation_timeout=None, io_timeout=None) Send a raw daemon protocol request

Macros

Bind command sequences to F1-F12 keys in your board config:

[macro]
F1 = ["echo hello", "sleep 0.5", "ls -la"]
F2 = ["reboot"]

Or record interactively: Ctrl-T r to start, Ctrl-T s to stop and save.

AI Agent Integration

Clone this repo and point your agent runtime at the reusable skill in .agents/skills/ttypal/.

cd /path/to/ttypal-ai
# Then ask your AI agent to operate the serial port with ttypal

License

MIT

Metadata

Release files for ttypal-ai 0.9.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 ttypal-ai 0.9.2
File Size Uploaded Provenance Actions
ttypal_ai-0.9.2.tar.gz 45.4 kB Without provenance Details for ttypal_ai-0.9.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ttypal-ai 0.9.2
File Interpreter ABI Platform Actions
ttypal_ai-0.9.2-py3-none-any.whl Python 3 none any Details for ttypal_ai-0.9.2-py3-none-any.whl

Total release size: 80.3 kB

Release files / ttypal_ai-0.9.2.tar.gz

Download URL ttypal_ai-0.9.2.tar.gz
Size 45.4 kB
Tags Source
SHA-256 checksum
How to use checksums
363f2765914091aae32923de2a8316acdc91be203c22c2821078527916a8a3b1
BLAKE2b-256 checksum
How to use checksums
b98cce7b3e1bec5c53edba6ba71dc6de8ee84292930eedcf8e46a1fa48271467
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / ttypal_ai-0.9.2-py3-none-any.whl

Download URL ttypal_ai-0.9.2-py3-none-any.whl
Size 34.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
01883c519a579249868e7cba59bb857e9f955a1b200676520b81e17333c9867c
BLAKE2b-256 checksum
How to use checksums
9768a17690d9ad15292deed98e3b60da9783bda15bdd629a51d1e3c317097162
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Security for ttypal-ai 0.9.2

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.

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