After writing up multiple instructables on the Particle core, I decided to write up an instructable on how to install and use the Particle CLI. The particle CLI is a command line or terminal application that makes working with your spark core a lot easier. Particle CLI is a node.js application.

Using the particle CLI you can, Claim a core or a photon, flash it and call functions, monitor variables and a lot more.

Here's what particle has to say -

"The Particle CLI is a powerful tool for interacting with your devices and the Particle Cloud. The CLI usesnode.js and can easily 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!".

So lets get started....

Step 1: Node.js

This application is based on node.js and you require npm to install it. You can download node.js form the node.js offical website.

Node.js is available in multiple packages for different OS and choose the package that suites your OS. after installing you should be able to access node.js by typing in "node" in the terminal or command line. This will start a different prompt that looks more like the one python has. You can exit the prompt by clicking ctrl + D.

Step 2: Installing Particle CLI

After installing node.js you should now have npm installed, type in the following commands to install it.

$ npm install -g particle-cli

This would install the particle -cli, this is all that you had to do now you need to login to get connected to particle cloud.

$ particle login

You can update your particle CLI by typing

$ npm update -g particle-cli 

Step 3: Claiming a Core

You can claim a core or a photon using the spark CLI and it is the fastest way to do it.

Connected your core make sure it is blinking blue, and type in the following command in the terminal

$ particle setup

Follow the instructions displayed on the screen, you have to have a WiFi network to connect to while doing this.

Step 4: Flashing Tinker

You can run

$ particle help

to get the various commands related to the CLI.

You can also flash tinker the default application of the core or photon by typing in

$ particle flash my_new_device_name tinker

and to log out of Particle CLI all you have to do is type in

$ particle logout
<p>really helpful. Thanks</p>
<p>When I enter &quot;$ npm install -g particle-cli&quot; I get this:</p><p>SyntaxError: Unexpected identifier<br> at Object.exports.createScript (vm.js:44:10)<br> at REPLServer.defaultEval (repl.js:117:23)<br> at bound (domain.js:254:14)<br> at REPLServer.runBound [as eval] (domain.js:267:12)<br> at REPLServer.&lt;anonymous&gt; (repl.js:279:12)<br> at REPLServer.emit (events.js:107:17)<br> at REPLServer.Interface._onLine (readline.js:214:10)<br> at REPLServer.Interface._line (readline.js:553:8)<br> at REPLServer.Interface._ttyWrite (readline.js:830:14)<br> at ReadStream.onkeypress (readline.js:109:10)</p><p>I installed Node.js and I am running it from a Windows 7 command prompt (after running &quot;node&quot; of course). The Spark Core is in DFU mode (flashing yellow).</p>

About This Instructable




Bio: Hey I'm a College school student, I love to work on projects and Arduino powers most of them. Follow me @ https://www.facebook.com ...
More by ThisIsSteve:Linkit One Text to Speech Linkit One Kitchen Timer Intel Edison Talks to Linkit One 
Add instructable to: