1 import { registerTSPaths } from '../helpers/register-ts-paths'
4 import { program } from 'commander'
5 import { getAccessToken } from '../../shared/extra-utils'
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 getAccessToken(options.url, options.username, options.password)
28 .then(accessToken => {
29 console.log(accessToken)