UNPKG

mcp-prompt-optimizer

Version:

Professional cloud-based MCP server for AI-powered prompt optimization with intelligent context detection, Bayesian optimization, AG-UI real-time optimization, template auto-save, optimization insights, personal model configuration via WebUI, team collabo

37 lines โ€ข 1.78 kB
#!/usr/bin/env node const CloudApiKeyManager = require('./api-key-manager'); const packageJson = require('../package.json'); async function checkStatus() { const developmentMode = process.env.NODE_ENV === 'development' || process.env.OPTIMIZER_DEV_MODE === 'true'; const modeText = developmentMode ? ' (Development Mode)' : ''; console.log(`๐Ÿ“Š MCP Prompt Optimizer v${packageJson.version} - Status Check${modeText}\n`); try { const apiKey = process.env.OPTIMIZER_API_KEY; if (!apiKey) { console.error('โŒ No API key found'); console.log('\n๐Ÿ“ Set your API key to check status:'); console.log(' export OPTIMIZER_API_KEY=sk-local-your-key-here'); // Aligned with free tier/development if (developmentMode) { console.log('\n๐Ÿงช Development Mode Options:'); console.log(' export OPTIMIZER_API_KEY=sk-dev-test-key'); } process.exit(1); } console.log(`๐Ÿ” Checking status for API key: ${apiKey.substring(0, 16)}...`); const manager = new CloudApiKeyManager(apiKey, { developmentMode }); console.log('โณ Fetching account information...\n'); const apiKeyInfo = await manager.getApiKeyInfo(); console.log('๐Ÿ“Š Account Status:'); console.log('='.repeat(50)); console.log(`๐ŸŽฏ Subscription Tier: ${apiKeyInfo.tier}`); console.log(`๐Ÿ”‘ API Key Type: ${apiKeyInfo.keyType}`); console.log(`โœ… Key Status: ${apiKeyInfo.isValid ? 'Valid' : 'Invalid'}`); } catch (error) { console.error(`โŒ Status check failed: ${error.message}\n`); process.exit(1); } } if (require.main === module) { checkStatus(); } module.exports = checkStatus;