models.js
1 import { cli, Strategy } from '@jackwener/opencli/registry'; 2 import { IMAGE_MODELS, VIDEO_MODELS, TOOL_MODELS } from './utils.js'; 3 cli({ 4 site: 'yollomi', 5 name: 'models', 6 description: 'List available Yollomi AI models (image, video, tools)', 7 strategy: Strategy.PUBLIC, 8 browser: false, 9 args: [ 10 { name: 'type', default: 'all', choices: ['all', 'image', 'video', 'tool'], help: 'Filter by model type' }, 11 ], 12 columns: ['type', 'model', 'credits', 'description'], 13 func: async (_page, kwargs) => { 14 const filter = kwargs.type; 15 const rows = []; 16 if (filter === 'all' || filter === 'image') { 17 for (const [id, info] of Object.entries(IMAGE_MODELS)) { 18 rows.push({ type: 'image', model: id, credits: info.credits, description: info.description }); 19 } 20 } 21 if (filter === 'all' || filter === 'video') { 22 for (const [id, info] of Object.entries(VIDEO_MODELS)) { 23 rows.push({ type: 'video', model: id, credits: info.credits, description: info.description }); 24 } 25 } 26 if (filter === 'all' || filter === 'tool') { 27 for (const [id, info] of Object.entries(TOOL_MODELS)) { 28 rows.push({ type: 'tool', model: id, credits: info.credits, description: info.description }); 29 } 30 } 31 return rows; 32 }, 33 });