Build API Tools

Hey friends!

I’ve been working on a suite of tools that leverage the new Build API - these are intended to help you develope Electric Imp code outside of our browser based IDE.

imp-api - This is an npm package that wraps the Build API. If you’re looking at developing your own Node based tools, this is a quick and easy way to get started!!

imp-cli - This is a command line tool that lets you do everything from create and manage models, stream device logs, deploy code, and even transfer code between accounts. If your typical development flow involves the command line, this is an easy way to extend it to Electric Imp :slight_smile:

imp-githooks - I just “finished” writing the initial version of this today. It’s a really simple web server that you can use with GitHub’s webhooks to push code to your devices each time you commit code to a master branch of a public repository. There’s a lot more work that needs to be done on this project, but it’s a proof of concept, and it is working in it’s current state :slight_smile:

None of these are officially supported by Electric Imp, however they are all open source, and I would absolutely love it if people from our community submitted bugs, feature requests, pull requests, and generally helped build these projects into the tools you want and need :slight_smile:

Enjoy!

I like tools, but I’m not really a software tool builder myself. I’m curious if anyone has done anything to make the Atom editor work well with Squirrel or Build API.

Ditto. Sometimes the simpler the IDE the better for me, so would the build API tools work with say notepad++ for example. If so, what’s involved to create the new squirrel language files for notepad++ and all the rest, or are these api tools more for ide’s such as Eclipse (via githooks for example).

@Swieter - I’m not aware of any Atom integrations at this point in time.

@gerriko - The cli and githooks projects are designed to work in parallel with whatever tools you want.

A typical flow using the CLI looks like this:

  • Write some code in the IDE of your choice (nodepad++, Eclipse, etc)
  • When you’re ready to test, save the file and run “imp deploy” from the command line (this pushes the code to the Electric Imp servers, and restarts all the devices in the model).
  • Run “imp logs -d deviceId” to view the logs of the device you’re testing

A typical flow using the githooks project looks like this:

  • Write some code in the IDE of your choice
  • When you’re ready to test, save the files, commit them to your GitHub repo, and push the the code. When the code gets to GitHub, the githook will be fired, and your code will start running on the device.
  • Run “imp logs -d deviceId” (with the CLI) to view the logs of the device you’re testing.

I’m not certain what’s involved with creating new language files in notepad++… we recently created a new language file (a lexer) for the online IDE - which is essentially a large collection of regular expressions.

The Build API is not limited to a specific set of IDEs - it’s purpose is to enable developers to create whatever new tools they want and need… whether it’s extensions for existing IDEs like Atom or notepad++, integrations with services like GitHub or TravisCI, or brand new tools like Squinter and the imp-cli.

+1 for Atom integration.

As soon as I have some spare time (not exactly sure when that will be) I’m looking at attempting this myself. It looks like spark-dev and tool-bar might be a good source of inspiration…