mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
feat(cli): ✨ Add generate-keys CLI command
This commit is contained in:
parent
33f16bb9b1
commit
11bb0a6f49
5 changed files with 77 additions and 77 deletions
18
cli/commands/generate-keys.ts
Normal file
18
cli/commands/generate-keys.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import chalk from "chalk";
|
||||
import { User } from "~/classes/database/user";
|
||||
import { BaseCommand } from "~/cli/base";
|
||||
|
||||
export default class GenerateKeys extends BaseCommand<typeof GenerateKeys> {
|
||||
static override args = {};
|
||||
|
||||
static override description = "Generates keys to use in Versia Server";
|
||||
|
||||
static override flags = {};
|
||||
|
||||
public async run(): Promise<void> {
|
||||
const { public_key, private_key } = await User.generateKeys();
|
||||
|
||||
this.log(`Generated public key: ${chalk.gray(public_key)}`);
|
||||
this.log(`Generated private key: ${chalk.gray(private_key)}`);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue