skopix 2.0.7 → 2.0.9

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.
@@ -60,6 +60,23 @@ async function promptAndAuth(serverUrl, secretKey) {
60
60
  } catch {}
61
61
 
62
62
  console.log(chalk.cyan(' Enter your Skopix dashboard login to identify this agent:'));
63
+
64
+ // Auto mode — skip interactive prompt, use SKOPIX_AGENT_EMAIL/PASSWORD env vars or connect anonymously
65
+ if (process.env.SKOPIX_AUTO_AGENT === '1') {
66
+ const email = process.env.SKOPIX_AGENT_EMAIL || '';
67
+ const password = process.env.SKOPIX_AGENT_PASSWORD || '';
68
+ if (email && password) {
69
+ const res = await fetch(serverUrl + '/api/agent/auth', {
70
+ method: 'POST',
71
+ headers: { 'Content-Type': 'application/json', 'x-skopix-key': secretKey },
72
+ body: JSON.stringify({ email, password }),
73
+ });
74
+ const data = await res.json();
75
+ if (res.ok) return data;
76
+ }
77
+ console.log(chalk.dim(' Auto-agent: connecting anonymously (set SKOPIX_AGENT_EMAIL and SKOPIX_AGENT_PASSWORD to identify)'));
78
+ return { userId: null, name: os.hostname() };
79
+ }
63
80
  const email = await prompt(' Email: ');
64
81
  const password = await prompt(' Password: ', true);
65
82
 
