{"id":18498692,"url":"https://github.com/thingssdk/thingssdk-cli","last_synced_at":"2025-04-09T00:31:22.546Z","repository":{"id":81549258,"uuid":"62967295","full_name":"thingsSDK/thingssdk-cli","owner":"thingsSDK","description":"Generator for JavaScript microcontroller projects","archived":false,"fork":false,"pushed_at":"2020-09-06T08:45:19.000Z","size":138,"stargazers_count":39,"open_issues_count":9,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-02T03:15:00.242Z","etag":null,"topics":[],"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/thingsSDK.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-09T20:12:56.000Z","updated_at":"2022-07-17T13:57:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"934cfa3f-dc7b-49fe-9f9d-61e06efe0c8a","html_url":"https://github.com/thingsSDK/thingssdk-cli","commit_stats":{"total_commits":106,"total_committers":10,"mean_commits":10.6,"dds":0.3679245283018868,"last_synced_commit":"6bb9b0fe7840642ba7179adb4044ef00707d4645"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thingsSDK%2Fthingssdk-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thingsSDK%2Fthingssdk-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thingsSDK%2Fthingssdk-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thingsSDK%2Fthingssdk-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thingsSDK","download_url":"https://codeload.github.com/thingsSDK/thingssdk-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247949914,"owners_count":21023412,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-06T13:42:09.901Z","updated_at":"2025-04-09T00:31:22.539Z","avatar_url":"https://github.com/thingsSDK.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# thingsSDK CLI\n\n[![Build Status](https://travis-ci.org/thingsSDK/thingssdk-cli.svg?branch=master)](https://travis-ci.org/thingsSDK/thingssdk-cli) \n[![codecov](https://codecov.io/gh/thingsSDK/thingssdk-cli/branch/master/graph/badge.svg)](https://codecov.io/gh/thingsSDK/thingssdk-cli)\n[![Dependency Status](https://david-dm.org/thingssdk/thingssdk-cli.svg)](https://david-dm.org/thingssdk/thingssdk-cli)\n[![devDependency Status](https://david-dm.org/thingssdk/thingssdk-cli/dev-status.svg)](https://david-dm.org/thingssdk/thingssdk-cli#info=devDependencies)\n\nthingsSDK CLI is a command line utility for generating and managing modern projects for JavaScript microcontroller runtimes.\n\nInitial support is for Espruino with hopes to support others like Kinoma in the future.\n\n## Install CLI\n\n```bash\n$ npm install thingssdk-cli -g\n```\n\nNote that this project uses [serialport](https://github.com/EmergingTechnologyAdvisors/node-serialport), which compiles to binary. You might need to install some prerequesites depending on your operating system.\n\n## Prerequisites\nMake sure prior to trying to push a project to your device, you flash the device with the Espruino Runtime with [Flasher.js](https://github.com/thingsSDK/flasher.js/releases).\n\n## Usage\n\nPlug your device in first and make sure you have the necessary drivers installed.\n\n### New Project\n\nNext to create a new project use the `new` command like so:\n\n```bash\n$ thingssdk new path/to/project_name\n```\n\nYou'll be prompted to enter plug your device in if you haven't already and then select the device's serial port and baud rate.\n\nIf you know your device's port and baud rate already, use the `port` and `baud_rate` options:\n\n```bash\n$ thingssdk new path/to/project_name --port=COM3 --baud_rate=115200\n```\n\n### Getting Started with Your New Project\n\nYour new project will now be found at `path/to/project_name`. You'll need to then install the dependencies.\n\n```bash\n$ npm install\n```\n\n`dependencies` in the new project `package.json` should be deployed to the device, `devDependancies` are what are used for your development workflow.\n\nA `devices.json` file is created in the root of your new project. An entry is placed in your `.gitignore` because serial ports from computer to computer and developer to developer will differ.\n\n### Deploying it to Your Device\n\nTo run the \"Hello, world\" sample project to your device(s) run the npm script `dev`.\n\n```bash\n$ npm run dev\n```\n\nAn interactive REPL will launch and you can interact with your code and debug your program. Once you're happy you can use `delpoy` to upload and __save__ your code to the device.\n\n```bash\n$ npm run deploy\n```\n\nThe \"Hello, world\" script can be found in `main.js`. This script gets uploaded to your device and blinks the blue LED on the `ESP8266` board. It uses the `devices.json` file to know which devices to deploy the code to.\n\nYour JavaScript program must implement a `main` function in order to be ran when the board is initialized.\n\n### Creating a `devices.json` file\n\nTo overwrite the current devices.json or create a new devices.json file in your project directory run the following command for an interactive prompt:\n\n```bash \n$ thingssdk devices\n```\n\nOr with the flags `port` and `baud_rate` if you know them already.\n\n```\n$ thingssdk devices --port=COM3 --baud_rate=115200\n```\n\nThis will generate a `devices.json` like this:\n\n```javascript\n{\n  \"devices\": {\n    \"COM3\": {\n      \"baud_rate\": 115200,\n      \"runtime\": \"espruino\"\n    }\n  }\n}\n```\n\n### Warning for Unix users: ~/\nDue to cross-platform compatibility issues, `~` does not resolve to your home directory on Unix systems. For example, suppose:\n\n```bash\n$ pwd\n/home/\u003cyour user name\u003e/some/subdirectory\n```\n\nRunning\n```bash\n$ thingssdk new ~/path/to/project_name\n```\n\nWould produce the following result:\n\n```bash\n$ ls ~/path/to/project_name\nls: cannot access '/home/\u003cyour user name\u003e/path/to/project_name': No such file or directory\n\n$ ls ~/some/subdirectory/~/path/to/project_name\nmain.js package.json scripts\n```\n\nThis is probably not your intended behavior! So `thingssdk` throws an Error for paths beginning with `~`, and a warning for paths containing `~` elsewhere.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthingssdk%2Fthingssdk-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthingssdk%2Fthingssdk-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthingssdk%2Fthingssdk-cli/lists"}