particle-iot/particle-cli(新しいタブで開きます)
主要言語: JavaScript
Command Line Interface for Particle Cloud and devices
- star 数
- 220
- watcher 数
- 49
- fork 数
- 93
- issue 数
- 38
- 最終更新
- 2026/10/30
主要言語: JavaScript
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!
For end-users, the most up-to-date installation instructions can be found here: macOS / Linux | Windows
Note: Some commands may require openssl to be installed on your system.
You can install it using your package manager (e.g. brew install openssl on macOS).
Before proceeding with this section, remember that the staging version may contain bugs and issues that are not present in the production version.
Please use the staging versions only for testing purposes.
In case you're running macOS or Linux, you can install a staging version of the CLI by running the following command:
MANIFEST_HOST=binaries.staging.particle.io bash <(curl -sL https://particle.io/install-cli)For Windows, you can install a staging version of the CLI by downloading the installer from here.
In case you have already installed the CLI, you can update it to the staging version by running the following command:
export PARTICLE_MANIFEST_HOST=binaries.staging.particle.io
particle update-cli --version {STAGING_VERSION_TO_TEST}Don't forget to turn off the updates to prevent issues while you're testing the staging version:
particle update-cli --disable-updates
Once you're done testing the staging version, you can revert to the production version by running the following command:
export PARTICLE_MANIFEST_HOST=binaries.particle.io
particle update-cli --enable-updates
particle update-cli --version {PRODUCTION_VERSION}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 Device OS on your device to a later version, you can use the particle update command.
You can specify a version with the --target argument.
particle update.particle compile and particle flash build your project in the cloud by default. Pass
--compiler local to build on your own machine with the same toolchain Particle Workbench
uses: the Device OS source, the gcc-arm cross compiler, buildtools and the build scripts.
$ particle compile argon my-project --compiler local $ particle flash --local --compiler local $ particle flash my-device my-project --compiler local
~/.particle/toolchains, the directory Workbench uses, so
anything Workbench already installed is reused and nothing is downloaded twice. The first
local compile on a machine without Workbench downloads about 1 GB for one Device OS version;
the CLI prints what it fetches and shows a progress bar.--target <version> picks the Device OS version to build against, resolved from the public
toolchain manifest. Without it the CLI uses the default version for the platform and prints it.
On flash --local the same version is flashed to the device.dependencies.* in project.properties are copied into lib/ the first
time, which does need a login (particle login).<project>/target/<version>/<platform>/, .ino files are preprocessed next to their
sources, and particle.include / particle.ignore are not applied.For the full list of commands, please see the CLI command reference.
Currently development is supported on macOS only!
node@16.x and npm@8.x are required]$ git clone git@github.com:particle-iot/particle-cli.git && cd ./particle-cliopenssl (e.g. brew install openssl)$ npm install$ npm run$ npm test$ npm startWhen developing, run individual commands using:
$ npm start -- <command> <options> - e.g. $ npm start -- library view dotstar --readme
Anything after the -- delimiter is passed directly to the CLI (docs).
To test the source as it will be published:
particle command globally: $ 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 terminalnpm run test:ci - run all tests excluding device-dependent end-to-end test as CI doesnpm run test:unit - run unit testsnpm run test:integration - run integration testsnpm run coverage - report code coverage statsAll tests use mocha, chai, and sinon with coverage handled by nyc.
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.
particle-cli-setup.exe (This is an NSIS installer for Windows).
You can see the installer script here ParticleCLISetup.nsiinstall-cli (This is a shell script that installs the CLI on Unix systems).
You can see the installer script here install-cli.shSee RELEASE.md.