{"id":20931580,"url":"https://github.com/johnwargo/moddable-helper","last_synced_at":"2026-05-12T16:38:21.013Z","repository":{"id":52216224,"uuid":"362942496","full_name":"johnwargo/moddable-helper","owner":"johnwargo","description":"Node-based CLI command helper for the Moddable SDK","archived":false,"fork":false,"pushed_at":"2022-04-03T20:01:26.000Z","size":409,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-31T02:25:32.897Z","etag":null,"topics":["moddable","npm"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johnwargo.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-29T20:42:30.000Z","updated_at":"2022-04-03T20:01:29.000Z","dependencies_parsed_at":"2022-09-08T11:12:10.737Z","dependency_job_id":null,"html_url":"https://github.com/johnwargo/moddable-helper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/johnwargo/moddable-helper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnwargo%2Fmoddable-helper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnwargo%2Fmoddable-helper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnwargo%2Fmoddable-helper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnwargo%2Fmoddable-helper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johnwargo","download_url":"https://codeload.github.com/johnwargo/moddable-helper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnwargo%2Fmoddable-helper/sbom","scorecard":{"id":529231,"data":{"date":"2025-08-11","repo":{"name":"github.com/johnwargo/moddable-helper","commit":"d254661948dc6341df8a9f73f40120d598f5e198"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/johnwargo/moddable-helper/main.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/johnwargo/moddable-helper/main.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/johnwargo/moddable-helper/main.yml/main?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/main.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: license:0","Info: FSF or OSI recognized license: MIT License: license:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}}]},"last_synced_at":"2025-08-20T05:18:29.250Z","repository_id":52216224,"created_at":"2025-08-20T05:18:29.250Z","updated_at":"2025-08-20T05:18:29.250Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32948174,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-12T09:19:52.626Z","status":"ssl_error","status_checked_at":"2026-05-12T09:17:33.438Z","response_time":102,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["moddable","npm"],"created_at":"2024-11-18T21:44:14.145Z","updated_at":"2026-05-12T16:38:21.004Z","avatar_url":"https://github.com/johnwargo.png","language":"JavaScript","funding_links":["https://www.buymeacoffee.com/johnwargo"],"categories":[],"sub_categories":[],"readme":"# Moddable Helper\n\n![Build Status](https://github.com/johnwargo/moddable-helper/actions/workflows/main.yml/badge.svg)\n\n## Introduction\n\nDelivers a command-line interface to simplifying usage of the [Moddable SDK](https://github.com/Moddable-OpenSource/moddable). This repository hosts a node.js module that:\n\n* Delivers a simple set of commands that drive the Moddable SDK, and eliminates some of the repetitive typing required to work with the Moddable SDK command-line tools\n* Uses a project configuration file to configure the settings modules and target devices used by the project\n* Delivers a mechanism that enables developers to more easily wipe devices using the device's native SDK (without having to remember the command every time)\n\nThe module supports the following commands:\n\n* `mddbl init` - Create an empty configuration file in the current folder\n* `mddbl config edit` - Edit the project's configuration file\n* `mddbl config show` - Display the contents of the configuration file\n* `mddbl config sort` - Sort the module and target lists by name\n* `mddbl debug` - Toggle the `debug` setting (true to false, and, of course, false to true) in the project's configuration file\n* `mddbl deploy [module] [target]` - Deploy the selected module (module or host) to the specified target device\n* `mddbl module add \u003cmodule\u003e` - Adds an empty Module entry to the configuration file's `modules` array, then launches the configuration file in the system's default editor.\n* `mddbl module rm \u003cmodule\u003e` - Removes the specified module from the configuration file's `modules` array\n* `mddbl module show \u003cmodule\u003e` - Shows the configuration settings for the specified module\n* `mddbl modules` - Display the list of modules defined in the `modules` section of the configuration file\n* `mddbl target add \u003ctarget\u003e` - Adds an empty Target entry to the configuration file's `targets` array, then launches the configuration file in the system's default editor.\n* `mddbl target rm \u003ctarget\u003e` - Removes the specified target from the configuration file's `targets` array\n* `mddbl target show \u003ctarget\u003e` - Shows the configuration settings for the specified target\n* `mddbl targets` - Display the list of targets defined in the `targets` section of the configuration file\n* `mddbl wipe \u003ctarget\u003e` - Wipe the selected target device\n\n\u003e **Note**: Required parameters are in angled brackets (`\u003c` and `\u003e`) and option parameters are in square brackets (`[` and `]`)\n\nDetailed instructions for these commands sections that follow.\n\n## Installation\n\nTo install the module, open a terminal window (or command prompt on Windows), and execute the following command:\n\n```shell\nnpm install -g moddable-helper\n```\n\nThis installs a `mddbl` command you can use anywhere on the system.\n\n## Issues \u0026 Pull Requests\n\nIf you have an issue with this module, don't email the author, submit an [issue](https://github.com/johnwargo/moddable-helper/issues) in this repository instead.\n\nI built this project for the community, so if you have an enhancement, fix, or change for the project, please submit a [Pull Request](https://github.com/johnwargo/moddable-helper/pulls).\n\n## Background\n\nI've been playing around lately with the Moddable SDK and I think the platform's pretty interesting for a lot of reasons I'll write about later on [my blog](https://johnwargo.com). They deliver several very capable IoT devices with built-in displays at a great price. The real power comes from their SDK which delivers a robust and solid JavaScript API for inexpensive microcontroller devices\n\nOne of the things I noticed when I started working with the Moddable SDK was that I found myself typing the same commands over and over again as I coded projects for the devices. Now, that's not unexpected for command-line based tooling, but when building and deploying for Moddable devices, I kept typing the exact same command-line options over and over again (`-d m -p \u003cdevice\u003e`). I decided to make this helper module to reduce my typing and simplify my work.\n\nLet me show you how this works using a real-world example.\n\nThe folks at Moddable published a book called [IoT Development for ESP32 and ESP8266 with JavaScript](https://github.com/Moddable-OpenSource/iot-product-dev-book) that contains a lot of sample code demonstrating how to use the different APIs in their SDK. Moddable developers often break a project down into multiple parts, a host (the core native application running on the device plus a little JavaScript code to bootstrap the project) plus additional JavaScript modules that run within the host (a dramatic oversimplification, I know, but I'm not here to teach you Moddable development). Developers typically keep their host and module files in different folders within a project folder.\n\n\u003e **Note**: What I show here applies to any Moddable SDK project\n\nUsing the book's Chapter 1 [Hello World](https://github.com/Moddable-OpenSource/iot-product-dev-book/tree/master/ch1-gettingstarted) project as an example, to deploy the host to a Moddable Two device, you will open a terminal window, navigate to the project folder, then execute the following commands:\n\n```shell\ncd host\nmcconfig -d -m -p esp32/moddable_two\n```\n\nNext, to deploy the helloworld module, execute the following commands:\n\n```shell\ncd ../helloworld\nmcrun -d -m -p esp32/moddable_two\n```\n\nAs you can see, I'm switching folders from time to time depending on whether I'm deploying an update to the project's host or an update to the `helloworld` module. I'm also executing two different Moddable SDK commands, each with the exact same command-line parameters. There has to be a better way.\n\nYes, I know I could open two different terminal windows and execute host or module commands in their own terminal - I'm for simplification here, not opening even more windows.\n\nWith this module, you create a configuration file called `mddbl.json` (the module can create it for your automatically using the `mddbl init` command) in the project's root folder, then define all of the options for your project there:\n\n```json\n{\n  \"debug\": true,\n  \"modules\": [\n    {\n      \"name\": \"host\",\n      \"description\": \"The project's host module\",\n      \"isHost\": true,\n      \"debugFlag\": true,\n      \"makeFlag\": true,\n      \"folderPath\": \"host\"\n    },\n    {\n      \"name\": \"hw\",\n      \"description\": \"Text-only version of the project\",\n      \"isHost\": false,\n      \"debugFlag\": true,\n      \"makeFlag\": true,\n      \"folderPath\": \"helloworld\"\n    },\n    {\n      \"name\": \"hwg\",\n      \"description\": \"Hello World Graphical version\",\n      \"isHost\": false,\n      \"debugFlag\": true,\n      \"makeFlag\": true,\n      \"folderPath\": \"helloworld-gui\"\n    }\n  ],\n  \"targets\": [\n    {\n      \"name\": \"mdbl2\",\n      \"description\": \"Moddable Two\",\n      \"platform\": \"esp32/moddable_two\",\n      \"formatFlag\": false,\n      \"formatStr\": \"\",\n      \"rotationFlag\": false,\n      \"rotationValue\": 0,\n      \"wipeCommand\": \"python %IDF_PATH%\\\\components\\\\esptool_py\\\\esptool\\\\esptool.py erase_flash\"\n    },\n    {\n      \"name\": \"m5fire\",\n      \"description\": \"M5Stack Fire device\",\n      \"platform\": \"esp32/m5stack_fire\",\n      \"formatFlag\": true,\n      \"formatStr\": \"gray16\",\n      \"rotationFlag\": false,\n      \"rotationValue\": 0,\n      \"wipeCommand\": \"python %IDF_PATH%\\\\components\\\\esptool_py\\\\esptool\\\\esptool.py erase_flash\"\n    }\n  ]\n}\n```\n\nWith that in place, you can open a terminal window, navigate to your project folder, then deploy the project's host using:\n\n```shell  \nmddbl deploy host mdbl2\n```\n\nThe mddbl module switches to the host module's folder (`host` as specified in the module's `folderPath` property), executes the command to deploy the host (`mcconfig -d -m -p esp32/moddable_two`), then switches back to the starting folder.\n\nNext, to deploy one of the project's modules, `helloworld` for example, simply use the following command:\n\n```shell\nmddbl deploy hw mdbl2\n```\n\nModdable Helper switches to the module's folder (`helloworld` as specified in the module's `folderPath` property), executes the command to deploy the host (`mcrun -d -m -p esp32/moddable_two`), then switches back to the starting folder.\n\n\u003e **Note**: The mddbl module uses the module's `isHost` property to determine whether to execute `mcconfig` or `mcrun` to deploy the module.\n\n## Usage\n\n### Configuration\n\nTo use this module, you must first create the module's configuration file in the Moddable project's root folder. The file must be called `mddbl.json` and the default configuration file contains the following options:\n\n```json\n{\n  \"debug\": false,\n  \"modules\": [],\n  \"targets\": [],\n}\n```\n\n#### Creating the Configuration File\n\nThe module can create it for you automatically, simply open a terminal window, navigate to the project folder, and execute the following command:\n\n```shell\nmddbl init\n```\n\nModdable Helper will create the default configuration file shown above.\n\n#### Configuration Options\n\nThe following sections describe the configuration options for the Moddable Helper module.\n\n##### Debug\n\nIf you're having trouble with the Moddable Helper, you can enable debug mode through the configuration file. In debug mode, the CLI outputs more information to the console as it runs.\n\nTo enable debug mode, set the configuration file's `debug` option to `true` as shown in the following example:\n\n```json\n{\n  \"debug\": true,\n  \"modules\": [],\n  \"targets\": [],\n}\n```\n\nYou can also toggle the `debug` setting using the following command:\n\n```shell\nmddbl debug\n```\n\n##### Modules\n\nUse the `modules` section of the configuration file to configure an array of `module` objects representing each of the JavaScript modules in your Moddable project. The `module` object has the following configuration:\n\n```json\n{\n  \"name\": \"\",\n  \"description\": \"\",\n  \"isHost\": false,\n  \"debugFlag\": true,\n  \"makeFlag\": true,\n  \"folderPath\": \"\",\n}\n```\n\n* `name` - The unique identifier for the module. This is the value you'll use in `mddbl` commands to refer to the module.\n* `description` - A description of the module, not used for anything except to remind you about this module's configuration.\n* `isHost` - Boolean value indicating whether the module is a Host or Module (controls whether Moddable Helper executes `mcconfig` or `mcrun` to deploy the module).\n* `debugFlag` - Enables/disables the `-d` parameter passed to `mcconfig` and `mcrun`; refer to the [Moddable documentation](https://github.com/Moddable-OpenSource/moddable/blob/public/documentation/tools/tools.md#arguments) for details about this parameter.\n* `makeFlag` - Enables/disables the `-m` parameter passed to `mcconfig` and `mcrun`; refer to the [Moddable documentation](https://github.com/Moddable-OpenSource/moddable/blob/public/documentation/tools/tools.md#arguments) for details about this parameter.\n* `folderPath` - The name of the subfolder hosting the module.\n\nThe example configuration file shown above defines three modules:\n\n```json\n\"modules\": [\n  {\n    \"name\": \"host\",\n    \"description\": \"The project's host module\",\n    \"isHost\": true,\n    \"debugFlag\": true,\n    \"makeFlag\": true,\n    \"folderPath\": \"host\"\n  },\n  {\n    \"name\": \"hw\",\n    \"description\": \"Text-only version of the project\",\n    \"isHost\": false,\n    \"debugFlag\": true,\n    \"makeFlag\": true,\n    \"folderPath\": \"helloworld\"\n  },\n  {\n    \"name\": \"hwg\",\n    \"description\": \"Hello World Graphical version\",\n    \"isHost\": false,\n    \"debugFlag\": true,\n    \"makeFlag\": true,\n    \"folderPath\": \"helloworld-gui\"\n  }\n],\n```\n\nThe `host` module refers to the JavaScript Host module code in the project's `host` folder. The `hw` and `hwg` modules refer to JavaScript Modules in the `helloworld` and `helloworld-gui` folders.\n\n##### Targets\n\nUse the `targets` section of the configuration file to configure an array of `target` objects representing each of the Moddable-compatible hardware devices used by your project. The `target` object has the following configuration:\n\n```json\n{\n  \"name\": \"\",\n  \"description\": \"\",\n  \"platform\": \"\",\n  \"wipeCommand\": \"\",\n}\n```\n\n* `name` - The unique identifier for the device. This is the value you'll use in `mddbl` commands to refer to the device; the Moddable SDK uses a full description to refer to a device (`esp32/moddable_two` for example) and this just gives you a shortcut for the full name.\n* `description` - A description of the device, not used for anything except to remind you about this device.\n* `platform` - The full Moddable SDK platform identifier for the device (`esp32/moddable_two` for example).\n* `formatFlag` - Enables/disables the `-f` parameter passed to `mcconfig` and `mcrun`; refer to the [Moddable documentation](https://github.com/Moddable-OpenSource/moddable/blob/public/documentation/tools/tools.md#arguments) for details about this parameter.\n* `formatStr` - With `formatFlag` enabled, specifies the format string passed to the Moddable SDK. Available options are (from the Moddable SDK Docs) `gray16`, `gray256`, `rgb332`, `rgb565be` or `rgb565le`. The Moddable SDK defaults to `rgb565le` if you leave this value empty.\n* `rotationFlag` - Enables/disables the `-r` parameter passed to `mcconfig` and `mcrun`; refer to the [Moddable documentation](https://github.com/Moddable-OpenSource/moddable/blob/public/documentation/tools/tools.md#arguments) for details about this parameter.\n* `rotationValue` - With `rotationFlag` enabled, specifies the screen rotation value. Supported values are `0`, `90`, `180` or `270`. The Moddable SDK defaults to 0, but there's no way to leave this value blank, so you must ensure a valid value is set for this property.\n* `wipeCommand` - The file system command to wipe the device. The command used is specific to the hardware platform, not the Moddable SDK.\n\n\u003e **Note**: On Microsoft Windows, you must double-up file system delimiters; `\"python %IDF_PATH%\\components\\esptool_py\\esptool\\esptool.py erase_flash\"` becomes `\"python %IDF_PATH%\\\\components\\\\esptool_py\\\\esptool\\\\esptool.py erase_flash\"`. JavaScript uses the backslash (`\\`) when escaping other characters in a string, so to include the backslash in a command string, you must escape it with a backslash first. On Linux or macOS, the command string is \"python $IDF_PATH/components/esptool_py/esptool/esptool.py erase_flash\" (no special escaping needed).\n\nThe example configuration file shown above defines two Targets devices:\n\n```json\n\"targets\": [\n  {\n    \"name\": \"mdbl2\",\n    \"description\": \"Moddable Two\",\n    \"platform\": \"esp32/moddable_two\",\n    \"formatFlag\": false,\n    \"formatStr\": \"\",\n    \"rotationFlag\": false,\n    \"rotationValue\": 0,\n    \"wipeCommand\": \"python %IDF_PATH%\\\\components\\\\esptool_py\\\\esptool\\\\esptool.py erase_flash\"\n  },\n  {\n    \"name\": \"m5fire\",\n    \"description\": \"M5Stack Fire device\",\n    \"platform\": \"esp32/m5stack_fire\",\n    \"formatFlag\": true,\n    \"formatStr\": \"gray16\",\n    \"rotationFlag\": false,\n    \"rotationValue\": 0,\n    \"wipeCommand\": \"python %IDF_PATH%\\\\components\\\\esptool_py\\\\esptool\\\\esptool.py erase_flash\"\n  }\n]\n```\n\n\u003e **Note**: The targets use the same wipe command because the devices are both based on the ESP32 hardware platform.\n\n#### Viewing the Configuration File\n\nTo view the contents of the configuration file in the console, execute the following command:\n\n```shell\nmddbl config show\n```\n\n#### Editing the Configuration File\n\nTo launch the module's configuration file using your system's default `.json` file editor, execute the following command:\n\n```shell\nmdbbl config edit\n```\n\n#### Sorting Module and Target Lists\n\nFor users with a bit of obsessive compulsive disorder (OCD), you can sort the Module and Target lists using the following command:\n\n```shell\nmdbbl config sort\n```\n\nYou know, just because.\n\n### Deploy\n\nTo deploy a Host or Module to a connected device, execute the following command in the terminal window pointing to the Moddable project folder:\n\n```shell\nmddbl deploy \u003cmodule\u003e [target]\n```\n\n\u003e **Note**: The `target` parameter is optional. If you omit it, then the Moddable SDK will load the module in the emulator for the operating system running the command (`win` for Windows, `mac` for macOS, etc.).\n\nTo deploy a project's `host` to the `mdbl2` (Moddable Two) defined in our sample config file, use:\n\n```shell\nmddbl deploy host mdbl2\n```\n\nTo deploy the `helloworld` module to the `m5fire` device defined in our sample config file, use:\n\n```shell\nmddbl deploy hw m5fire\n```\n\nTo deploy the 'host' module to the emulator for the current platform, execute the following:\n\n```shell\nmddbl deploy host\n```\n\nYou can also deploy in interactive mode:\n\n```shell\nmddbl deploy\n```\n\nWhen you execute the `deploy` command without specifying a module, Moddable Helper will prompt you to select the Module  from a list of available options (from the project's configuration file):\n\n```text\nModdable Helper (mddbl)\nReading configuration file\n? Module Selection ...\n\u003e host\n  hw\n  hwg\n```\n\nNext, it will prompt you to select a Target from the list of available options:\n\n```text\nModdable Helper (mddbl)\nReading configuration file\n√ Module Selection · host\n? Target Selection ...   \n\u003e m5fire\n  mdbl2\n```\n\nAnd finally, it will trigger deployment using the selected options:\n\n```text\nModdable Helper (mddbl)\nReading configuration file\n√ Module Selection · host\n√ Target Selection · mdbl2      \nDeploying host to mdbl2\n```\n\n### List Modules or Targets\n\nWhen you're getting ready to execute the `deploy` or `wipe` commands, you may forget which module and target options are available to you. You can list the modules or targets defined in the project's configuration file using:\n\n```shell\nmddbl modules\n```\n\nand\n\n```shell\nmddbl targets\n```\n\nFor the configuration file example in this document, the module list output looks the following:\n\n```text\nModdable Helper (mddbl)\nReading configuration file\n\nConfigured Modules:\n- host - The project's host module\n- hw - Text-only version of the project\n- hwg - Hello World Graphical version\n```\n\n### Module Command\n\nThe `mddbl module` command allows you to interact with the `modules` array in the project's configuration file. To add a module entry to the `modules` array, execute the following command:\n\n```shell\nmddbl module add \u003cmodule\u003e\n```\n\nFor example, to add a new module called `test1`, execute the following command:\n\n```shell\nmddbl module add test1\n```\n\nThis will add the following entry to the `modules` array:\n\n```json\n{\n  \"name\": \"test1\",\n  \"description\": \"\",\n  \"isHost\": false,\n  \"debugFlag\": true,\n  \"makeFlag\": true,\n  \"folderPath\": \"\"\n}\n```\n\nNext, the project's configuration file will open in the system's default `.json` file editor so you can populate the module definition with the appropriate settings for your project.\n\nTo remove a specific module from the project's configuration file, execute the following command:\n\n```shell\nmddbl module rm \u003cmodule\u003e\n```\n\nFor example, to remove a module called `dog` from the project's `modules` configuration, execute the following command:\n\n```shell\nmddbl module rm dog\n```\n\nTo display the configuration of a particular module, execute the following command:\n\n```shell\nmddbl module show \u003cmodule\u003e\n```\n\nFor example, to show the configuration for a module called `dog`, execute the following:\n\n```shell\nmddbl module show dog\n```\n\nThe console will display the module's configuration as shown below:\n\n```text\nModdable Helper (mddbl)\nReading configuration file\nConfiguration for the 'dog' Module:\n{\n  name: 'dog',\n  description: 'Dog module',\n  isHost: false,\n  debugFlag: true,\n  makeFlag: true,\n  folderPath: 'doggie'\n}\n```\n\n### Target Command\n\nThe `mddbl target` command allows you to interact with the `targets` array in the project's configuration file. To add a target entry to the `targets` array, execute the following command:\n\n```shell\nmddbl target add \u003ctarget\u003e\n```\n\nFor example, to add a new target called `test2`, execute the following command:\n\n```shell\nmddbl target add test2\n```\n\nThis will add the following entry to the `targets` array:\n\n```json\n{\n  \"name\": \"test2\",\n  \"description\": \"\",\n  \"platform\": \"\",\n  \"formatFlag\": false,\n  \"formatStr\": \"\",\n  \"rotationFlag\": false,\n  \"rotationValue\": 0,\n  \"wipeCommand\": \"\"\n}\n```\n\nNext, the project's configuration file will open in the system's default `.json` file editor so you can populate the target definition with the appropriate settings for your project.\n\nTo remove a specific target from the project's configuration file, execute the following command:\n\n```shell\nmddbl target rm \u003ctarget\u003e\n```\n\nFor example, to remove a target called `dog` from the project's `targets` configuration, execute the following command:\n\n```shell\nmddbl target rm dog\n```\n\nTo display the configuration of a particular target, execute the following command:\n\n```shell\nmddbl target show \u003ctarget\u003e\n```\n\nFor example, to show the configuration for a target called `dog`, execute the following:\n\n```shell\nmddbl target show dog\n```\n\nThe console will display the target's configuration as shown below:\n\n```text\nModdable Helper (mddbl)\nReading configuration file\nConfiguration for the 'dog' Target:\n{\n  \"name\": \"dog\",\n  \"description\": \"Doggie module\",\n  \"platform\": \"esp32\",\n  \"formatFlag\": false,\n  \"formatStr\": \"\",\n  \"rotationFlag\": false,\n  \"rotationValue\": 0,\n  \"wipeCommand\": \"python %IDF_PATH%\\\\components\\\\esptool_py\\\\esptool\\\\esptool.py erase_flash\"\n}\n```\n\n### Wipe Device\n\nWhile troubleshooting deployment or coding issues, you may encounter the need to wipe the device. Most, if not all, hardware platforms Moddable supports offer some mechanism for wiping the memory of the device. Since the device SDK commands needed to do this are obscure and not often executed, the Moddable Helper CLI offers a mechanism for storing the wipe command in the configuration file then invoking it by executing the following command:\n\n```shell\nmddbl wipe \u003ctarget\u003e\n```\n\nFor example, using the sample configuration file example in this document, to wipe the M5Stack Fire device, use the following command:\n\n```shell\nmddbl wipe m5fire\n```\n\n***\n\nYou can find information on many different topics on my [personal blog](http://www.johnwargo.com).\n\nIf you find this code useful and feel like thanking me for providing it, please consider \u003ca href=\"https://www.buymeacoffee.com/johnwargo\" target=\"_blank\"\u003eBuying Me a Coffee\u003c/a\u003e, or making a purchase from [my Amazon Wish List](https://amzn.com/w/1WI6AAUKPT5P9).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnwargo%2Fmoddable-helper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnwargo%2Fmoddable-helper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnwargo%2Fmoddable-helper/lists"}