1 import { registerTSPaths } from '../helpers/register-ts-paths'
4 import { program } from 'commander'
5 import { assignToken, buildServer } from './cli'
8 .option('-u, --url <url>', 'Server url')
9 .option('-n, --username <username>', 'Username')
10 .option('-p, --password <token>', 'Password')
13 const options = program.opts()
20 if (!options.url) console.error('--url field is required.')
21 if (!options.username) console.error('--username field is required.')
22 if (!options.password) console.error('--password field is required.')
27 const server = buildServer(options.url)
29 assignToken(server, options.username, options.password)
31 console.log(server.accessToken)