mcpresso
Version:
TypeScript package for Model Context Protocol (MCP) utilities and tools
48 lines (47 loc) ⢠2 kB
JavaScript
import { Command } from 'commander';
import chalk from 'chalk';
import { getTemplateInfo } from '../utils/template-manager.js';
export const info = new Command('info')
.description('Show detailed information about a template')
.argument('<template>', 'Template name or URL')
.action(async (template) => {
try {
console.log(chalk.blue.bold('š Template Information'));
console.log(chalk.gray('ā'.repeat(60)));
const info = await getTemplateInfo(template);
if (!info) {
console.log(chalk.red('ā Template not found'));
return;
}
console.log(chalk.cyan.bold(`\n${info.name}`));
console.log(chalk.gray(info.description));
console.log(chalk.blue.bold('\nš Details:'));
console.log(` Category: ${info.category}`);
console.log(` Authentication: ${info.authType}`);
console.log(` Complexity: ${info.complexity}`);
console.log(` Repository: ${info.url}`);
if (info.features && info.features.length > 0) {
console.log(chalk.blue.bold('\n⨠Features:'));
info.features.forEach(feature => {
console.log(` ⢠${feature}`);
});
}
if (info.requirements && info.requirements.length > 0) {
console.log(chalk.blue.bold('\nš§ Requirements:'));
info.requirements.forEach(req => {
console.log(` ⢠${req}`);
});
}
if (info.envVars && info.envVars.length > 0) {
console.log(chalk.blue.bold('\nš Environment Variables:'));
info.envVars.forEach(env => {
console.log(` ⢠${env.name}: ${env.description}`);
});
}
console.log(chalk.gray('\nš” Use "mcpresso init" to create a new project from this template'));
}
catch (error) {
console.error(chalk.red('ā Error fetching template info:'), error);
process.exit(1);
}
});