@lark-project/cli
Version:
飞书项目插件开发工具
33 lines (32 loc) • 1.43 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.addListCategoriesCommand = void 0;
// ⚠️ 改命令名 / flag / alias 时,同步 grep `lpm` skills/ .claude/skills/ 修文档引用
const path_1 = __importDefault(require("path"));
const types_1 = require("../../types");
const logger_1 = require("../../utils/logger");
const run_script_1 = __importDefault(require("../../utils/run-script"));
const TYPE_MAP = { plugin: 0, ai: 1 };
function addListCategoriesCommand(program) {
program
.command('list-categories')
.description('List available plugin categories (reads siteDomain from plugin.config.json).')
.option('--type <type>', 'Category type: plugin | ai', 'plugin')
.action(async (options) => {
const type = TYPE_MAP[options.type];
if (type === undefined) {
logger_1.logger.error(`--type must be "plugin" or "ai", got "${options.type}"`);
process.exit(1);
}
(0, run_script_1.default)(path_1.default.join(__dirname, '../dispatcher'), [
'--command',
types_1.ECommandName.listCategories,
'--payload',
JSON.stringify({ type }),
]);
});
}
exports.addListCategoriesCommand = addListCategoriesCommand;