Metadata-Version: 2.4
Name: ttypal-ai
Version: 0.4.2
Summary: Serial port debug tool for humans and AI agents
License: MIT
Keywords: serial,uart,debug,embedded,AI,automation
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: System :: Hardware
Classifier: Topic :: Software Development :: Embedded Systems
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pyserial>=3.5
Requires-Dist: tomli-w>=1.0
Requires-Dist: tomli>=2.0; python_version < "3.11"
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Dynamic: license-file

# 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
- Claude Code skill for AI-driven serial debugging

## Install

```bash
pip install ttypal-ai
```

Platform-specific setup:

- [Linux](docs/linux.md) — 原生支持，需配置串口权限
- [macOS](docs/macos.md) — 原生支持，即插即用（未测试）
- [Windows](docs/windows-wsl.md) — 通过 WSL2 + usbipd-win 运行（未测试）

## Quick Start

```bash
# 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
```

## Macros

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

```toml
[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.

## Claude Code Integration

Clone this repo and open it with Claude Code — the `/ttypal` skill loads automatically from `.claude/skills/`.

```bash
cd /path/to/ttypal-ai
claude
# Then use /ttypal skill or just ask AI to operate the serial port
```

## License

MIT
