diff --git a/build/actions/device.js b/build/actions/device.js index e431eaa0..db691bf1 100644 --- a/build/actions/device.js +++ b/build/actions/device.js @@ -67,6 +67,20 @@ limitations under the License. } }; + exports.supported = { + signature: 'devices supported', + description: 'list all supported devices', + help: 'Use this command to get the list of all supported devices\n\nExamples:\n\n $ resin devices supported', + permission: 'user', + action: function(params, options, done) { + var resin; + resin = require('resin-sdk'); + return resin.models.config.getDeviceTypes().each(function(deviceType) { + return console.log(deviceType.slug); + }).nodeify(done); + } + }; + exports.register = { signature: 'device register ', description: 'register a device', diff --git a/build/app.js b/build/app.js index aca40f7b..6adfe338 100644 --- a/build/app.js +++ b/build/app.js @@ -85,6 +85,8 @@ limitations under the License. capitano.command(actions.device.list); + capitano.command(actions.device.supported); + capitano.command(actions.device.rename); capitano.command(actions.device.init); diff --git a/lib/actions/device.coffee b/lib/actions/device.coffee index 509e2c9f..813aa2c3 100644 --- a/lib/actions/device.coffee +++ b/lib/actions/device.coffee @@ -102,6 +102,23 @@ exports.info = ] .nodeify(done) +exports.supported = + signature: 'devices supported' + description: 'list all supported devices' + help: ''' + Use this command to get the list of all supported devices + + Examples: + + $ resin devices supported + ''' + permission: 'user' + action: (params, options, done) -> + resin = require('resin-sdk') + resin.models.config.getDeviceTypes().each (deviceType) -> + console.log(deviceType.slug) + .nodeify(done) + exports.register = signature: 'device register ' description: 'register a device' diff --git a/lib/app.coffee b/lib/app.coffee index fec89988..58c37e49 100644 --- a/lib/app.coffee +++ b/lib/app.coffee @@ -70,6 +70,7 @@ capitano.command(actions.app.info) # ---------- Device Module ---------- capitano.command(actions.device.list) +capitano.command(actions.device.supported) capitano.command(actions.device.rename) capitano.command(actions.device.init) capitano.command(actions.device.remove)