Skip to content

feat(tools): add a command-line flasher sharing one protocol module with the web installer - #11

Merged
isod89 merged 2 commits into
isod89:mainfrom
VinSpee:fm/openpocket-upstream-cli-flasher
Nov 8, 2026
Merged

isod89 merged 2 commits into
isod89:mainfrom
VinSpee:fm/openpocket-upstream-cli-flasher

Conversation

@VinSpee

@VinSpee VinSpee commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

This adds a command-line flasher, node tools/op.mjs flash, so a built package can be installed on a connected pedal without a browser. It refuses to send any MIDI unless --confirm-flash is given, checks the package size, hash and model against the manifest first, and refuses when no pedal or more than one pedal is found. A failed update exits with an error and points to the SD-card recovery.

The update protocol now lives in one shared module, docs/pxpkg.js, that takes a small send and receive transport. The browser installer uses it with Web MIDI, and the command line uses it with a Node MIDI transport (tools/midi-node.mjs), so there is a single implementation. The installer's behaviour is unchanged and its existing tests pass unchanged. The new openpocket-flash skill documents the safety rules.

New host tests (tests/test_flash.mjs, with a simulated pedal in tests/simpedal.mjs) cover dry runs, a real update, and each refusal. The flasher was also proven on a real pedal.

…ash skill

The flasher reuses docs/pxota.js and docs/pxpkg.js, the modules the installer page runs.
It requires --confirm-flash for any write, supports --dry-run, checks the package
against the manifest SHA-256, refuses the wrong model, verifies the version the pedal
reports, and prints the SD-card recovery pointer on failure. Tested against the
simulated pedal.
@isod89
isod89 merged commit b003d65 into isod89:main Nov 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants