openads-ai 0.2.20 → 0.2.22
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/cli.js +86 -68
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -12,6 +12,7 @@ import { runSetup } from './setup.js';
|
|
|
12
12
|
import { runDoctor } from './doctor.js';
|
|
13
13
|
import { runScheduleManager, runScheduledTask, openReportInBrowser, listReports } from './schedule.js';
|
|
14
14
|
import enquirer from 'enquirer';
|
|
15
|
+
import readline from 'readline';
|
|
15
16
|
const __filename = fileURLToPath(import.meta.url);
|
|
16
17
|
const __dirname = path.dirname(__filename);
|
|
17
18
|
const pkgDir = path.resolve(__dirname, '..');
|
|
@@ -199,9 +200,6 @@ function showSkills() {
|
|
|
199
200
|
console.log('');
|
|
200
201
|
}
|
|
201
202
|
console.log(chalk.gray(' ─────────────────────────────────────────────────────'));
|
|
202
|
-
console.log(` ${chalk.bold.white('Want more?')} 30+ community skills available at:`);
|
|
203
|
-
console.log(` ${chalk.cyan('https://github.com/coreyhaines31/marketingskills')}`);
|
|
204
|
-
console.log('');
|
|
205
203
|
console.log(chalk.gray(' To add a skill, drop a .md file into the skills/ folder.'));
|
|
206
204
|
console.log(chalk.gray(' The agent picks them up automatically — no code needed.'));
|
|
207
205
|
console.log('');
|
|
@@ -249,10 +247,7 @@ async function main() {
|
|
|
249
247
|
return;
|
|
250
248
|
}
|
|
251
249
|
// ─── Splash Screen ──────────────────────────────────────────────
|
|
252
|
-
|
|
253
|
-
console.log('');
|
|
254
|
-
console.log(openadsGradient(LOGO));
|
|
255
|
-
console.log('');
|
|
250
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(pkgDir, 'package.json'), 'utf8'));
|
|
256
251
|
const cleanProvider = resolveModel(config.provider);
|
|
257
252
|
const modelName = chalk.cyan.bold(cleanProvider);
|
|
258
253
|
const googleStatus = config.connectGoogle ? chalk.green('● Connected') : chalk.gray('○ Not connected');
|
|
@@ -265,73 +260,96 @@ async function main() {
|
|
|
265
260
|
` ${chalk.bold.white('Google Ads')} ${googleStatus}`,
|
|
266
261
|
` ${chalk.bold.white('Meta Ads')} ${metaStatus}`,
|
|
267
262
|
'',
|
|
268
|
-
` ${chalk.gray(
|
|
263
|
+
` ${chalk.gray(`v${pkg.version}`)} ${chalk.gray('·')} ${chalk.gray('AI Command Center for Marketers')}`,
|
|
269
264
|
].join('\n');
|
|
270
|
-
console.log(boxen(statusLines, {
|
|
271
|
-
padding: { top: 1, bottom: 1, left: 2, right: 2 },
|
|
272
|
-
margin: { top: 0, bottom: 1, left: 2, right: 2 },
|
|
273
|
-
borderStyle: 'round',
|
|
274
|
-
borderColor: 'cyan',
|
|
275
|
-
dimBorder: true,
|
|
276
|
-
}));
|
|
277
265
|
// ─── Interactive Menu (when no args) ────────────────────────────
|
|
278
266
|
let finalArgs = [...args];
|
|
279
267
|
if (args.length === 0) {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
{
|
|
287
|
-
{
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
}
|
|
313
|
-
if (action === 'schedule') {
|
|
314
|
-
await runScheduleManager();
|
|
315
|
-
return;
|
|
316
|
-
}
|
|
317
|
-
if (action === 'audit') {
|
|
318
|
-
let auditTemplate = '/audit-google-ads';
|
|
319
|
-
if (config.metaToken && !config.connectGoogle) {
|
|
320
|
-
auditTemplate = '/audit-meta-ads';
|
|
268
|
+
while (true) {
|
|
269
|
+
console.clear();
|
|
270
|
+
console.log('');
|
|
271
|
+
console.log(openadsGradient(LOGO));
|
|
272
|
+
console.log('');
|
|
273
|
+
console.log(boxen(statusLines, {
|
|
274
|
+
padding: { top: 1, bottom: 1, left: 2, right: 2 },
|
|
275
|
+
margin: { top: 0, bottom: 1, left: 2, right: 2 },
|
|
276
|
+
borderStyle: 'round',
|
|
277
|
+
borderColor: 'cyan',
|
|
278
|
+
dimBorder: true,
|
|
279
|
+
}));
|
|
280
|
+
const { action } = await enquirer.prompt({
|
|
281
|
+
type: 'select',
|
|
282
|
+
name: 'action',
|
|
283
|
+
message: chalk.bold('What would you like to do?'),
|
|
284
|
+
choices: [
|
|
285
|
+
{ name: 'chat', message: `${chalk.cyan('💬')} Ask anything` },
|
|
286
|
+
{ name: 'audit', message: `${chalk.cyan('🔍')} Audit my ad campaigns ${chalk.gray('(audit)')}` },
|
|
287
|
+
{ name: 'copy', message: `${chalk.cyan('✍️')} Write ad copy for any platform ${chalk.gray('(copywriting)')}` },
|
|
288
|
+
{ name: 'autoresearch', message: `${chalk.cyan('🔄')} Test and improve ideas automatically ${chalk.gray('(autoresearch)')}` },
|
|
289
|
+
{ name: 'gtm', message: `${chalk.cyan('📈')} Build a go-to-market plan ${chalk.gray('(strategy)')}` },
|
|
290
|
+
{ name: 'skills', message: `${chalk.cyan('📚')} Browse available skills` },
|
|
291
|
+
{ name: 'schedule', message: `${chalk.cyan('⏰')} Schedule automations` },
|
|
292
|
+
{ name: 'setup', message: `${chalk.gray('⚙️')} Settings` },
|
|
293
|
+
{ name: 'doctor', message: `${chalk.gray('🩺')} Diagnostics` },
|
|
294
|
+
{ name: 'exit', message: `${chalk.gray('❌')} Exit` }
|
|
295
|
+
]
|
|
296
|
+
});
|
|
297
|
+
if (action === 'exit') {
|
|
298
|
+
console.log(chalk.cyan('\n Goodbye! Keep marketing 🎯\n'));
|
|
299
|
+
return;
|
|
321
300
|
}
|
|
322
|
-
|
|
323
|
-
|
|
301
|
+
if (action === 'setup') {
|
|
302
|
+
await runSetup();
|
|
303
|
+
return;
|
|
324
304
|
}
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
305
|
+
if (action === 'doctor') {
|
|
306
|
+
await runDoctor();
|
|
307
|
+
console.log(chalk.cyan('\n Press Enter to go back to the menu...'));
|
|
308
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
309
|
+
await new Promise(resolve => {
|
|
310
|
+
rl.question('', () => {
|
|
311
|
+
rl.close();
|
|
312
|
+
resolve();
|
|
313
|
+
});
|
|
314
|
+
});
|
|
315
|
+
continue;
|
|
316
|
+
}
|
|
317
|
+
if (action === 'skills') {
|
|
318
|
+
showSkills();
|
|
319
|
+
console.log(chalk.cyan('\n Press Enter to go back to the menu...'));
|
|
320
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
321
|
+
await new Promise(resolve => {
|
|
322
|
+
rl.question('', () => {
|
|
323
|
+
rl.close();
|
|
324
|
+
resolve();
|
|
325
|
+
});
|
|
326
|
+
});
|
|
327
|
+
continue;
|
|
328
|
+
}
|
|
329
|
+
if (action === 'schedule') {
|
|
330
|
+
await runScheduleManager();
|
|
331
|
+
continue;
|
|
332
|
+
}
|
|
333
|
+
if (action === 'audit') {
|
|
334
|
+
let auditTemplate = '/audit-google-ads';
|
|
335
|
+
if (config.metaToken && !config.connectGoogle) {
|
|
336
|
+
auditTemplate = '/audit-meta-ads';
|
|
337
|
+
}
|
|
338
|
+
else if (config.metaToken && config.connectGoogle) {
|
|
339
|
+
auditTemplate = '/audit-campaigns';
|
|
340
|
+
}
|
|
341
|
+
finalArgs = [auditTemplate];
|
|
342
|
+
}
|
|
343
|
+
else {
|
|
344
|
+
const actionMap = {
|
|
345
|
+
chat: [],
|
|
346
|
+
copy: ['/write-ad-copy'],
|
|
347
|
+
autoresearch: ['/autoresearch-plan'],
|
|
348
|
+
gtm: ['/go-to-market'],
|
|
349
|
+
};
|
|
350
|
+
finalArgs = actionMap[action] || [];
|
|
351
|
+
}
|
|
352
|
+
break;
|
|
335
353
|
}
|
|
336
354
|
}
|
|
337
355
|
// ─── Loading Spinner ────────────────────────────────────────────
|
package/package.json
CHANGED