@@ -2027,17 +2027,20 @@ export async function dashboardCommand(options) {
2027
2027
  if (options.agent) {
2028
2028
  const key = process.env.SKOPIX_SECRET_KEY;
2029
2029
  if (key) {
2030
- console.log(chalk.cyan(' [agent]') + ' Auto-starting agent on this machine...');
2031
- import('child_process').then(({ spawn }) => {
2032
- const agentProc = spawn(process.execPath, [process.argv[1], 'agent', '--server', `http://localhost:${port}`, '--key', key], {
2033
- stdio: 'inherit',
2034
- env: { ...process.env },
2035
- });
2036
- agentProc.on('exit', (code) => {
2037
- if (code !== 0) console.log(chalk.yellow(' [agent] Agent exited with code ' + code));
2030
+ // Wait 2s for server to be fully ready before spawning agent
2031
+ setTimeout(() => {
2032
+ console.log(chalk.cyan(' [agent]') + ' Auto-starting agent on this machine...');
2033
+ import('child_process').then(({ spawn }) => {
2034
+ const agentProc = spawn(process.execPath, [process.argv[1], 'agent', '--server', `http://localhost:${port}`, '--key', key], {
2035
+ stdio: 'inherit',
2036
+ env: { ...process.env, SKOPIX_AUTO_AGENT: '1', SKOPIX_NO_BANNER: '1' },
2037
+ });
2038
+ agentProc.on('exit', (code) => {
2039
+ if (code !== 0) console.log(chalk.yellow(' [agent] Agent exited with code ' + code));
2040
+ });
2041
+ process.on('SIGINT', () => { agentProc.kill(); });
2038
2042
  });
2039
- process.on('SIGINT', () => { agentProc.kill(); });
2040
- });
2043
+ }, 2000);
2041
2044
  } else {
2042
2045
  console.log(chalk.yellow(' ⚠ --agent flag set but SKOPIX_SECRET_KEY not found, skipping auto-agent'));
2043
2046
  }
package/cli/index.js CHANGED
@@ -18,8 +18,10 @@ const banner = chalk.cyan(`
18
18
  ╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
19
19
  `);
20
20
 
21
- console.log(banner);
22
- console.log(chalk.dim(' AI-powered QA agent. Tests your app like a human would.\n'));
21
+ if (!process.env.SKOPIX_NO_BANNER) {
22
+ console.log(banner);
23
+ console.log(chalk.dim(' AI-powered QA agent. Tests your app like a human would.\n'));
24
+ }
23
25
 
24
26
  program
25
27
  .name('skopix')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skopix",
3
- "version": "2.0.7",
3
+ "version": "2.0.9",
4
4
  "description": "Browser-based QA tool — record tests by using your app, replay them deterministically, generate Playwright code automatically",
5
5
  "main": "cli/index.js",
6
6
  "bin": {
package/web/index.html CHANGED
@@ -469,7 +469,7 @@ footer { border-top: 1px solid var(--border); padding: 48px; display: flex; alig
469
469
  <div class="code-block observe">
470
470
  <div><span class="code-cmd">$</span> npm install -g skopix</div>
471
471
  <div><span class="code-cmd">$</span> npx playwright install chromium</div>
472
- <div class="code-out">→ Installs Skopix CLI and the Chromium browser for recording and replay</div>
472
+ <div class="code-out">→ Installs the Skopix CLI and Chromium browser on your machine</div>
473
473
  </div>
474
474
 
475
475
  <div class="code-label observe">2. CONFIGURE YOUR AI PROVIDER</div>
@@ -487,32 +487,83 @@ footer { border-top: 1px solid var(--border); padding: 48px; display: flex; alig
487
487
  <div class="code-out">→ Click "Record test" to start your first recording</div>
488
488
  </div>
489
489
 
490
- <div class="code-label observe">3B. TEAM MODE — SHARE WITH YOUR TEAM</div>
490
+ <div class="code-label observe">3B. TEAM MODE — ONE COMMAND STARTS EVERYTHING</div>
491
491
  <div class="code-block observe">
492
- <div><span class="code-cmd">$</span> <span class="code-val">SKOPIX_SECRET_KEY</span>="your-long-secret" skopix dashboard --team --host 0.0.0.0</div>
493
- <div class="code-out">→ Visit http://localhost:9000/setup to create the first admin account</div>
494
- <div class="code-out">→ Invite teammates from the Users tab</div>
495
- <div class="code-out">→ Share your IP or use "portix 9000" for remote access</div>
492
+ <div class="code-comment"># Set your secret key once (saves permanently):</div>
493
+ <div><span class="code-cmd">$</span> echo 'SKOPIX_SECRET_KEY=your-secret' >> ~/.skopix.env</div>
494
+ <div class="code-comment"># Then just run:</div>
495
+ <div><span class="code-cmd">$</span> skopix start</div>
496
+ <div class="code-out">→ Starts the dashboard in team mode</div>
497
+ <div class="code-out">→ Starts the agent on your machine automatically</div>
498
+ <div class="code-out">→ Teammates connect via http://YOUR-IP:9000</div>
499
+ </div>
500
+
501
+ <div class="code-label observe">3C. TEAMMATES — CONNECT AS AN AGENT</div>
502
+ <div class="code-block observe">
503
+ <div class="code-comment"># Each teammate runs this on their own machine:</div>
504
+ <div><span class="code-cmd">$</span> npm install -g skopix</div>
505
+ <div><span class="code-cmd">$</span> npx playwright install chromium</div>
506
+ <div><span class="code-cmd">$</span> skopix agent --server http://HOST-IP:9000 --key "your-secret"</div>
507
+ <div class="code-out">→ Prompts for Skopix dashboard login to identify your machine</div>
508
+ <div class="code-out">→ Chrome opens on YOUR machine when you trigger tests</div>
509
+ <div class="code-out">→ Leave it running in a terminal while you work</div>
496
510
  </div>
497
511
 
498
512
  <div class="code-label observe">USING OLLAMA (LOCAL AI — NO API KEY NEEDED)</div>
499
513
  <div class="code-block observe">
500
514
  <div class="code-comment"># Install Ollama from https://ollama.ai, then:</div>
501
515
  <div><span class="code-cmd">$</span> ollama pull llama3.1</div>
502
- <div class="code-comment"># In .skopix.env:</div>
516
+ <div class="code-comment"># In ~/.skopix.env or via My Settings in the dashboard:</div>
503
517
  <div><span class="code-val">SKOPIX_PROVIDER</span>=ollama</div>
504
518
  <div><span class="code-val">OLLAMA_MODEL</span>=llama3.1</div>
505
519
  <div class="code-out">→ AI runs entirely on your machine. No data leaves. No cost.</div>
506
520
  </div>
507
521
 
508
- <div class="code-label observe">RECOMMENDED: RUN ON YOUR OWN MACHINE</div>
522
+ <div style="margin-top:40px;background:var(--surface);border:1px solid var(--border-bright);border-radius:12px;padding:28px 32px" class="observe">
523
+ <div style="font-family:var(--mono);font-size:10px;color:var(--cyan);letter-spacing:0.15em;margin-bottom:16px">HOW IT ALL FITS TOGETHER</div>
524
+ <div style="display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:24px;font-family:var(--mono);font-size:12px;line-height:1.8">
525
+ <div>
526
+ <div style="color:var(--white);margin-bottom:6px">1 person hosts</div>
527
+ <div style="color:var(--muted)">Runs <code style="color:var(--cyan)">skopix dashboard --team</code> and keeps it running. Everyone connects to their machine.</div>
528
+ </div>
529
+ <div>
530
+ <div style="color:var(--white);margin-bottom:6px">Everyone runs an agent</div>
531
+ <div style="color:var(--muted)">Runs <code style="color:var(--cyan)">skopix agent</code> in a terminal. Their browser opens locally when they trigger a recording or replay.</div>
532
+ </div>
533
+ <div>
534
+ <div style="color:var(--white);margin-bottom:6px">Tests run on your machine</div>
535
+ <div style="color:var(--muted)">When you click Record or Replay, Skopix dispatches to your agent. Chrome opens on your screen. Results stream back to the shared dashboard.</div>
536
+ </div>
537
+ </div>
538
+ </div>
539
+
540
+ <div style="margin-top:16px;background:rgba(255,193,7,0.06);border:1px solid rgba(255,193,7,0.2);border-radius:12px;padding:20px 32px" class="observe">
541
+ <div style="font-family:var(--mono);font-size:10px;color:#f59e0b;letter-spacing:0.15em;margin-bottom:10px">⚠ AGENT IS REQUIRED TO RECORD AND REPLAY</div>
542
+ <div style="font-family:var(--mono);font-size:12px;color:var(--muted);line-height:1.8">In team mode, the agent must be running on your machine before you can record or replay tests. The dashboard alone cannot open a browser — the agent is what does the browser work locally. Always start your agent before using the dashboard.</div>
543
+ </div>
544
+
545
+ <div class="code-label observe" style="margin-top:32px">BACKUP YOUR TESTS</div>
509
546
  <div class="code-block observe">
510
- <div class="code-comment"># Recording and replay open a real Chrome window run on a Mac or Windows machine</div>
511
- <div class="code-comment"># Teammates connect via browser — they don't need anything installed</div>
512
- <div><span class="code-cmd">$</span> <span class="code-val">SKOPIX_SECRET_KEY</span>="long-random-string" skopix dashboard --team --host 0.0.0.0</div>
513
- <div class="code-out">→ Share your IP or use "portix 9000" for remote access</div>
514
- <div class="code-out">→ All recording, replay and debug runs on your machine with a real browser</div>
547
+ <div class="code-comment"># All your tests, suites, sessions and credentials live in one place:</div>
548
+ <div class="code-out">→ ~/.skopix/</div>
549
+ <div class="code-comment"># Back up everything to a zip on your Desktop:</div>
550
+ <div><span class="code-cmd">$</span> node skopix-backup.js</div>
551
+ <div class="code-out">→ Creates skopix-backup-2026-05-26.zip on your Desktop</div>
552
+ <div class="code-comment"># Restore on any machine (auto-finds the zip on Desktop/Downloads):</div>
553
+ <div><span class="code-cmd">$</span> node skopix-restore.js</div>
554
+ <div class="code-out">→ Restores all tests, suites, sessions and credentials</div>
555
+ <div class="code-out">→ Restart Skopix after restoring</div>
515
556
  </div>
557
+
558
+ <div style="margin-top:16px;background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:20px 32px" class="observe">
559
+ <div style="font-family:var(--mono);font-size:10px;color:var(--cyan);letter-spacing:0.15em;margin-bottom:10px">DOWNLOAD BACKUP SCRIPTS</div>
560
+ <div style="font-family:var(--mono);font-size:12px;color:var(--muted);line-height:1.8">
561
+ Get <code style="color:var(--cyan)">skopix-backup.js</code> and <code style="color:var(--cyan)">skopix-restore.js</code> from the
562
+ <a href="https://github.com/x444dyx/skopix" target="_blank" style="color:var(--cyan)">GitHub repo</a>.
563
+ On Mac, double-click <code style="color:var(--cyan)">.command</code> wrappers to run without opening a terminal.
564
+ </div>
565
+ </div>
566
+
516
567
  </div>
517
568
  </section>
518
569