UNPKG

@plastichub/osr-ai-tools

Version:

CLI and library for LLM tools

30 lines (29 loc) 1.12 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.commands = void 0; const types_1 = require("./types"); const list_1 = require("./list"); const invoke_1 = require("./invoke"); const osr_commons_1 = require("@plastichub/osr-commons"); const __1 = require("../"); const commands = (yargs) => { return yargs .command('types', 'Generate TypeScript interfaces from Zod schemas', {}, types_1.types) .command('list', 'List all available tools and their descriptions', list_1.options, list_1.list) .command('invoke', 'Invoke a specific tool function', invoke_1.invokeOptions, invoke_1.invoke) .option('env_key', { type: 'string', description: 'Environment configuration key' }) .middleware([(argv) => { const config = (0, osr_commons_1.CONFIG_DEFAULT)(argv.env_key); if (!config) { __1.logger.warn('No config found!'); return; } return config; }]) .strict() .help(); }; exports.commands = commands;