1 import * as program from 'commander'
9 } from '../tests/utils/index'
12 .option('-u, --url <url>', 'Server url')
13 .option('-n, --username <username>', 'Username')
14 .option('-p, --password <token>', 'Password')
19 !program['username'] ||
22 if (!program['url']) console.error('--url field is required.')
23 if (!program['username']) console.error('--username field is required.')
24 if (!program['password']) console.error('--password field is required.')
28 getClient(program.url)
33 username: program['username'],
34 password: program['password']
37 id: res.body.client_id as string,
38 secret: res.body.client_secret as string
42 return serverLogin(server)
44 .then(accessToken => {
45 console.log(accessToken)