@re-x/xxx
v0.0.0-alpha.3
Published
A plugin-based CLI toolkit
Downloads
35
Readme
@re-x/xxx
A plugin-based CLI toolkit. Extend it with your own commands — run bash scripts, JS logic, or open links alias fk
Install
npm install -g @re-x/xxxUsage
xxx --help
xxx greet Alice --shout
xxx info -s
xxx docs tsExternal Plugins
Register your own plugin directories — no need to modify the CLI itself:
xxx plugin add /path/to/my-plugins
xxx plugin ls
xxx plugin rm /path/to/my-pluginsA plugin is a .plugin.mjs file (ESM) that exports a default object:
export default {
meta: {
name: 'hello',
description: 'Say hello',
type: 'js', // 'bash' | 'js' | 'open'
aliases: ['he'], // 外部插件别名必须 2 个字母
},
config: {
type: 'js',
action: (options, args) => console.log(`Hello, ${args[0]}!`),
},
};External plugins can detect the CLI's language via process.env.XXX_LOCALE ('zh' or 'en') and use getters for dynamic descriptions. See DOCS.md for full documentation (Plugin 完整结构、参数/选项说明、三种类型模板、别名规则、i18n 等).
License
MIT
