refactor: 优化cli应用,隐藏wip的命令,并更新README

pull/64/head
moonrailgun 3 years ago
parent bba9ff69d2
commit 97c152914d

@ -5,9 +5,10 @@ A Command line interface of tailchat
tailchat <command>
Commands:
tailchat create [template] 创建 Tailchat 项目代码
tailchat create [template] 创建 Tailchat 项目代码
tailchat connect 连接到 Tailchat 节点网络
tailchat declaration [source] Tailchat 插件类型声明
tailchat bench 压力测试
tailchat declaration <source> Tailchat 插件类型声明
Options:
--version Show version number [boolean]

@ -13,7 +13,7 @@
"templates"
],
"scripts": {
"dev": "ts-node ./src/index.ts",
"dev": "cross-env NODE_ENV=development ts-node ./src/index.ts",
"build": "rimraf -rf lib && tsc",
"prepare": "npm run build",
"release": "npm publish --registry https://registry.npmjs.com/",
@ -65,6 +65,7 @@
"@types/react": "18.0.20",
"@types/spinnies": "^0.5.0",
"@types/yargs": "^17.0.10",
"cross-env": "^7.0.3",
"tailchat-shared": "workspace:*",
"ts-node": "^10.7.0",
"typescript": "^4.6.3"

@ -1,9 +1,10 @@
import { CommandModule } from 'yargs';
import { run } from '../app';
import { isDev } from '../utils';
export const appCommand: CommandModule = {
command: 'app',
describe: 'Tailchat cli 版本(WIP)',
describe: isDev() ? false : 'Tailchat cli 版本(WIP)',
builder: undefined,
async handler() {
await run();

@ -16,7 +16,7 @@ const targetImageName = targetImage.repo + targetImage.tag;
export const dockerCommand: CommandModule = {
command: 'docker',
describe: 'Tailchat 插件类型声明',
describe: 'Tailchat 镜像管理',
builder: (yargs) =>
yargs
.command(

@ -0,0 +1,6 @@
/**
*
*/
export function isDev(): boolean {
return process.env.NODE_ENV === 'development';
}

@ -69,6 +69,7 @@ importers:
'@types/spinnies': ^0.5.0
'@types/yargs': ^17.0.10
as-table: ^1.0.55
cross-env: ^7.0.3
dockerode: ^3.3.4
dotenv: ^16.0.0
filesize: ^8.0.7
@ -125,6 +126,7 @@ importers:
'@types/react': 18.0.20
'@types/spinnies': 0.5.0
'@types/yargs': 17.0.12
cross-env: 7.0.3
tailchat-shared: link:../../client/shared
ts-node: 10.9.1_rk33jgomelnuriwr3foeinccb4
typescript: 4.8.2

Loading…
Cancel
Save