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.
Files changed (2) hide show
  1. package/dist/cli.js +86 -68
  2. 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
- console.clear();
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('v0.2.1')} ${chalk.gray('·')} ${chalk.gray('AI Command Center for Marketers')}`,
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
- 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;
300
- }
301
- if (action === 'setup') {
302
- await runSetup();
303
- return;
304
- }
305
- if (action === 'doctor') {
306
- await runDoctor();
307
- return;
308
- }
309
- if (action === 'skills') {
310
- showSkills();
311
- return;
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
- else if (config.metaToken && config.connectGoogle) {
323
- auditTemplate = '/audit-campaigns';
301
+ if (action === 'setup') {
302
+ await runSetup();
303
+ return;
324
304
  }
325
- finalArgs = [auditTemplate];
326
- }
327
- else {
328
- const actionMap = {
329
- chat: [],
330
- copy: ['/write-ad-copy'],
331
- autoresearch: ['/autoresearch-plan'],
332
- gtm: ['/go-to-market'],
333
- };
334
- finalArgs = actionMap[action] || [];
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openads-ai",
3
- "version": "0.2.20",
3
+ "version": "0.2.22",
4
4
  "description": "Open-source AI command center for digital marketers. Audit campaigns, write ad copy, and build strategies — from your terminal.",
5
5
  "main": "dist/cli.js",
6
6
  "bin": {