-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcommand.coffee
35 lines (32 loc) · 1.58 KB
/
command.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
commander = require 'commander'
packageJSON = require './package.json'
class Command
run: =>
commander
.version packageJSON.version
.command 'claim', 'claim Meshblu device in Octoblu'
.command 'subscription-create', 'Create a device subscription'
.command 'subscription-delete', 'Delete a device subscription'
.command 'subscription-list', 'List a device\'s subscription'
.command 'create-hook', 'Create a message hook'
.command 'firehose', 'Connect to the firehose!'
.command 'generate-token', 'generate and store token'
.command 'get', 'retrieve a device using a meshblu.json'
.command 'keygen', 'generate public/private keypair, update\n' +
' meshblu.json with the private key, \n' +
' and publish the public key'
.command 'message', 'send a message with Meshblu'
.command 'online', 'check if Meshblu device is online'
.command 'register', 'register a new device with Meshblu'
.command 'revoke-token', 'revoke token from device'
.command 'server-check', 'check if Meshblu server is available'
.command 'search', 'search for devices'
.command 'subscribe','subscribe to messages to a Meshblu Device'
.command 'update', 'update an existing device in Meshblu'
.command 'unregister', 'delete a device in Meshblu'
.command 'gateblu-shadow-sync', "synchronize a gateblu and it's shadows"
.parse process.argv
unless commander.runningCommand
commander.outputHelp()
process.exit 1
(new Command()).run()