@lark-project/cli
Version:
飞书项目插件开发工具
41 lines (40 loc) • 1.46 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.addConfigCommand = void 0;
// ⚠️ 改命令名 / flag / alias 时,同步 grep `lpm` skills/ .claude/skills/ 修文档引用
const path_1 = __importDefault(require("path"));
const types_1 = require("../../types");
const run_script_1 = __importDefault(require("../../utils/run-script"));
function dispatch(payload) {
(0, run_script_1.default)(path_1.default.join(__dirname, '../dispatcher'), [
'--command',
types_1.ECommandName.config,
'--payload',
JSON.stringify(payload),
]);
}
function addConfigCommand(program) {
const config = program
.command('config')
.alias('c')
.description('Get or set plugin config values');
config
.command('get')
.description('Print the value of a plugin config key')
.argument('<key>', 'Config key to read')
.action((key) => {
dispatch({ action: 'get', key });
});
config
.command('set')
.description('Set a plugin config key to a value')
.argument('<key>', 'Config key to write')
.argument('<value>', 'New value')
.action((key, value) => {
dispatch({ action: 'set', key, value });
});
}
exports.addConfigCommand = addConfigCommand;