From 36b25e03077fb81ed95d27fa95a0df0e5d0eff3e Mon Sep 17 00:00:00 2001 From: Jesse Wierzbinski Date: Sun, 24 Nov 2024 00:37:26 +0100 Subject: [PATCH] feat(cli): :sparkles: Add direct password option to CLI --- cli/commands/user/create.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cli/commands/user/create.ts b/cli/commands/user/create.ts index c0712bf1..b3ef2fa4 100644 --- a/cli/commands/user/create.ts +++ b/cli/commands/user/create.ts @@ -50,6 +50,11 @@ export default class UserCreate extends BaseCommand { default: false, exclusive: ["format"], }), + password: Flags.string({ + description: + "Password. Make sure this isn't saved in the shell history", + exclusive: ["set-password"], + }), }; public async run(): Promise { @@ -96,6 +101,10 @@ export default class UserCreate extends BaseCommand { password = password1; } + if (flags.password) { + password = flags.password; + } + // TODO: Add password resets const user = await User.fromDataLocal({ @@ -137,7 +146,7 @@ export default class UserCreate extends BaseCommand { ), ); - if (!(flags.format || flags["set-password"])) { + if (!(flags.format || flags["set-password"] || flags.password)) { const link = ""; this.log(