forked from ajnart/homarr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cli.js
30 lines (28 loc) · 839 Bytes
/
cli.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import yargs from 'yargs';
import { resetPasswordForOwner } from './commands/reset-owner-password.js';
import { resetPasswordForUsername } from './commands/reset-password.js';
yargs(process.argv.slice(2))
.scriptName('homarr')
.usage('$0 <cmd> [args]')
.command('reset-owner-password', 'Resets the current owner password without UI access', async () => {
await resetPasswordForOwner();
})
.command(
'reset-password',
'Reset the password of a specific user without UI access',
(yargs) => {
yargs.option('username', {
type: 'string',
describe: 'Username of user',
demandOption: true
});
},
async (argv) => {
await resetPasswordForUsername(argv.username);
}
)
.version(false)
.showHelpOnFail(true)
.alias('h', 'help')
.demandCommand()
.help().argv;