GithubHelp home page GithubHelp logo

ardunno-cli's Introduction

ardunno-cli

nice-grpc API for the Arduino CLI.

The CLI API code in this repository is generated from the .proto files of the Arduino CLI. The API is compatible with Arduino CLI v0.35.0-rc.2. This project uses ardunno-cli-gen for the API generation.

Installing

npm i ardunno-cli --save

Usage

TypeScript:

import { createChannel, createClient } from 'nice-grpc';
import { ArduinoCoreServiceDefinition } from 'ardunno-cli';

JavaScript:

const { createChannel, createClient } = require('nice-grpc');
const { ArduinoCoreServiceDefinition } = require('ardunno-cli');

Create a gRPC client:

Requires a running Arduino CLI daemon to connect to.

% ./arduino-cli daemon --port 50051 --format json
{
  "IP": "127.0.0.1",
  "Port": "50051"
}
const channel = createChannel('localhost:50051');
const client = createClient(ArduinoCoreServiceDefinition, channel);

Create:

Creates a new Arduino Core instance.

const { instance } = await client.create({});

Initialize:

Initializes an existing Arduino Core instance by loading platforms and libraries.

for await (const { message } of client.init({ instance })) {
    switch (message.$case) {
        case 'error':
            throw new Error(message.error);
    }
}

Search platforms:

const { searchOutput } = await client.platformSearch({
    instance,
    searchArgs: 'SAMD',
});
searchOutput.forEach(({ id, latest }) => console.log(`${id}@${latest}`));

// arduino:[email protected]
// Arrow:[email protected]
// industruino:[email protected]

Configuration

The API contains typing and a JSON schema for the Arduino CLI configuration.

License

This project is licensed under the MIT License - see the LICENSE file for details.

ardunno-cli's People

Contributors

dankeboy36 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

ardunno-cli's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.