@zibby/cli 0.1.14 → 0.1.16

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/bin/zibby.js CHANGED
@@ -38,7 +38,7 @@ program
38
38
  .option('--headless', 'Run MCP browser in headless mode (hidden browser)')
39
39
  .option('--api-key <key>', 'Zibby API key for cloud sync')
40
40
  .option('--cloud-sync', 'Enable cloud sync and install Zibby MCP')
41
- .option('-m, --mem', 'Enable test memory (initializes Dolt DB, adds ZIBBY_MEMORY to .env)')
41
+ .option('-m, --mem', 'Enable test memory (initializes Dolt DB and includes memory skill)')
42
42
  .action(initCommand);
43
43
 
44
44
  program
@@ -69,12 +69,7 @@ program
69
69
  } else if (options.verbose) {
70
70
  process.env.ZIBBY_VERBOSE = 'true';
71
71
  }
72
- if (options.mem) {
73
- process.env.ZIBBY_MEMORY = '1';
74
- process.env.ZIBBY_EXTRA_SKILLS = process.env.ZIBBY_EXTRA_SKILLS
75
- ? `${process.env.ZIBBY_EXTRA_SKILLS},memory`
76
- : 'memory';
77
- }
72
+ // --mem flag is handled by init command when generating files
78
73
  return runCommand(specPath, options);
79
74
  });
80
75
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zibby/cli",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
4
4
  "description": "Zibby CLI - Test automation generator and runner",
5
5
  "type": "module",
