mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-23 23:42:24 +00:00
53 lines
1.1 KiB
CoffeeScript
53 lines
1.1 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)
|
|
|
|
# ---------- 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)
|