@edtools/cli 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-OA4N744J.js +527 -0
- package/dist/cli/commands/generate.d.ts.map +1 -1
- package/dist/cli/commands/generate.js +25 -8
- package/dist/cli/commands/generate.js.map +1 -1
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +15 -1
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/index.js +39 -11
- package/dist/core/generator.d.ts +6 -2
- package/dist/core/generator.d.ts.map +1 -1
- package/dist/core/generator.js +98 -30
- package/dist/core/generator.js.map +1 -1
- package/dist/index.d.ts +10 -2
- package/dist/index.js +1 -1
- package/dist/types/content.d.ts +4 -0
- package/dist/types/content.d.ts.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,527 @@
|
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
+
}) : x)(function(x) {
|
|
4
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
// src/types/adapter.ts
|
|
9
|
+
var AdapterRegistry = class {
|
|
10
|
+
adapters;
|
|
11
|
+
constructor() {
|
|
12
|
+
this.adapters = /* @__PURE__ */ new Map();
|
|
13
|
+
}
|
|
14
|
+
register(adapter) {
|
|
15
|
+
this.adapters.set(adapter.name, adapter);
|
|
16
|
+
}
|
|
17
|
+
get(name) {
|
|
18
|
+
return this.adapters.get(name);
|
|
19
|
+
}
|
|
20
|
+
async detectAdapter(projectPath) {
|
|
21
|
+
for (const adapter of this.adapters.values()) {
|
|
22
|
+
if (await adapter.detect(projectPath)) {
|
|
23
|
+
return adapter;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
list() {
|
|
29
|
+
return Array.from(this.adapters.keys());
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// src/adapters/html/index.ts
|
|
34
|
+
import fs from "fs-extra";
|
|
35
|
+
import path from "path";
|
|
36
|
+
import ejs from "ejs";
|
|
37
|
+
import { marked } from "marked";
|
|
38
|
+
var HTMLAdapter = class {
|
|
39
|
+
name = "html";
|
|
40
|
+
templatePath;
|
|
41
|
+
constructor() {
|
|
42
|
+
this.templatePath = path.join(__dirname, "templates", "blog-post.html.ejs");
|
|
43
|
+
}
|
|
44
|
+
async detect(projectPath) {
|
|
45
|
+
try {
|
|
46
|
+
const files = await fs.readdir(projectPath);
|
|
47
|
+
const hasHtml = files.some((f) => f.endsWith(".html"));
|
|
48
|
+
const hasIndexHtml = await fs.pathExists(path.join(projectPath, "index.html"));
|
|
49
|
+
return hasHtml || hasIndexHtml;
|
|
50
|
+
} catch (error) {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
async render(content) {
|
|
55
|
+
const template = await fs.readFile(this.templatePath, "utf-8");
|
|
56
|
+
const templateData = {
|
|
57
|
+
metadata: content.metadata,
|
|
58
|
+
schemaOrg: JSON.stringify(content.schemaOrg, null, 2),
|
|
59
|
+
intro: await this.markdownToHTML(content.content.intro),
|
|
60
|
+
sections: await Promise.all(
|
|
61
|
+
content.content.sections.map(async (section) => ({
|
|
62
|
+
...section,
|
|
63
|
+
content: await this.renderSectionContent(section)
|
|
64
|
+
}))
|
|
65
|
+
),
|
|
66
|
+
conclusion: await this.markdownToHTML(content.content.conclusion),
|
|
67
|
+
cta: content.content.cta,
|
|
68
|
+
relatedPosts: content.relatedPosts || [],
|
|
69
|
+
seoScore: content.seo.score
|
|
70
|
+
};
|
|
71
|
+
const html = ejs.render(template, templateData);
|
|
72
|
+
return html;
|
|
73
|
+
}
|
|
74
|
+
async write(output, outputPath) {
|
|
75
|
+
await fs.ensureDir(path.dirname(outputPath));
|
|
76
|
+
await fs.writeFile(outputPath, output, "utf-8");
|
|
77
|
+
}
|
|
78
|
+
getFileExtension() {
|
|
79
|
+
return ".html";
|
|
80
|
+
}
|
|
81
|
+
transformPath(basePath) {
|
|
82
|
+
if (!basePath.endsWith(".html")) {
|
|
83
|
+
return basePath + "/index.html";
|
|
84
|
+
}
|
|
85
|
+
return basePath;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Convert markdown to HTML
|
|
89
|
+
*/
|
|
90
|
+
async markdownToHTML(markdown) {
|
|
91
|
+
return marked(markdown);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Render section content based on type
|
|
95
|
+
*/
|
|
96
|
+
async renderSectionContent(section) {
|
|
97
|
+
switch (section.type) {
|
|
98
|
+
case "text":
|
|
99
|
+
return await this.markdownToHTML(section.content);
|
|
100
|
+
case "comparison":
|
|
101
|
+
return this.renderComparisonTable(section.data);
|
|
102
|
+
case "list":
|
|
103
|
+
return this.renderList(section.data);
|
|
104
|
+
case "code":
|
|
105
|
+
return this.renderCode(section.data);
|
|
106
|
+
default:
|
|
107
|
+
return await this.markdownToHTML(section.content);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Render comparison table
|
|
112
|
+
*/
|
|
113
|
+
renderComparisonTable(data) {
|
|
114
|
+
if (!data || !data.headers || !data.rows) {
|
|
115
|
+
return "";
|
|
116
|
+
}
|
|
117
|
+
let html = '<table class="comparison-table">\n';
|
|
118
|
+
html += " <thead>\n <tr>\n";
|
|
119
|
+
data.headers.forEach((header) => {
|
|
120
|
+
html += ` <th>${header}</th>
|
|
121
|
+
`;
|
|
122
|
+
});
|
|
123
|
+
html += " </tr>\n </thead>\n";
|
|
124
|
+
html += " <tbody>\n";
|
|
125
|
+
data.rows.forEach((row) => {
|
|
126
|
+
html += " <tr>\n";
|
|
127
|
+
row.forEach((cell) => {
|
|
128
|
+
html += ` <td>${cell}</td>
|
|
129
|
+
`;
|
|
130
|
+
});
|
|
131
|
+
html += " </tr>\n";
|
|
132
|
+
});
|
|
133
|
+
html += " </tbody>\n";
|
|
134
|
+
html += "</table>";
|
|
135
|
+
return html;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Render list
|
|
139
|
+
*/
|
|
140
|
+
renderList(data) {
|
|
141
|
+
if (!data || !data.items) {
|
|
142
|
+
return "";
|
|
143
|
+
}
|
|
144
|
+
const tag = data.ordered ? "ol" : "ul";
|
|
145
|
+
let html = `<${tag} class="content-list">
|
|
146
|
+
`;
|
|
147
|
+
data.items.forEach((item) => {
|
|
148
|
+
html += " <li>\n";
|
|
149
|
+
html += ` <strong>${item.title}</strong>
|
|
150
|
+
`;
|
|
151
|
+
if (item.description) {
|
|
152
|
+
html += ` <p>${item.description}</p>
|
|
153
|
+
`;
|
|
154
|
+
}
|
|
155
|
+
html += " </li>\n";
|
|
156
|
+
});
|
|
157
|
+
html += `</${tag}>`;
|
|
158
|
+
return html;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Render code block
|
|
162
|
+
*/
|
|
163
|
+
renderCode(data) {
|
|
164
|
+
if (!data || !data.code) {
|
|
165
|
+
return "";
|
|
166
|
+
}
|
|
167
|
+
let html = '<div class="code-block">\n';
|
|
168
|
+
if (data.caption) {
|
|
169
|
+
html += ` <div class="code-caption">${data.caption}</div>
|
|
170
|
+
`;
|
|
171
|
+
}
|
|
172
|
+
html += ` <pre><code class="language-${data.language || "plaintext"}">${this.escapeHtml(data.code)}</code></pre>
|
|
173
|
+
`;
|
|
174
|
+
html += "</div>";
|
|
175
|
+
return html;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Escape HTML entities
|
|
179
|
+
*/
|
|
180
|
+
escapeHtml(text) {
|
|
181
|
+
const map = {
|
|
182
|
+
"&": "&",
|
|
183
|
+
"<": "<",
|
|
184
|
+
">": ">",
|
|
185
|
+
'"': """,
|
|
186
|
+
"'": "'"
|
|
187
|
+
};
|
|
188
|
+
return text.replace(/[&<>"']/g, (m) => map[m]);
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
// src/core/generator.ts
|
|
193
|
+
import Anthropic from "@anthropic-ai/sdk";
|
|
194
|
+
import OpenAI from "openai";
|
|
195
|
+
import path2 from "path";
|
|
196
|
+
import fs2 from "fs-extra";
|
|
197
|
+
import slugify from "slugify";
|
|
198
|
+
var ContentGenerator = class {
|
|
199
|
+
anthropic = null;
|
|
200
|
+
openai = null;
|
|
201
|
+
provider;
|
|
202
|
+
adapters;
|
|
203
|
+
constructor(apiKey, provider = "anthropic") {
|
|
204
|
+
this.provider = provider;
|
|
205
|
+
if (provider === "anthropic") {
|
|
206
|
+
this.anthropic = new Anthropic({
|
|
207
|
+
apiKey: apiKey || process.env.ANTHROPIC_API_KEY || ""
|
|
208
|
+
});
|
|
209
|
+
} else if (provider === "openai") {
|
|
210
|
+
this.openai = new OpenAI({
|
|
211
|
+
apiKey: apiKey || process.env.OPENAI_API_KEY || ""
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
this.adapters = new AdapterRegistry();
|
|
215
|
+
this.adapters.register(new HTMLAdapter());
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Main generate method
|
|
219
|
+
*/
|
|
220
|
+
async generate(config) {
|
|
221
|
+
const results = {
|
|
222
|
+
success: true,
|
|
223
|
+
posts: [],
|
|
224
|
+
warnings: [],
|
|
225
|
+
errors: []
|
|
226
|
+
};
|
|
227
|
+
try {
|
|
228
|
+
const adapter = await this.adapters.detectAdapter(config.projectPath);
|
|
229
|
+
if (!adapter) {
|
|
230
|
+
throw new Error("No suitable adapter found for this project");
|
|
231
|
+
}
|
|
232
|
+
console.log(`\u2713 Using adapter: ${adapter.name}`);
|
|
233
|
+
const topics = config.topics || await this.generateTopics(config.productInfo, config.count || 3);
|
|
234
|
+
for (const topic of topics.slice(0, config.count || 3)) {
|
|
235
|
+
try {
|
|
236
|
+
console.log(`
|
|
237
|
+
\u{1F4DD} Generating: ${topic}`);
|
|
238
|
+
const content = await this.generateContent(config.productInfo, topic);
|
|
239
|
+
const output = await adapter.render(content);
|
|
240
|
+
const slug = content.metadata.slug;
|
|
241
|
+
const fileName = adapter.transformPath?.(slug) || `${slug}/index${adapter.getFileExtension()}`;
|
|
242
|
+
const outputPath = path2.join(config.outputDir, fileName);
|
|
243
|
+
await adapter.write(output, outputPath);
|
|
244
|
+
results.posts.push({
|
|
245
|
+
title: content.metadata.title,
|
|
246
|
+
slug,
|
|
247
|
+
path: outputPath,
|
|
248
|
+
seoScore: content.seo.score
|
|
249
|
+
});
|
|
250
|
+
console.log(`\u2713 Generated: ${outputPath}`);
|
|
251
|
+
console.log(` SEO Score: ${content.seo.score}/100`);
|
|
252
|
+
} catch (error) {
|
|
253
|
+
results.errors?.push(`Failed to generate "${topic}": ${error.message}`);
|
|
254
|
+
results.success = false;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
if (results.posts.length > 0) {
|
|
258
|
+
await this.updateSitemap(config.projectPath, config.outputDir, results.posts);
|
|
259
|
+
}
|
|
260
|
+
} catch (error) {
|
|
261
|
+
results.success = false;
|
|
262
|
+
results.errors?.push(error.message);
|
|
263
|
+
}
|
|
264
|
+
return results;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Generate blog post content using the selected AI provider
|
|
268
|
+
*/
|
|
269
|
+
async generateContent(productInfo, topic) {
|
|
270
|
+
const prompt = this.buildPrompt(productInfo, topic);
|
|
271
|
+
let contentData;
|
|
272
|
+
if (this.provider === "anthropic") {
|
|
273
|
+
contentData = await this.generateWithAnthropic(prompt);
|
|
274
|
+
} else if (this.provider === "openai") {
|
|
275
|
+
contentData = await this.generateWithOpenAI(prompt);
|
|
276
|
+
} else {
|
|
277
|
+
throw new Error(`Unsupported provider: ${this.provider}`);
|
|
278
|
+
}
|
|
279
|
+
const slug = slugify(contentData.metadata.title, { lower: true, strict: true });
|
|
280
|
+
const content = {
|
|
281
|
+
metadata: {
|
|
282
|
+
...contentData.metadata,
|
|
283
|
+
slug,
|
|
284
|
+
datePublished: (/* @__PURE__ */ new Date()).toISOString(),
|
|
285
|
+
author: productInfo.name
|
|
286
|
+
},
|
|
287
|
+
schemaOrg: this.generateSchemaOrg({
|
|
288
|
+
...contentData.metadata,
|
|
289
|
+
slug,
|
|
290
|
+
datePublished: (/* @__PURE__ */ new Date()).toISOString(),
|
|
291
|
+
author: productInfo.name
|
|
292
|
+
}, productInfo),
|
|
293
|
+
content: contentData.content,
|
|
294
|
+
relatedPosts: [],
|
|
295
|
+
seo: await this.calculateSEOScore(contentData)
|
|
296
|
+
};
|
|
297
|
+
return content;
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Generate content using Anthropic's Claude API
|
|
301
|
+
*/
|
|
302
|
+
async generateWithAnthropic(prompt) {
|
|
303
|
+
if (!this.anthropic) {
|
|
304
|
+
throw new Error("Anthropic client not initialized");
|
|
305
|
+
}
|
|
306
|
+
const response = await this.anthropic.messages.create({
|
|
307
|
+
model: "claude-3-5-sonnet-20241022",
|
|
308
|
+
max_tokens: 4096,
|
|
309
|
+
temperature: 0.7,
|
|
310
|
+
messages: [
|
|
311
|
+
{
|
|
312
|
+
role: "user",
|
|
313
|
+
content: prompt
|
|
314
|
+
}
|
|
315
|
+
]
|
|
316
|
+
});
|
|
317
|
+
const textContent = response.content[0].type === "text" ? response.content[0].text : "";
|
|
318
|
+
const jsonMatch = textContent.match(/\{[\s\S]*\}/);
|
|
319
|
+
if (!jsonMatch) {
|
|
320
|
+
throw new Error("Failed to extract JSON from Claude response");
|
|
321
|
+
}
|
|
322
|
+
return JSON.parse(jsonMatch[0]);
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Generate content using OpenAI's ChatGPT API
|
|
326
|
+
*/
|
|
327
|
+
async generateWithOpenAI(prompt) {
|
|
328
|
+
if (!this.openai) {
|
|
329
|
+
throw new Error("OpenAI client not initialized");
|
|
330
|
+
}
|
|
331
|
+
const response = await this.openai.chat.completions.create({
|
|
332
|
+
model: "gpt-4-turbo-preview",
|
|
333
|
+
max_tokens: 4096,
|
|
334
|
+
temperature: 0.7,
|
|
335
|
+
messages: [
|
|
336
|
+
{
|
|
337
|
+
role: "user",
|
|
338
|
+
content: prompt
|
|
339
|
+
}
|
|
340
|
+
],
|
|
341
|
+
response_format: { type: "json_object" }
|
|
342
|
+
});
|
|
343
|
+
const textContent = response.choices[0]?.message?.content || "";
|
|
344
|
+
if (!textContent) {
|
|
345
|
+
throw new Error("Failed to get response from OpenAI");
|
|
346
|
+
}
|
|
347
|
+
return JSON.parse(textContent);
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Build prompt for Claude API
|
|
351
|
+
*/
|
|
352
|
+
buildPrompt(productInfo, topic) {
|
|
353
|
+
return `You are an expert SEO content writer. Generate a comprehensive blog post about: "${topic}"
|
|
354
|
+
|
|
355
|
+
Product context:
|
|
356
|
+
- Name: ${productInfo.name}
|
|
357
|
+
- Tagline: ${productInfo.tagline || ""}
|
|
358
|
+
- Category: ${productInfo.category}
|
|
359
|
+
- Features: ${productInfo.features.join(", ")}
|
|
360
|
+
- Pricing: ${productInfo.pricingModel || "Not specified"}
|
|
361
|
+
${productInfo.useCases ? `- Use cases: ${productInfo.useCases.join(", ")}` : ""}
|
|
362
|
+
|
|
363
|
+
IMPORTANT INSTRUCTIONS:
|
|
364
|
+
1. Write for users searching on Google and being recommended by AI assistants (Claude, ChatGPT)
|
|
365
|
+
2. Focus on being helpful, not promotional
|
|
366
|
+
3. Include comparisons with alternatives when relevant
|
|
367
|
+
4. Use natural language, avoid keyword stuffing
|
|
368
|
+
5. Make it comprehensive (1000-1500 words worth of content)
|
|
369
|
+
6. Structure with clear sections (intro, 3-5 main sections, conclusion)
|
|
370
|
+
7. Be factual - do NOT invent statistics or make false claims
|
|
371
|
+
|
|
372
|
+
Output ONLY valid JSON in this exact format (no markdown, no code blocks):
|
|
373
|
+
{
|
|
374
|
+
"metadata": {
|
|
375
|
+
"title": "SEO-optimized title (under 60 chars)",
|
|
376
|
+
"description": "Meta description (under 160 chars)",
|
|
377
|
+
"keywords": ["keyword1", "keyword2", "keyword3"],
|
|
378
|
+
"category": "${productInfo.category}"
|
|
379
|
+
},
|
|
380
|
+
"content": {
|
|
381
|
+
"intro": "Engaging introduction paragraph in markdown format",
|
|
382
|
+
"sections": [
|
|
383
|
+
{
|
|
384
|
+
"heading": "Section title",
|
|
385
|
+
"level": 2,
|
|
386
|
+
"content": "Section content in markdown format",
|
|
387
|
+
"type": "text"
|
|
388
|
+
}
|
|
389
|
+
],
|
|
390
|
+
"conclusion": "Conclusion paragraph in markdown",
|
|
391
|
+
"cta": {
|
|
392
|
+
"text": "Try ${productInfo.name}",
|
|
393
|
+
"url": "${productInfo.websiteUrl || "/signup"}"
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
}`;
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* Generate Schema.org structured data
|
|
400
|
+
*/
|
|
401
|
+
generateSchemaOrg(metadata, productInfo) {
|
|
402
|
+
return {
|
|
403
|
+
"@context": "https://schema.org",
|
|
404
|
+
"@type": "BlogPosting",
|
|
405
|
+
headline: metadata.title,
|
|
406
|
+
description: metadata.description,
|
|
407
|
+
author: {
|
|
408
|
+
"@type": "Organization",
|
|
409
|
+
name: productInfo.name,
|
|
410
|
+
url: productInfo.websiteUrl
|
|
411
|
+
},
|
|
412
|
+
datePublished: metadata.datePublished,
|
|
413
|
+
publisher: {
|
|
414
|
+
"@type": "Organization",
|
|
415
|
+
name: productInfo.name
|
|
416
|
+
},
|
|
417
|
+
keywords: metadata.keywords.join(", "),
|
|
418
|
+
articleSection: metadata.category
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Calculate SEO score
|
|
423
|
+
*/
|
|
424
|
+
async calculateSEOScore(content) {
|
|
425
|
+
let score = 100;
|
|
426
|
+
const suggestions = [];
|
|
427
|
+
if (content.metadata.title.length > 60) {
|
|
428
|
+
score -= 10;
|
|
429
|
+
suggestions.push("Title is too long (should be under 60 chars)");
|
|
430
|
+
}
|
|
431
|
+
if (content.metadata.description.length > 160) {
|
|
432
|
+
score -= 10;
|
|
433
|
+
suggestions.push("Meta description is too long (should be under 160 chars)");
|
|
434
|
+
}
|
|
435
|
+
if (content.metadata.keywords.length < 3) {
|
|
436
|
+
score -= 5;
|
|
437
|
+
suggestions.push("Add more keywords (at least 3)");
|
|
438
|
+
}
|
|
439
|
+
if (content.content.sections.length < 3) {
|
|
440
|
+
score -= 10;
|
|
441
|
+
suggestions.push("Add more sections for better structure (at least 3)");
|
|
442
|
+
}
|
|
443
|
+
return {
|
|
444
|
+
score: Math.max(0, score),
|
|
445
|
+
suggestions
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* Generate topic suggestions
|
|
450
|
+
*/
|
|
451
|
+
async generateTopics(productInfo, count) {
|
|
452
|
+
const prompt = `Generate ${count} SEO-friendly blog post topics for a product called "${productInfo.name}" in the ${productInfo.category} category.
|
|
453
|
+
|
|
454
|
+
Product description: ${productInfo.description}
|
|
455
|
+
Features: ${productInfo.features.join(", ")}
|
|
456
|
+
|
|
457
|
+
Requirements:
|
|
458
|
+
- Topics should be helpful for potential customers
|
|
459
|
+
- Focus on solving problems or answering questions
|
|
460
|
+
- Include comparisons, guides, and use cases
|
|
461
|
+
- Optimize for search engines and AI recommendations
|
|
462
|
+
|
|
463
|
+
Output ONLY a JSON array of topic strings, no markdown:
|
|
464
|
+
["Topic 1", "Topic 2", "Topic 3"]`;
|
|
465
|
+
try {
|
|
466
|
+
if (this.provider === "anthropic" && this.anthropic) {
|
|
467
|
+
const response = await this.anthropic.messages.create({
|
|
468
|
+
model: "claude-3-5-sonnet-20241022",
|
|
469
|
+
max_tokens: 1024,
|
|
470
|
+
messages: [{ role: "user", content: prompt }]
|
|
471
|
+
});
|
|
472
|
+
const textContent = response.content[0].type === "text" ? response.content[0].text : "";
|
|
473
|
+
const jsonMatch = textContent.match(/\[[\s\S]*\]/);
|
|
474
|
+
if (jsonMatch) {
|
|
475
|
+
return JSON.parse(jsonMatch[0]);
|
|
476
|
+
}
|
|
477
|
+
} else if (this.provider === "openai" && this.openai) {
|
|
478
|
+
const response = await this.openai.chat.completions.create({
|
|
479
|
+
model: "gpt-4-turbo-preview",
|
|
480
|
+
max_tokens: 1024,
|
|
481
|
+
messages: [{ role: "user", content: prompt }],
|
|
482
|
+
response_format: { type: "json_object" }
|
|
483
|
+
});
|
|
484
|
+
const textContent = response.choices[0]?.message?.content || "";
|
|
485
|
+
if (textContent) {
|
|
486
|
+
const data = JSON.parse(textContent);
|
|
487
|
+
return data.topics || data;
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
} catch (error) {
|
|
491
|
+
console.warn("Failed to generate topics with AI, using fallback");
|
|
492
|
+
}
|
|
493
|
+
return [
|
|
494
|
+
`Best ${productInfo.category} software ${(/* @__PURE__ */ new Date()).getFullYear()}`,
|
|
495
|
+
`How to choose ${productInfo.category} solution`,
|
|
496
|
+
`${productInfo.name} vs alternatives: Complete comparison`
|
|
497
|
+
];
|
|
498
|
+
}
|
|
499
|
+
/**
|
|
500
|
+
* Update sitemap.xml
|
|
501
|
+
*/
|
|
502
|
+
async updateSitemap(projectPath, blogDir, posts) {
|
|
503
|
+
const sitemapPath = path2.join(projectPath, "sitemap.xml");
|
|
504
|
+
const urls = posts.map((post) => {
|
|
505
|
+
return ` <url>
|
|
506
|
+
<loc>${post.slug}/</loc>
|
|
507
|
+
<lastmod>${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}</lastmod>
|
|
508
|
+
<changefreq>weekly</changefreq>
|
|
509
|
+
<priority>0.8</priority>
|
|
510
|
+
</url>`;
|
|
511
|
+
}).join("\n");
|
|
512
|
+
const sitemap = `<?xml version="1.0" encoding="UTF-8"?>
|
|
513
|
+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
514
|
+
${urls}
|
|
515
|
+
</urlset>`;
|
|
516
|
+
await fs2.writeFile(sitemapPath, sitemap, "utf-8");
|
|
517
|
+
console.log(`
|
|
518
|
+
\u2713 Updated sitemap.xml`);
|
|
519
|
+
}
|
|
520
|
+
};
|
|
521
|
+
|
|
522
|
+
export {
|
|
523
|
+
__require,
|
|
524
|
+
AdapterRegistry,
|
|
525
|
+
HTMLAdapter,
|
|
526
|
+
ContentGenerator
|
|
527
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/generate.ts"],"names":[],"mappings":"AAWA,UAAU,eAAe;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAsB,eAAe,CAAC,OAAO,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/generate.ts"],"names":[],"mappings":"AAWA,UAAU,eAAe;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAsB,eAAe,CAAC,OAAO,EAAE,eAAe,iBAmI7D"}
|
|
@@ -18,12 +18,25 @@ export async function generateCommand(options) {
|
|
|
18
18
|
console.log(chalk.red('✗ Invalid configuration in edtools.config.js'));
|
|
19
19
|
process.exit(1);
|
|
20
20
|
}
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
const provider = productInfo.preferredProvider || 'anthropic';
|
|
22
|
+
let apiKey;
|
|
23
|
+
if (provider === 'anthropic') {
|
|
24
|
+
apiKey = options.apiKey || process.env.ANTHROPIC_API_KEY;
|
|
25
|
+
if (!apiKey) {
|
|
26
|
+
console.log(chalk.red('✗ No Anthropic API key found'));
|
|
27
|
+
console.log(chalk.yellow(' Set ANTHROPIC_API_KEY environment variable'));
|
|
28
|
+
console.log(chalk.yellow(' Or use --api-key option\n'));
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
else if (provider === 'openai') {
|
|
33
|
+
apiKey = options.apiKey || process.env.OPENAI_API_KEY;
|
|
34
|
+
if (!apiKey) {
|
|
35
|
+
console.log(chalk.red('✗ No OpenAI API key found'));
|
|
36
|
+
console.log(chalk.yellow(' Set OPENAI_API_KEY environment variable'));
|
|
37
|
+
console.log(chalk.yellow(' Or use --api-key option\n'));
|
|
38
|
+
process.exit(1);
|
|
39
|
+
}
|
|
27
40
|
}
|
|
28
41
|
const count = parseInt(options.posts, 10);
|
|
29
42
|
if (isNaN(count) || count < 1 || count > 10) {
|
|
@@ -39,9 +52,10 @@ export async function generateCommand(options) {
|
|
|
39
52
|
console.log(chalk.cyan('Configuration:'));
|
|
40
53
|
console.log(` Product: ${chalk.white(productInfo.name)}`);
|
|
41
54
|
console.log(` Category: ${chalk.white(productInfo.category)}`);
|
|
55
|
+
console.log(` AI Provider: ${chalk.white(provider === 'anthropic' ? 'Claude (Anthropic)' : 'ChatGPT (OpenAI)')}`);
|
|
42
56
|
console.log(` Posts to generate: ${chalk.white(count)}`);
|
|
43
57
|
console.log(` Output directory: ${chalk.white(outputDir)}\n`);
|
|
44
|
-
const generator = new ContentGenerator(apiKey);
|
|
58
|
+
const generator = new ContentGenerator(apiKey, provider);
|
|
45
59
|
const generateConfig = {
|
|
46
60
|
productInfo,
|
|
47
61
|
topics: options.topics,
|
|
@@ -50,8 +64,11 @@ export async function generateCommand(options) {
|
|
|
50
64
|
projectPath,
|
|
51
65
|
avoidDuplicates: true,
|
|
52
66
|
similarityThreshold: 0.85,
|
|
67
|
+
provider,
|
|
68
|
+
apiKey,
|
|
53
69
|
};
|
|
54
|
-
const
|
|
70
|
+
const providerName = provider === 'anthropic' ? 'Claude' : 'ChatGPT';
|
|
71
|
+
const spinner = ora(`Generating content with ${providerName}...`).start();
|
|
55
72
|
try {
|
|
56
73
|
const result = await generator.generate(generateConfig);
|
|
57
74
|
if (result.success && result.posts.length > 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/cli/commands/generate.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAU3D,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,OAAwB;IAC5D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;IAE7D,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAClC,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC;IAG/D,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC;QACvC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC,CAAC;QACvD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,8BAA8B,CAAC,CAAC,CAAC;QAC1D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAGD,MAAM,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACnC,M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,CAAC,CAAC,KAAK,EAAE,EAAE;oBAC9B,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC;gBAC5B,CAAC,CAAC,CAAC;YACL,CAAC;YAED,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;QACxC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC;QAC/C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAKD,SAAS,aAAa,CAAC,KAAa;IAClC,IAAI,KAAK,IAAI,EAAE;QAAE,OAAO,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACxC,IAAI,KAAK,IAAI,EAAE;QAAE,OAAO,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACzC,OAAO,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AACvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAYA,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,iBA+
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAYA,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,iBA+LrD"}
|
|
@@ -115,6 +115,16 @@ export async function initCommand(options) {
|
|
|
115
115
|
default: productInfo.features?.join(', '),
|
|
116
116
|
filter: (input) => input.split(',').map((f) => f.trim()).filter(Boolean),
|
|
117
117
|
},
|
|
118
|
+
{
|
|
119
|
+
type: 'list',
|
|
120
|
+
name: 'preferredProvider',
|
|
121
|
+
message: 'AI provider preference:',
|
|
122
|
+
choices: [
|
|
123
|
+
{ name: 'Claude (Anthropic) - Recommended', value: 'anthropic' },
|
|
124
|
+
{ name: 'ChatGPT (OpenAI)', value: 'openai' },
|
|
125
|
+
],
|
|
126
|
+
default: 'anthropic',
|
|
127
|
+
},
|
|
118
128
|
]);
|
|
119
129
|
const finalProductInfo = {
|
|
120
130
|
...productInfo,
|
|
@@ -129,6 +139,7 @@ export async function initCommand(options) {
|
|
|
129
139
|
websiteUrl: ${JSON.stringify(finalProductInfo.websiteUrl)},
|
|
130
140
|
pricingModel: ${JSON.stringify(finalProductInfo.pricingModel)},
|
|
131
141
|
features: ${JSON.stringify(finalProductInfo.features, null, 2)},
|
|
142
|
+
preferredProvider: ${JSON.stringify(finalProductInfo.preferredProvider)},
|
|
132
143
|
},
|
|
133
144
|
|
|
134
145
|
content: {
|
|
@@ -154,7 +165,10 @@ export async function initCommand(options) {
|
|
|
154
165
|
console.log(` - ${chalk.white('.edtools/')} (local data directory)\n`);
|
|
155
166
|
console.log(chalk.cyan('Next steps:'));
|
|
156
167
|
console.log(` 1. Review ${chalk.white('edtools.config.js')}`);
|
|
157
|
-
|
|
168
|
+
const providerMessage = finalProductInfo.preferredProvider === 'openai'
|
|
169
|
+
? `export OPENAI_API_KEY=sk-...`
|
|
170
|
+
: `export ANTHROPIC_API_KEY=sk-ant-...`;
|
|
171
|
+
console.log(` 2. Set your API key: ${chalk.white(providerMessage)}`);
|
|
158
172
|
console.log(` 3. Generate content: ${chalk.white('edtools generate')}\n`);
|
|
159
173
|
}
|
|
160
174
|
//# sourceMappingURL=init.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,UAAU,CAA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AAC,CAAC;IAE/D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,2CAA2C,CAAC,CAAC,CAAC;IACtE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAC1C,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,CAAC,KAAK,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC;IACvD,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,2BAA2B,CAAC,CAAC;IAExE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;IACvC,OAAO,CAAC,GAAG,CAAC,eAAe,KAAK,CAAC,KAAK,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC;IAE/D,MAAM,eAAe,GAAG,gBAAgB,CAAC,iBAAiB,KAAK,QAAQ;QACrE,CAAC,CAAC,8BAA8B;QAChC,CAAC,CAAC,qCAAqC,CAAC;IAE1C,OAAO,CAAC,GAAG,CAAC,0BAA0B,KAAK,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;IACtE,OAAO,CAAC,GAAG,CAAC,0BAA0B,KAAK,CAAC,KAAK,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;AAC7E,CAAC"}
|
package/dist/cli/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
ContentGenerator,
|
|
4
4
|
__require
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-OA4N744J.js";
|
|
6
6
|
|
|
7
7
|
// src/cli/index.ts
|
|
8
8
|
import { Command } from "commander";
|
|
@@ -122,6 +122,16 @@ async function initCommand(options) {
|
|
|
122
122
|
message: "Main features (comma-separated):",
|
|
123
123
|
default: productInfo.features?.join(", "),
|
|
124
124
|
filter: (input) => input.split(",").map((f) => f.trim()).filter(Boolean)
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
type: "list",
|
|
128
|
+
name: "preferredProvider",
|
|
129
|
+
message: "AI provider preference:",
|
|
130
|
+
choices: [
|
|
131
|
+
{ name: "Claude (Anthropic) - Recommended", value: "anthropic" },
|
|
132
|
+
{ name: "ChatGPT (OpenAI)", value: "openai" }
|
|
133
|
+
],
|
|
134
|
+
default: "anthropic"
|
|
125
135
|
}
|
|
126
136
|
]);
|
|
127
137
|
const finalProductInfo = {
|
|
@@ -137,6 +147,7 @@ async function initCommand(options) {
|
|
|
137
147
|
websiteUrl: ${JSON.stringify(finalProductInfo.websiteUrl)},
|
|
138
148
|
pricingModel: ${JSON.stringify(finalProductInfo.pricingModel)},
|
|
139
149
|
features: ${JSON.stringify(finalProductInfo.features, null, 2)},
|
|
150
|
+
preferredProvider: ${JSON.stringify(finalProductInfo.preferredProvider)},
|
|
140
151
|
},
|
|
141
152
|
|
|
142
153
|
content: {
|
|
@@ -163,7 +174,8 @@ async function initCommand(options) {
|
|
|
163
174
|
`);
|
|
164
175
|
console.log(chalk.cyan("Next steps:"));
|
|
165
176
|
console.log(` 1. Review ${chalk.white("edtools.config.js")}`);
|
|
166
|
-
|
|
177
|
+
const providerMessage = finalProductInfo.preferredProvider === "openai" ? `export OPENAI_API_KEY=sk-...` : `export ANTHROPIC_API_KEY=sk-ant-...`;
|
|
178
|
+
console.log(` 2. Set your API key: ${chalk.white(providerMessage)}`);
|
|
167
179
|
console.log(` 3. Generate content: ${chalk.white("edtools generate")}
|
|
168
180
|
`);
|
|
169
181
|
}
|
|
@@ -188,12 +200,24 @@ async function generateCommand(options) {
|
|
|
188
200
|
console.log(chalk2.red("\u2717 Invalid configuration in edtools.config.js"));
|
|
189
201
|
process.exit(1);
|
|
190
202
|
}
|
|
191
|
-
const
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
203
|
+
const provider = productInfo.preferredProvider || "anthropic";
|
|
204
|
+
let apiKey;
|
|
205
|
+
if (provider === "anthropic") {
|
|
206
|
+
apiKey = options.apiKey || process.env.ANTHROPIC_API_KEY;
|
|
207
|
+
if (!apiKey) {
|
|
208
|
+
console.log(chalk2.red("\u2717 No Anthropic API key found"));
|
|
209
|
+
console.log(chalk2.yellow(" Set ANTHROPIC_API_KEY environment variable"));
|
|
210
|
+
console.log(chalk2.yellow(" Or use --api-key option\n"));
|
|
211
|
+
process.exit(1);
|
|
212
|
+
}
|
|
213
|
+
} else if (provider === "openai") {
|
|
214
|
+
apiKey = options.apiKey || process.env.OPENAI_API_KEY;
|
|
215
|
+
if (!apiKey) {
|
|
216
|
+
console.log(chalk2.red("\u2717 No OpenAI API key found"));
|
|
217
|
+
console.log(chalk2.yellow(" Set OPENAI_API_KEY environment variable"));
|
|
218
|
+
console.log(chalk2.yellow(" Or use --api-key option\n"));
|
|
219
|
+
process.exit(1);
|
|
220
|
+
}
|
|
197
221
|
}
|
|
198
222
|
const count = parseInt(options.posts, 10);
|
|
199
223
|
if (isNaN(count) || count < 1 || count > 10) {
|
|
@@ -209,10 +233,11 @@ async function generateCommand(options) {
|
|
|
209
233
|
console.log(chalk2.cyan("Configuration:"));
|
|
210
234
|
console.log(` Product: ${chalk2.white(productInfo.name)}`);
|
|
211
235
|
console.log(` Category: ${chalk2.white(productInfo.category)}`);
|
|
236
|
+
console.log(` AI Provider: ${chalk2.white(provider === "anthropic" ? "Claude (Anthropic)" : "ChatGPT (OpenAI)")}`);
|
|
212
237
|
console.log(` Posts to generate: ${chalk2.white(count)}`);
|
|
213
238
|
console.log(` Output directory: ${chalk2.white(outputDir)}
|
|
214
239
|
`);
|
|
215
|
-
const generator = new ContentGenerator(apiKey);
|
|
240
|
+
const generator = new ContentGenerator(apiKey, provider);
|
|
216
241
|
const generateConfig = {
|
|
217
242
|
productInfo,
|
|
218
243
|
topics: options.topics,
|
|
@@ -220,9 +245,12 @@ async function generateCommand(options) {
|
|
|
220
245
|
outputDir,
|
|
221
246
|
projectPath,
|
|
222
247
|
avoidDuplicates: true,
|
|
223
|
-
similarityThreshold: 0.85
|
|
248
|
+
similarityThreshold: 0.85,
|
|
249
|
+
provider,
|
|
250
|
+
apiKey
|
|
224
251
|
};
|
|
225
|
-
const
|
|
252
|
+
const providerName = provider === "anthropic" ? "Claude" : "ChatGPT";
|
|
253
|
+
const spinner = ora2(`Generating content with ${providerName}...`).start();
|
|
226
254
|
try {
|
|
227
255
|
const result = await generator.generate(generateConfig);
|
|
228
256
|
if (result.success && result.posts.length > 0) {
|
package/dist/core/generator.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { GenerateConfig, GenerateResult } from '../types/index.js';
|
|
1
|
+
import { GenerateConfig, GenerateResult, AIProvider } from '../types/index.js';
|
|
2
2
|
export declare class ContentGenerator {
|
|
3
3
|
private anthropic;
|
|
4
|
+
private openai;
|
|
5
|
+
private provider;
|
|
4
6
|
private adapters;
|
|
5
|
-
constructor(apiKey?: string);
|
|
7
|
+
constructor(apiKey?: string, provider?: AIProvider);
|
|
6
8
|
generate(config: GenerateConfig): Promise<GenerateResult>;
|
|
7
9
|
private generateContent;
|
|
10
|
+
private generateWithAnthropic;
|
|
11
|
+
private generateWithOpenAI;
|
|
8
12
|
private buildPrompt;
|
|
9
13
|
private generateSchemaOrg;
|
|
10
14
|
private calculateSEOScore;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../src/core/generator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../src/core/generator.ts"],"names":[],"mappings":"AAUA,OAAO,EAKL,cAAc,EACd,cAAc,EAEd,UAAU,EACX,MAAM,mBAAmB,CAAC;AAI3B,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,SAAS,CAA0B;IAC3C,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,QAAQ,CAAa;IAC7B,OAAO,CAAC,QAAQ,CAAkB;gBAEtB,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,GAAE,UAAwB;IAuBzD,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;YAsEjD,eAAe;YA2Cf,qBAAqB;YA+BrB,kBAAkB;IA8BhC,OAAO,CAAC,WAAW;IAkDnB,OAAO,CAAC,iBAAiB;YAwBX,iBAAiB;YAsCjB,cAAc;YA2Dd,aAAa;CAyB5B"}
|
package/dist/core/generator.js
CHANGED
|
@@ -1,16 +1,27 @@
|
|
|
1
1
|
import Anthropic from '@anthropic-ai/sdk';
|
|
2
|
+
import OpenAI from 'openai';
|
|
2
3
|
import path from 'path';
|
|
3
4
|
import fs from 'fs-extra';
|
|
4
5
|
import slugify from 'slugify';
|
|
5
6
|
import { AdapterRegistry } from '../types/adapter.js';
|
|
6
7
|
import { HTMLAdapter } from '../adapters/html/index.js';
|
|
7
8
|
export class ContentGenerator {
|
|
8
|
-
anthropic;
|
|
9
|
+
anthropic = null;
|
|
10
|
+
openai = null;
|
|
11
|
+
provider;
|
|
9
12
|
adapters;
|
|
10
|
-
constructor(apiKey) {
|
|
11
|
-
this.
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
constructor(apiKey, provider = 'anthropic') {
|
|
14
|
+
this.provider = provider;
|
|
15
|
+
if (provider === 'anthropic') {
|
|
16
|
+
this.anthropic = new Anthropic({
|
|
17
|
+
apiKey: apiKey || process.env.ANTHROPIC_API_KEY || '',
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
else if (provider === 'openai') {
|
|
21
|
+
this.openai = new OpenAI({
|
|
22
|
+
apiKey: apiKey || process.env.OPENAI_API_KEY || '',
|
|
23
|
+
});
|
|
24
|
+
}
|
|
14
25
|
this.adapters = new AdapterRegistry();
|
|
15
26
|
this.adapters.register(new HTMLAdapter());
|
|
16
27
|
}
|
|
@@ -63,23 +74,16 @@ export class ContentGenerator {
|
|
|
63
74
|
}
|
|
64
75
|
async generateContent(productInfo, topic) {
|
|
65
76
|
const prompt = this.buildPrompt(productInfo, topic);
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
],
|
|
76
|
-
});
|
|
77
|
-
const textContent = response.content[0].type === 'text' ? response.content[0].text : '';
|
|
78
|
-
const jsonMatch = textContent.match(/\{[\s\S]*\}/);
|
|
79
|
-
if (!jsonMatch) {
|
|
80
|
-
throw new Error('Failed to extract JSON from Claude response');
|
|
77
|
+
let contentData;
|
|
78
|
+
if (this.provider === 'anthropic') {
|
|
79
|
+
contentData = await this.generateWithAnthropic(prompt);
|
|
80
|
+
}
|
|
81
|
+
else if (this.provider === 'openai') {
|
|
82
|
+
contentData = await this.generateWithOpenAI(prompt);
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
throw new Error(`Unsupported provider: ${this.provider}`);
|
|
81
86
|
}
|
|
82
|
-
const contentData = JSON.parse(jsonMatch[0]);
|
|
83
87
|
const slug = slugify(contentData.metadata.title, { lower: true, strict: true });
|
|
84
88
|
const content = {
|
|
85
89
|
metadata: {
|
|
@@ -100,6 +104,50 @@ export class ContentGenerator {
|
|
|
100
104
|
};
|
|
101
105
|
return content;
|
|
102
106
|
}
|
|
107
|
+
async generateWithAnthropic(prompt) {
|
|
108
|
+
if (!this.anthropic) {
|
|
109
|
+
throw new Error('Anthropic client not initialized');
|
|
110
|
+
}
|
|
111
|
+
const response = await this.anthropic.messages.create({
|
|
112
|
+
model: 'claude-3-5-sonnet-20241022',
|
|
113
|
+
max_tokens: 4096,
|
|
114
|
+
temperature: 0.7,
|
|
115
|
+
messages: [
|
|
116
|
+
{
|
|
117
|
+
role: 'user',
|
|
118
|
+
content: prompt,
|
|
119
|
+
},
|
|
120
|
+
],
|
|
121
|
+
});
|
|
122
|
+
const textContent = response.content[0].type === 'text' ? response.content[0].text : '';
|
|
123
|
+
const jsonMatch = textContent.match(/\{[\s\S]*\}/);
|
|
124
|
+
if (!jsonMatch) {
|
|
125
|
+
throw new Error('Failed to extract JSON from Claude response');
|
|
126
|
+
}
|
|
127
|
+
return JSON.parse(jsonMatch[0]);
|
|
128
|
+
}
|
|
129
|
+
async generateWithOpenAI(prompt) {
|
|
130
|
+
if (!this.openai) {
|
|
131
|
+
throw new Error('OpenAI client not initialized');
|
|
132
|
+
}
|
|
133
|
+
const response = await this.openai.chat.completions.create({
|
|
134
|
+
model: 'gpt-4-turbo-preview',
|
|
135
|
+
max_tokens: 4096,
|
|
136
|
+
temperature: 0.7,
|
|
137
|
+
messages: [
|
|
138
|
+
{
|
|
139
|
+
role: 'user',
|
|
140
|
+
content: prompt,
|
|
141
|
+
},
|
|
142
|
+
],
|
|
143
|
+
response_format: { type: 'json_object' },
|
|
144
|
+
});
|
|
145
|
+
const textContent = response.choices[0]?.message?.content || '';
|
|
146
|
+
if (!textContent) {
|
|
147
|
+
throw new Error('Failed to get response from OpenAI');
|
|
148
|
+
}
|
|
149
|
+
return JSON.parse(textContent);
|
|
150
|
+
}
|
|
103
151
|
buildPrompt(productInfo, topic) {
|
|
104
152
|
return `You are an expert SEO content writer. Generate a comprehensive blog post about: "${topic}"
|
|
105
153
|
|
|
@@ -204,15 +252,35 @@ Requirements:
|
|
|
204
252
|
|
|
205
253
|
Output ONLY a JSON array of topic strings, no markdown:
|
|
206
254
|
["Topic 1", "Topic 2", "Topic 3"]`;
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
255
|
+
try {
|
|
256
|
+
if (this.provider === 'anthropic' && this.anthropic) {
|
|
257
|
+
const response = await this.anthropic.messages.create({
|
|
258
|
+
model: 'claude-3-5-sonnet-20241022',
|
|
259
|
+
max_tokens: 1024,
|
|
260
|
+
messages: [{ role: 'user', content: prompt }],
|
|
261
|
+
});
|
|
262
|
+
const textContent = response.content[0].type === 'text' ? response.content[0].text : '';
|
|
263
|
+
const jsonMatch = textContent.match(/\[[\s\S]*\]/);
|
|
264
|
+
if (jsonMatch) {
|
|
265
|
+
return JSON.parse(jsonMatch[0]);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
else if (this.provider === 'openai' && this.openai) {
|
|
269
|
+
const response = await this.openai.chat.completions.create({
|
|
270
|
+
model: 'gpt-4-turbo-preview',
|
|
271
|
+
max_tokens: 1024,
|
|
272
|
+
messages: [{ role: 'user', content: prompt }],
|
|
273
|
+
response_format: { type: 'json_object' },
|
|
274
|
+
});
|
|
275
|
+
const textContent = response.choices[0]?.message?.content || '';
|
|
276
|
+
if (textContent) {
|
|
277
|
+
const data = JSON.parse(textContent);
|
|
278
|
+
return data.topics || data;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
catch (error) {
|
|
283
|
+
console.warn('Failed to generate topics with AI, using fallback');
|
|
216
284
|
}
|
|
217
285
|
return [
|
|
218
286
|
`Best ${productInfo.category} software ${new Date().getFullYear()}`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../src/core/generator.ts"],"names":[],"mappings":"AAKA,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAC1C,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,OAAO,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../src/core/generator.ts"],"names":[],"mappings":"AAKA,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAC1C,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,OAAO,MAAM,SAAS,CAAC;AAW9B,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC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B,WAAmB,EACnB,OAAe,EACf,KAA6C;QAE7C,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;QAG1D,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YAC5B,OAAO;WACF,IAAI,CAAC,IAAI;eACL,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;;;SAG5C,CAAC;QACN,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEd,MAAM,OAAO,GAAG;;EAElB,IAAI;UACI,CAAC;QAEP,MAAM,EAAE,CAAC,SAAS,CAAC,WAAW,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QAClD,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IACzC,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
type AIProvider = 'anthropic' | 'openai';
|
|
1
2
|
interface BlogPostMetadata {
|
|
2
3
|
title: string;
|
|
3
4
|
description: string;
|
|
@@ -94,6 +95,7 @@ interface ProductInfo {
|
|
|
94
95
|
pricingDetails?: string;
|
|
95
96
|
websiteUrl: string;
|
|
96
97
|
keywords?: string[];
|
|
98
|
+
preferredProvider?: AIProvider;
|
|
97
99
|
}
|
|
98
100
|
interface GenerateConfig {
|
|
99
101
|
productInfo: ProductInfo;
|
|
@@ -103,6 +105,8 @@ interface GenerateConfig {
|
|
|
103
105
|
projectPath: string;
|
|
104
106
|
avoidDuplicates?: boolean;
|
|
105
107
|
similarityThreshold?: number;
|
|
108
|
+
provider?: AIProvider;
|
|
109
|
+
apiKey?: string;
|
|
106
110
|
}
|
|
107
111
|
interface GenerateResult {
|
|
108
112
|
success: boolean;
|
|
@@ -139,10 +143,14 @@ declare class AdapterRegistry {
|
|
|
139
143
|
|
|
140
144
|
declare class ContentGenerator {
|
|
141
145
|
private anthropic;
|
|
146
|
+
private openai;
|
|
147
|
+
private provider;
|
|
142
148
|
private adapters;
|
|
143
|
-
constructor(apiKey?: string);
|
|
149
|
+
constructor(apiKey?: string, provider?: AIProvider);
|
|
144
150
|
generate(config: GenerateConfig): Promise<GenerateResult>;
|
|
145
151
|
private generateContent;
|
|
152
|
+
private generateWithAnthropic;
|
|
153
|
+
private generateWithOpenAI;
|
|
146
154
|
private buildPrompt;
|
|
147
155
|
private generateSchemaOrg;
|
|
148
156
|
private calculateSEOScore;
|
|
@@ -167,4 +175,4 @@ declare class HTMLAdapter implements Adapter {
|
|
|
167
175
|
private escapeHtml;
|
|
168
176
|
}
|
|
169
177
|
|
|
170
|
-
export { type Adapter, type AdapterConfig, AdapterRegistry, type BlogPostContent, type BlogPostMetadata, type CTAData, type CodeData, type ComparisonData, ContentGenerator, type ContentSection, type GenerateConfig, type GenerateResult, HTMLAdapter, type ListData, type ProductInfo, type RelatedPost, type SEOData, type SchemaOrgData };
|
|
178
|
+
export { type AIProvider, type Adapter, type AdapterConfig, AdapterRegistry, type BlogPostContent, type BlogPostMetadata, type CTAData, type CodeData, type ComparisonData, ContentGenerator, type ContentSection, type GenerateConfig, type GenerateResult, HTMLAdapter, type ListData, type ProductInfo, type RelatedPost, type SEOData, type SchemaOrgData };
|
package/dist/index.js
CHANGED
package/dist/types/content.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export type AIProvider = 'anthropic' | 'openai';
|
|
1
2
|
export interface BlogPostMetadata {
|
|
2
3
|
title: string;
|
|
3
4
|
description: string;
|
|
@@ -94,6 +95,7 @@ export interface ProductInfo {
|
|
|
94
95
|
pricingDetails?: string;
|
|
95
96
|
websiteUrl: string;
|
|
96
97
|
keywords?: string[];
|
|
98
|
+
preferredProvider?: AIProvider;
|
|
97
99
|
}
|
|
98
100
|
export interface GenerateConfig {
|
|
99
101
|
productInfo: ProductInfo;
|
|
@@ -103,6 +105,8 @@ export interface GenerateConfig {
|
|
|
103
105
|
projectPath: string;
|
|
104
106
|
avoidDuplicates?: boolean;
|
|
105
107
|
similarityThreshold?: number;
|
|
108
|
+
provider?: AIProvider;
|
|
109
|
+
apiKey?: string;
|
|
106
110
|
}
|
|
107
111
|
export interface GenerateResult {
|
|
108
112
|
success: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/types/content.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/types/content.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,QAAQ,CAAC;AAEhD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,aAAa,GAAG,SAAS,CAAC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE;QACN,OAAO,EAAE,QAAQ,GAAG,cAAc,CAAC;QACnC,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,GAAG,CAAC,EAAE,MAAM,CAAC;KACd,CAAC;IACF,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE;QACV,OAAO,EAAE,cAAc,CAAC;QACxB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE;YACL,OAAO,EAAE,aAAa,CAAC;YACvB,GAAG,EAAE,MAAM,CAA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EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC,CAAC;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edtools/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Generate SEO-optimized content for LLM discovery - CLI tool",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"fs-extra": "^11.2.0",
|
|
35
35
|
"inquirer": "^9.2.12",
|
|
36
36
|
"marked": "^11.1.1",
|
|
37
|
+
"openai": "^6.15.0",
|
|
37
38
|
"ora": "^8.0.1",
|
|
38
39
|
"slugify": "^1.6.6"
|
|
39
40
|
},
|