@clack/prompts
实现交互式命令行chalk
实现命令行输出样式clipboardy
实现剪贴板操作execa
实现命令行执行
上述功能均可通过 ctx
对象调用。
cli --version
查看版本cli --help
查看帮助cli install
安装插件cli unstall
卸载插件cli enable
开启插件cli disable
关闭插件cli link
本地调试插件cli unlink
关闭本地调试插件cli updates
批量更新插件
import { resolve } from 'node:path';
import type { CliPlugin } from '@waycode/cli';
const plugin: CliPlugin = {
name: 'wdp',
handle(ctx) {
ctx.registerCommand({
scope: 'wdp',
command: 'cicd [appName]',
action: (appName?: string) => {
// do something
},
});
},
};
export default plugin;