1 import { program } from 'commander'
2 import { assignToken, buildServer } from './cli'
5 .option('-u, --url <url>', 'Server url')
6 .option('-n, --username <username>', 'Username')
7 .option('-p, --password <token>', 'Password')
10 const options = program.opts()
17 if (!options.url) console.error('--url field is required.')
18 if (!options.username) console.error('--username field is required.')
19 if (!options.password) console.error('--password field is required.')
24 const server = buildServer(options.url)
26 assignToken(server, options.username, options.password)
28 console.log(server.accessToken)