6
6
  "bin": {
@@ -32,8 +32,8 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@aws-sdk/client-sqs": "^3.1000.0",
35
- "@zibby/skills": "^0.1.0",
36
- "@zibby/core": "^0.1.11",
35
+ "@zibby/skills": "^0.1.2",
36
+ "@zibby/core": "^0.1.13",
37
37
  "chalk": "^5.3.0",
38
38
  "commander": "^12.0.0",
39
39
  "dotenv": "^17.2.3",
@@ -10,14 +10,6 @@ import { fileURLToPath } from 'url';
10
10
  const __filename = fileURLToPath(import.meta.url);
11
11
  const __dirname = dirname(__filename);
12
12
 
13
- const MEMORY_ENV_BLOCK = `
14
- # Test Memory (Dolt-backed — learns from every run)
15
- ZIBBY_MEMORY=1
16
- # ZIBBY_MEMORY_COMPACT_EVERY=1500 # Auto-compact every N runs (0 to disable)
17
- # ZIBBY_MEMORY_MAX_RUNS=3000 # Max runs per spec to keep
18
- # ZIBBY_MEMORY_MAX_AGE=1095 # Max age in days for stale data (~3 years)
19
- `;
20
-
21
13
  export async function initCommand(projectName, options) {
22
14
  console.log(chalk.bold.cyan('\nšŸŽ­ Welcome to Zibby Test Automation!\n'));
23
15
 
@@ -171,10 +163,10 @@ export async function initCommand(projectName, options) {
171
163
  for (const file of nodeFiles) {
172
164
  let content = await readFile(join(nodesPath, file), 'utf-8');
173
165
 
174
- // If --mem flag NOT used, remove memory skill from execute-live.mjs
166
+ // If --mem flag NOT used, remove SKILLS.MEMORY from execute-live.mjs
175
167
  if (!options.mem && file === 'execute-live.mjs') {
176
168
  content = content.replace(
177
- /skills: \[SKILLS\.BROWSER, \.\.\.\(process\.env\.ZIBBY_MEMORY \? \[SKILLS\.MEMORY\] : \[\]\)\],/,
169
+ 'skills: [SKILLS.BROWSER, SKILLS.MEMORY],',
178
170
  'skills: [SKILLS.BROWSER],'
179
171
  );
180
172
  }
@@ -201,18 +193,6 @@ export async function initCommand(projectName, options) {
201
193
  await createOrUpdateEnvFile(targetDir, answers.apiKey.trim(), answers, options);
202
194
  }
203
195
 
204
- // Ensure ZIBBY_MEMORY=1 is in .env when --mem is used (even without API key)
205
- if (options.mem) {
206
- const envPath = join(targetDir, '.env');
207
- if (existsSync(envPath)) {
208
- const existingEnv = await readFile(envPath, 'utf-8');
209
- if (!existingEnv.includes('ZIBBY_MEMORY=')) {
210
- await writeFile(envPath, existingEnv + MEMORY_ENV_BLOCK);
211
- }
212
- } else {
213
- await writeFile(envPath, generateEnvFile(answers, options));
214
- }
215
- }
216
196
 
217
197
  // Create package.json for new projects only (don't modify existing ones)
218
198
  if (isNewProject) {
@@ -455,8 +435,8 @@ function generateConfig(answers, _options = {}) {
455
435
  `;
456
436
  }
457
437
 
458
- function generateEnvFile(answers, options = {}) {
459
- let content = `# Zibby Test Automation - Environment Variables
438
+ function generateEnvFile(answers, _options = {}) {
439
+ const content = `# Zibby Test Automation - Environment Variables
460
440
 
461
441
  # AI Provider Keys
462
442
  ${answers.agent === 'claude' ? '# Claude (Anthropic) - Direct API\nANTHROPIC_API_KEY=sk-ant-your_key_here\n' : '# ANTHROPIC_API_KEY=sk-ant-your_key_here\n'}
@@ -470,10 +450,6 @@ ${answers.agent === 'cursor' ? '# Cursor Agent (uses cursor-agent CLI)\n# No API
470
450
  # SLACK_WEBHOOK_URL=https://hooks.slack.com/services/YOUR/WEBHOOK/URL
471
451
  `;
472
452
 
473
- if (options.mem) {
474
- content += MEMORY_ENV_BLOCK;
475
- }
476
-
477
453
  return content;
478
454
  }
479
455
 
@@ -495,10 +471,6 @@ async function createOrUpdateEnvFile(targetDir, apiKey, answers, options = {}) {
495
471
  } else {
496
472
  envContent += `\n# Zibby Cloud Sync\nZIBBY_API_KEY=${apiKey}\n`;
497
473
  }
498
-
499
- if (options.mem && !envContent.includes('ZIBBY_MEMORY=')) {
500
- envContent += MEMORY_ENV_BLOCK;
501
- }
502
474
  } catch (_error) {
503
475
  envContent = generateEnvFileWithKey(answers, apiKey, options);
504
476
  }
@@ -509,8 +481,8 @@ async function createOrUpdateEnvFile(targetDir, apiKey, answers, options = {}) {
509
481
  await writeFile(envPath, envContent);
510
482
  }
511
483
 
512
- function generateEnvFileWithKey(answers, apiKey, options = {}) {
513
- let content = `# Zibby Test Automation - Environment Variables
484
+ function generateEnvFileWithKey(answers, apiKey, _options = {}) {
485
+ const content = `# Zibby Test Automation - Environment Variables
514
486
 
515
487
  # AI Provider Keys
516
488
  ${answers.agent === 'claude' ? 'ANTHROPIC_API_KEY=sk-ant-your_key_here\n' : '# ANTHROPIC_API_KEY=sk-ant-your_key_here\n'}
@@ -522,10 +494,6 @@ ZIBBY_API_KEY=${apiKey}
522
494
  # SLACK_WEBHOOK_URL=https://hooks.slack.com/services/YOUR/WEBHOOK/URL
523
495
  `;
524
496
 
525
- if (options.mem) {
526
- content += MEMORY_ENV_BLOCK;
527
- }
528
-
529
497
  return content;
530
498
  }
531
499
 
@@ -762,33 +762,6 @@ export async function runCommand(specPath, options) {
762
762
  console.log(chalk.gray(`Mode: Orphan execution (History tab)`));
763
763
  }
764
764
 
765
- if (process.env.ZIBBY_MEMORY) {
766
- try {
767
- const { DoltDB } = await import('@zibby/memory');
768
- const doltAvailable = DoltDB.isAvailable();
769
- const dbExists = existsSync(join(process.cwd(), '.zibby', 'memory', '.dolt'));
770
-
771
- if (!doltAvailable) {
772
- console.log(chalk.red(`\nāŒ Memory requires Dolt but it's not installed\n`));
773
- console.log(chalk.white(` Install:`));
774
- console.log(chalk.gray(` brew install dolt # macOS`));
775
- console.log(chalk.gray(` curl -L https://github.com/dolthub/dolt/releases/latest/download/install.sh | sudo bash # Linux\n`));
776
- console.log(chalk.white(` Then initialize:`));
777
- console.log(chalk.gray(` zibby init --mem\n`));
778
- process.exit(1);
779
- } else if (!dbExists) {
780
- console.log(chalk.red(`\nāŒ Memory database not initialized\n`));
781
- console.log(chalk.white(` Run:`));
782
- console.log(chalk.gray(` zibby init --mem\n`));
783
- process.exit(1);
784
- } else {
785
- console.log(chalk.white(`Memory: ${chalk.green('enabled')}`));
786
- }
787
- } catch {
788
- console.log(chalk.red(`\nāŒ Memory requested but @zibby/memory package is not available\n`));
789
- process.exit(1);
790
- }
791
- }
792
765
 
793
766
  console.log(chalk.gray('━'.repeat(50)));
794
767
 
@@ -912,12 +885,6 @@ export async function runCommand(specPath, options) {
912
885
  spinner.stop();
913
886
  }
914
887
 
915
- if (process.env.ZIBBY_MEMORY) {
916
- try {
917
- const { memoryEndRun } = await import('@zibby/memory');
918
- memoryEndRun(process.cwd(), { passed: false });
919
- } catch { /* @zibby/memory not available */ }
920
- }
921
888
 
922
889
  console.log(chalk.red('\nāœ– Test failed\n'));
923
890