Command Line Interface for Particle Cloud and devices
Particle's full-stack Internet of Things (IoT) device platform gives you everything you need to securely and reliably connect your IoT devices to the web. For more details please visit www.particle.io.
The Particle CLI is a powerful tool for interacting with your IoT devices and the Particle Cloud. The CLI uses node.js and can run on Windows, Mac OS X, and Linux. It's also open source so you can edit and change it, and even send in your changes as pull requests if you want to share!
Note: On some platforms (e.g.
arm), additional manual steps are required:
node-serialport. On some environments (ie: Raspberry Pi and Apple M1),node-serialportdoes not provide prebuild environments, so their npm install script relies on creating a prebuild using node-gyp (See node-gyp requirements), and libudev (See node-usb installation. And these must be installed in order for their npm install script to succeed. As well, particle-cli uses dfu-util and openssl.
As an example, to install these dependencies on Raspbian/Debian/Ubuntu:bash sudo apt update && sudo apt upgrade sudo apt install build-essential libudev-dev python3 dfu-util openssl
These next two commands are all you need to get started setting up an account, claiming a device, and discovering new features.
Guides you through creating a new account, and claiming your device!
$ particle setup
Shows you what commands are available, and how to use them. You can also give the name of a command for detailed help.
$ particle help $ particle help keys
If you wish to easily update the system firmware running on your device to a later version, you can use the
particle updatecommand. For the exact version it will update to, check the version of the files in the updates folder.
For the full list of commands, please see the CLI command reference.
Currently development is supported on macOS only!
$ git clone [email protected]:particle-iot/particle-cli.git && cd ./particle-cli
brew install openssl)
$ npm install
$ npm run
$ npm test
$ npm start
To ensure compatibility with a wide range of NodeJS versions, the CLI's source is transpiled using Babel.
When developing, run individual commands using:
$ npm start --- e.g.
$ npm start -- library view dotstar --readme
Anything after the
--delimiter is passed directly to the CLI (docs), source code is transpiled on-demand.
To test the transpiled source as it will be published:
$ npm run compile
$ npm link
$ particle --help(using standard argument formatting)
The Particle CLI has a number of automated test suites and related commands. The most important are:
npm test- run all tests (NOTE: End-To-End tests require additional setup)
npm run lint- run the linter and print any errors to your terminal
npm run test:ci- run all tests excluding device-dependent end-to-end test as CI does
npm run test:unit- run unit tests
npm run test:integration- run integration tests
npm run coverage- report code coverage stats
We recommend running locally if you can as it greatly shortens your feedback loop. However, CI also runs against every PR and error reporting is publicly available.
npm run update-firmware-binarieswhere is the newly released system firmware version like 0.7.0
Test on each platform by doing
# Check old firmware version bin/particle.js serial inspect
Flash new system firmware
Verify new firmware version
bin/particle.js serial inspect