Skill Development

cardputer-buddy

A Claude Code skill for iterating on the Cardputer-Adv MicroPython app bundle (Claude Buddy, Snake, Hello) once the device has been provisioned via m5-onboard. It covers adding new apps, pushing individual changed files without re-flashing, tailing serial logs, and running one-shot REPL commands.

  • 37.6k GitHub stars
cardputer-buddy — illustration

What it is

Cardputer Buddy is a skill for follow-up development on a Cardputer-Adv device that has already been provisioned with m5-onboard. It works inside a local clone of build-with-claude. The buddy/ directory in that clone is the MicroPython payload that m5-onboard installs onto the device's /flash/ filesystem. The skill triggers on phrases such as "add an app", "push to the cardputer", "tail the device" and "run on the device", and on follow-up work after /maker-setup. On the device, /flash/main.py is a launcher menu that replaces UIFlow's boot flow. Shared libraries live in buddy_*.py files, which cover BLE, UI, state, protocol and chars. Sprite frames are in burst_frames.py. Apps live under /flash/apps/: - claude_buddy.py, a BLE client for Claude Desktop's Hardware Buddy - hello_cardputer.py - snake.py At boot, main.py scans /flash/apps/ and lists every .py file as a menu entry. To add an app, you drop a file into buddy/device/apps/ and push it. It then appears in the menu on the next boot. For new apps, the skill recommends starting from buddy/device/apps/hello_cardputer.py. It is the smallest example of keyboard polling, font use and exit conventions. Apps are pushed with onboard/scripts/install_apps.py, so no re-flash is needed. The dev loop scripts in buddy/scripts/ let you: - push a subset of files over USB-serial (push.py) - watch device logs (tail_serial.py) - run a one-shot REPL command (repl_run.py)

Who it's for

  • Makers with an M5 Cardputer-Adv already provisioned via m5-onboard
  • Developers writing or modifying MicroPython apps for the Cardputer Buddy bundle
  • Users continuing work after running /maker-setup

Requirements

Requirements

  • A Cardputer-Adv device already provisioned via m5-onboard
  • A local clone of the build-with-claude repository (work happens inside it)
  • Python 3 to run the onboard and buddy scripts
  • USB-serial connection to the device and its port, as reported by detect.py (e.g. /dev/cu.usbmodem1101, /dev/ttyACM0, COM3)

Setup

  1. Push the app bundle without re-flashing

    After adding or editing an app in buddy/device/apps/, push the bundle to the device. Replace <PORT> with the port detect.py reported on its last run.

    bash
    python3 onboard/scripts/install_apps.py --port <PORT> --src buddy

سكيل لـ Claude Code بتساعدك تشتغل على تطبيقات MicroPython على جهاز Cardputer-Adv (Claude Buddy وSnake وHello) بعد ما يكون الجهاز متجهّز بـ m5-onboard. فيك تضيف تطبيق جديد، أو تبعت ملف .py واحد بدون ما تعيد الفلاش، أو تراقب لوقات الجهاز، أو تشغّل أمر REPL لمرة وحدة.

Examples

Push a single changed file

bash
bash
# Push a subset of files over USB-serial
python3 buddy/scripts/push.py --port <PORT> --files apps/snake.py

What it does: Sends only the specified file(s) to the device over USB-serial, here the Snake app.

Watch device logs

bash
bash
# Watch device logs
python3 buddy/scripts/tail_serial.py --port <PORT>

What it does: Tails the device's serial output so you can watch logs while the app runs.

One-shot REPL exec

bash
bash
# One-shot REPL exec
python3 buddy/scripts/repl_run.py --port <PORT> --script "import os; print(os.listdir('/flash'))"

What it does: Runs a single Python snippet on the device REPL. This example lists the contents of /flash.

Install apps from the buddy source

bash
bash
python3 onboard/scripts/install_apps.py --port <PORT> --src buddy

What it does: Pushes the buddy app bundle to the device without re-flashing, so newly added apps appear in the menu on next boot.