droidnet-command-library
A small, dependency-free engine + visual composer for building serial commands to control a vibrant community of Astromech droid components from structured, schema-driven definitions. Anyone can add support for their board by editing a JSON library — no code changes required for the common case.
This is a standalone project in the DroidNet universe — not part of any one product. DroidNet Signal Booster is one consumer (it powers the Signal Booster's visual WCB command builder), but the library is independent and meant to be used by any app or droid, with the community growing a shared catalog of boards.
- Open the Command Composer → — build a serial command string in your browser, drag steps to reorder, and copy it straight into your WCB config or serial monitor.
- Browse the Board Reference → — search every board and command in the catalog, with copy-ready examples.
Both run entirely in the browser off this repo — nothing to install.
Board library (JSON) droidnet-command-library droidnet-command-library-ui
───────────────────── ─────────────────── ──────────────────
components / commands ──load──▶ encode / parse / match ──▶ inline step composer
enums / templates round-trip wire strings (drag-reorder, no modal)
Most "command builders" hard-code every board's grammar in the app. This one moves the grammar into data: a per-board JSON file describes each board's commands as templates with typed parameters, and the engine turns structured steps into wire strings (and back). Adding a board is a pull request against a JSON file that CI validates — not a code change.
<script src="src/droidnet-command-library.js"></script>
<script src="src/droidnet-command-library-ui.js"></script>
<script>
const base = 'libraries/';
fetch(base + 'manifest.json')
.then(r => r.json())
.then(m => Promise.all(m.boards.map(b => fetch(base + b.file).then(r => r.json())))
.then(boards => {
DroidNetCommandLibrary.loadLibrary(boards, { libraryVersion: m.libraryVersion });
DroidNetCommandLibraryUI.renderComposer(
document.getElementById('host'),
'A006^*** Flthy Rainbow',
{ onChange: (wire) => console.log(wire) }
);
}));
</script>const DroidNetCommandLibrary = require('droidnet-command-library');
require('droidnet-command-library/node-loader').loadCatalog(); // reads manifest + boards, merges, loads
const solid = DroidNetCommandLibrary.getCommand('flthy.led.solid');
DroidNetCommandLibrary.encode(solid, { designator: 'A', color: '5' }, {}); // 'A0055'
DroidNetCommandLibrary.match('A0055'); // { commandId: 'flthy.led.solid', params: {...} }See docs/INTEGRATION_GUIDE.md for the full API.
A ready-to-use visual composer and board reference are served straight from this repo via GitHub Pages:
- Composer — https://travisccook.github.io/Droidnet-Command-Library/index.html
- Board reference — https://travisccook.github.io/Droidnet-Command-Library/reference.html
Build a sequence of steps, copy the resulting serial string, and paste it into
your WCB web config or a serial monitor. The pages load the engine and the
libraries/ catalog directly, so a merged board JSON shows up on the site with
no separate deploy.
Pages setup (maintainers): already enabled — Deploy from a branch →
main → / (root). The site is static (no build); a .nojekyll file keeps
Pages from processing files.
Edit or add a board file under libraries/boards/<id>.json (and list it in libraries/manifest.json), then validate:
npm install
npm run validate # schema + cross-reference checks
npm test # round-trip + encode/decode testsThe full walkthrough — schema, a worked example, and custom encoders — is in docs/BOARD_AUTHORING_GUIDE.md. See CONTRIBUTING.md for the PR process.
| Path | What |
|---|---|
src/droidnet-command-library.js |
The engine (pure, no DOM). window.DroidNetCommandLibrary / CommonJS. |
src/droidnet-command-library-ui.js |
The inline visual composer. window.DroidNetCommandLibraryUI. |
schema/library.schema.json |
The formal JSON Schema for a board library. |
scripts/validate.js |
npm run validate — structural + semantic validation. |
libraries/manifest.json |
Catalog entry point — ordered board list + catalog libraryVersion. |
libraries/boards/ |
One self-contained file per board. Add yours here and list it in the manifest. |
src/load-node.js |
Node helper: read the manifest + boards and merge them (node-loader export). |
releases.json |
Update manifest consumed by host apps' "Update Library" flows. |
docs/ |
Integration guide + board authoring guide. |
The catalog's semver libraryVersion lives in libraries/manifest.json. Host applications compare it
against releases.json to offer one-click library updates without shipping a full
application update. Bump it on every catalog change (see the authoring guide).
MPL-2.0. You can use this commercially and link it from closed code; improvements to the library's own files stay open. Contributed board definitions are licensed under the same terms.