particle
Manage Particle IoT devices and cloud services
TLDR
Log in or create an account for the Particle CLI
Display a list of devices
Create a new Particle project interactively
Compile a Particle project
Update a device to use a specific app remotely
Update a device to use the latest firmware via serial
Execute a function on a device
SYNOPSIS
particle [<global_options>] <command> [<command_options>] [<arguments>]
This general syntax indicates that the `particle` command usually requires a specific `command` (subcommand) to perform an action. Global options modify the overall behavior of the CLI, while command-specific options and arguments are passed to the chosen subcommand.
PARAMETERS
--version, -v
Display the installed Particle CLI version.
--help, -h
Show general help, or help for a specific command (e.g., `particle help flash`).
--api <url>
Specify a custom Particle API URL to interact with (e.g., for local development servers).
--access_token <token>
Use a specific access token for authentication instead of the logged-in user's token.
--proxy <url>
Specify a proxy server to use for all network requests made by the CLI.
--json
Output command results in JSON format, useful for scripting and automation.
--verbose
Enable verbose output for more detailed information during command execution.
DESCRIPTION
The `particle` command-line interface (CLI) is a powerful, cross-platform tool designed to interact with Particle IoT hardware and the Particle Cloud ecosystem. It serves as an essential utility for developers, enabling them to seamlessly manage their Particle devices, including flashing firmware over USB or wirelessly (OTA), compiling code locally or via the Particle Cloud, and interacting with cloud functions and variables exposed by their devices. The CLI provides a comprehensive suite of commands for device setup, debugging, accessing device logs, managing private keys, configuring webhooks, and integrating with community or custom libraries. It streamlines the development workflow for anyone working with Particle Photon, Electron, Argon, Boron, or Xenon devices, offering both high-level control and granular interaction with the platform.
CAVEATS
The `particle` command is not a standard Linux utility included with most distributions; it must be installed separately, typically via `npm` (Node.js package manager). It requires the Node.js runtime environment to be installed on the system. Many operations rely heavily on connectivity to the Particle Cloud (e.g., cloud compilation, OTA flashing, device listing). Some direct device interactions (e.g., serial communication, USB flashing) may require appropriate USB drivers and permissions.
INSTALLATION
The `particle` CLI is typically installed using Node.js's package manager, `npm`. Ensure Node.js and `npm` are installed on your system, then open a terminal and run:npm install -g particle-cli
This command installs the CLI globally, making the `particle` command available from any directory.
KEY SUBCOMMANDS
The `particle` command works with various subcommands, each performing specific tasks. Some frequently used subcommands include:
- `particle login`: Authenticate with the Particle Cloud using your account credentials.
- `particle compile <platform> <source>`: Compile firmware code either locally (if supported tools are installed) or in the Particle Cloud.
- `particle flash <device> <firmware>`: Flash firmware to a specific device, either wirelessly (Over-the-Air) or via USB.
- `particle serial monitor`: Open a serial monitor connection to a connected Particle device for debugging and logging.
- `particle device list`: List all Particle devices associated with your account.
- `particle function call <device> <function> [args]`: Call a specific cloud function exposed by a running device.
- `particle variable get <device> <variable>`: Read the current value of a cloud variable from a device.
- `particle doctor`: Runs a diagnostic check on your development environment to identify common issues.
HISTORY
The `particle` CLI originated from the `spark-cli` tool, developed by Particle (formerly Spark). It was created to provide developers with a robust command-line interface to interact with their early IoT devices like the Spark Core and later the Photon. As Particle's ecosystem grew to include more sophisticated hardware (Electron, Argon, Boron, Xenon) and cloud services, the CLI evolved significantly. Its development is closely tied to the Particle platform's growth, offering functionalities for managing device firmware, keys, integrations, and cloud resources, making it an indispensable tool for Particle developers.