0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

Merge pull request #2062 from logto-io/gao-log-4324-cli-refactor-per-review

refactor(cli): per review
This commit is contained in:
Gao Sun 2022-10-08 18:18:11 +08:00 committed by GitHub
commit ec1c292246
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 9 deletions

View file

@ -7,8 +7,7 @@
"license": "MPL-2.0",
"main": "lib/index.js",
"bin": {
"logto": "bin/logto",
"lg": "bin/logto"
"logto": "bin/logto"
},
"files": [
"bin",

View file

@ -27,8 +27,8 @@ const validateKeys: ValidateKeysFunction = (keys) => {
}
};
export const getKey: CommandModule<unknown, { key: string; keys: string[] }> = {
command: 'get-key <key> [keys...]',
export const getConfig: CommandModule<unknown, { key: string; keys: string[] }> = {
command: 'get-config <key> [keys...]',
describe: 'Get config value(s) of the given key(s) in Logto database',
builder: (yargs) =>
yargs
@ -67,8 +67,8 @@ export const getKey: CommandModule<unknown, { key: string; keys: string[] }> = {
},
};
export const setKey: CommandModule<unknown, { key: string; value: string }> = {
command: 'set-key <key> <value>',
export const setConfig: CommandModule<unknown, { key: string; value: string }> = {
command: 'set-config <key> <value>',
describe: 'Set config value of the given key in Logto database',
builder: (yargs) =>
yargs

View file

@ -2,7 +2,7 @@ import { CommandModule } from 'yargs';
import { noop } from '../../utilities';
import alteration from './alteration';
import { getKey, setKey } from './key';
import { getConfig, setConfig } from './config';
import seed from './seed';
import { getUrl, setUrl } from './url';
@ -13,8 +13,8 @@ const database: CommandModule = {
yargs
.command(getUrl)
.command(setUrl)
.command(getKey)
.command(setKey)
.command(getConfig)
.command(setConfig)
.command(seed)
.command(alteration)
.demandCommand(1),