cliseo
Version:
Instant AI-Powered SEO Optimization CLI for Developers
45 lines (44 loc) • 1.93 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const project_analyzer_1 = require("./services/analysis/project-analyzer");
const path_1 = __importDefault(require("path"));
async function testAI() {
try {
const analyzer = new project_analyzer_1.ProjectAnalyzer();
// Go up to the main project root from src/ai/src
const projectRoot = path_1.default.resolve(__dirname, '../../../');
console.log(`🚀 Starting AI analysis for project at: ${projectRoot}\n`);
const analysis = await analyzer.analyzeProject(projectRoot);
console.log('\n\n✨ AI Analysis Complete! ✨');
console.log('---------------------------------');
console.log(`› Project Name: ${analysis.projectName}`);
console.log(`› Framework: ${analysis.framework}`);
console.log(`› Language: ${analysis.language}`);
console.log(`› Author: ${analysis.author}`);
console.log('\n› AI-Generated Description:');
console.log(` ${analysis.description}`);
console.log('\n› AI-Suggested Keywords:');
// Format keywords for readability
const keywords = analysis.keywords.join(', ');
console.log(` ${keywords}`);
console.log('---------------------------------');
}
catch (error) {
console.error('\n❌ An error occurred during analysis:');
if (error instanceof Error) {
console.error(error.message);
if ('response' in error) {
// Log more detailed API error info if available
console.error(JSON.stringify(error.response?.data, null, 2));
}
}
else {
console.error(error);
}
}
}
// Run the test
testAI();