@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;