UNPKG

ai-persona-hub

Version:

AI Profile CLI - Create custom AI profiles run against dynamic LLM providers

42 lines • 2.1 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.listCommand = listCommand; const chalk_1 = __importDefault(require("chalk")); const profile_manager_1 = require("../services/profile-manager"); async function listCommand() { try { const profileManager = new profile_manager_1.ProfileManager(); const profiles = await profileManager.listProfiles(); if (profiles.length === 0) { console.log(chalk_1.default.yellow('No profiles found. Create one with:')); console.log(chalk_1.default.white('cgem create')); return; } console.log(chalk_1.default.blue(`\nšŸ“‹ Available profiles (${profiles.length}):\n`)); profiles.forEach(profile => { console.log(chalk_1.default.white(`• ${profile.name}`)); console.log(chalk_1.default.gray(` ID: ${profile.id}`)); console.log(chalk_1.default.gray(` Created: ${new Date(profile.createdAt).toLocaleDateString()}`)); if (profile.lastUsed) { console.log(chalk_1.default.gray(` Last used: ${new Date(profile.lastUsed).toLocaleDateString()}`)); } if (profile.maxTokens) { console.log(chalk_1.default.gray(` Max tokens: ${profile.maxTokens}`)); } const promptPreview = profile.systemPrompt.slice(0, 100); console.log(chalk_1.default.gray(` Prompt: ${promptPreview}${profile.systemPrompt.length > 100 ? '...' : ''}`)); console.log(); }); console.log(chalk_1.default.gray('Start a conversation with:')); console.log(chalk_1.default.white('cgem chat <profile-name>')); } catch (error) { console.error(chalk_1.default.red('āŒ Error listing profiles:')); console.error(chalk_1.default.red(error instanceof Error ? error.message : 'Unknown error')); process.exit(1); } } //# sourceMappingURL=list.js.map