balena-cli/lib/app.coffee
2014-11-19 13:38:15 -04:00

62 lines
1.3 KiB
CoffeeScript

program = require('commander')
packageJSON = require('../package.json')
data = require('./data/data')
config = require('./config')
program.version(packageJSON.version)
# ---------- Auth Module ----------
auth = require('./actions/auth')
program
.command('login [username:password]')
.description('Login with your resin.io account')
.action(auth.login)
program
.command('logout')
.description('Logout from your resin.io account')
.action(auth.logout)
program
.command('signup')
.description('Open signup form')
.action(auth.signup)
# ---------- App Module ----------
app = require('./actions/app')
program
.command('apps')
.description('Show a list of your apps')
.action(app.list)
program
.command('app <id>')
.description('Show an application')
.action(app.info)
# ---------- Device Module ----------
device = require('./actions/device')
program
.command('devices <id>')
.description('Show devices for an application')
.action(device.list)
# ---------- Preferences Module ----------
preferences = require('./actions/preferences')
program
.command('preferences')
.description('Open preferences in your web browser')
.action(preferences.preferences)
data.prefix.set config.dataPrefix, (error) ->
throw error if error?
program.parse(process.argv)