balena-cli/lib/app.coffee

62 lines
1.3 KiB
CoffeeScript
Raw Normal View History

2014-11-17 19:48:26 +00:00
program = require('commander')
2014-11-18 12:35:50 +00:00
packageJSON = require('../package.json')
data = require('./data/data')
config = require('./config')
2014-11-17 19:48:26 +00:00
program.version(packageJSON.version)
2014-11-18 15:37:29 +00:00
# ---------- Auth Module ----------
auth = require('./actions/auth')
2014-11-17 19:48:26 +00:00
program
.command('login [username:password]')
2014-11-17 19:48:26 +00:00
.description('Login with your resin.io account')
.action(auth.login)
2014-11-17 19:48:26 +00:00
2014-11-18 15:48:05 +00:00
program
.command('logout')
.description('Logout from your resin.io account')
.action(auth.logout)
2014-11-18 15:37:29 +00:00
program
.command('signup')
.description('Open signup form')
.action(auth.signup)
# ---------- App Module ----------
app = require('./actions/app')
2014-11-17 19:48:26 +00:00
program
.command('apps')
.description('Show a list of your apps')
.action(app.list)
2014-11-17 19:48:26 +00:00
2014-11-19 13:23:40 +00:00
program
.command('app <id>')
.description('Show an application')
.action(app.info)
2014-11-19 17:38:15 +00:00
# ---------- Device Module ----------
device = require('./actions/device')
program
.command('devices <id>')
.description('Show devices for an application')
.action(device.list)
2014-11-19 12:59:17 +00:00
# ---------- Preferences Module ----------
preferences = require('./actions/preferences')
program
.command('preferences')
.description('Open preferences in your web browser')
.action(preferences.preferences)
2014-11-17 19:48:26 +00:00
data.prefix.set config.dataPrefix, (error) ->
throw error if error?
program.parse(process.argv)