skopix 2.0.6 → 2.0.8
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/cli/commands/agent.js +17 -0
- package/cli/commands/dashboard.js +23 -0
- package/cli/index.js +21 -2
- package/package.json +1 -1
- package/web/index.html +64 -13
package/cli/commands/agent.js
CHANGED
|
@@ -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
|
|
|
@@ -2022,6 +2022,29 @@ export async function dashboardCommand(options) {
|
|
|
2022
2022
|
const openPath = (teamMode && !teamMode.db.hasAnyAdmin()) ? '/setup' : '/app/';
|
|
2023
2023
|
open(`http://${displayHost}:${port}${openPath}`).catch(() => {});
|
|
2024
2024
|
}
|
|
2025
|
+
|
|
2026
|
+
// Auto-start agent if --agent flag passed
|
|
2027
|
+
if (options.agent) {
|
|
2028
|
+
const key = process.env.SKOPIX_SECRET_KEY;
|
|
2029
|
+
if (key) {
|
|
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, '--auto'], {
|
|
2035
|
+
stdio: 'inherit',
|
|
2036
|
+
env: { ...process.env, SKOPIX_AUTO_AGENT: '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(); });
|
|
2042
|
+
});
|
|
2043
|
+
}, 2000);
|
|
2044
|
+
} else {
|
|
2045
|
+
console.log(chalk.yellow(' ⚠ --agent flag set but SKOPIX_SECRET_KEY not found, skipping auto-agent'));
|
|
2046
|
+
}
|
|
2047
|
+
}
|
|
2025
2048
|
});
|
|
2026
2049
|
|
|
2027
2050
|
process.on('SIGINT', () => { console.log(chalk.yellow('\n Stopping...')); server.close(); process.exit(0); });
|
package/cli/index.js
CHANGED
|
@@ -32,7 +32,7 @@ program
|
|
|
32
32
|
.requiredOption('-u, --url <url>', 'Target URL to test')
|
|
33
33
|
.requiredOption('-g, --goal <goal>', 'Testing goal (e.g. "complete the checkout flow")')
|
|
34
34
|
.option('-c, --credentials <file>', 'Path to credentials YAML file')
|
|
35
|
-
.option('-o, --output <dir>', 'Output directory for reports')
|
|
35
|
+
.option('-o, --output <dir>', 'Output directory for reports', './skopix-reports')
|
|
36
36
|
.option('-m, --max-steps <number>', 'Maximum steps the agent will take', '20')
|
|
37
37
|
.option('--headless', 'Run browser in headless mode', false)
|
|
38
38
|
.option('--no-video', 'Disable video recording')
|
|
@@ -53,7 +53,7 @@ program
|
|
|
53
53
|
program
|
|
54
54
|
.command('report')
|
|
55
55
|
.description('Open the latest report in your browser')
|
|
56
|
-
.option('-d, --dir <dir>', 'Reports directory')
|
|
56
|
+
.option('-d, --dir <dir>', 'Reports directory', './skopix-reports')
|
|
57
57
|
.action(reportCommand);
|
|
58
58
|
|
|
59
59
|
program
|
|
@@ -72,6 +72,7 @@ program
|
|
|
72
72
|
.option('-h, --host <host>', 'Host to bind to (default 127.0.0.1; use 0.0.0.0 for team mode)')
|
|
73
73
|
.option('--team', 'Enable multi-user team mode (requires SQLite)')
|
|
74
74
|
.option('--no-open', 'Do not auto-open the browser')
|
|
75
|
+
.option('--agent', 'Also start an agent on this machine automatically')
|
|
75
76
|
.action(dashboardCommand);
|
|
76
77
|
|
|
77
78
|
program
|
|
@@ -82,4 +83,22 @@ program
|
|
|
82
83
|
.option('-n, --name <name>', 'Agent display name (defaults to hostname)')
|
|
83
84
|
.action(agentCommand);
|
|
84
85
|
|
|
86
|
+
// Short alias: "skopix start" — starts dashboard + agent in one command
|
|
87
|
+
program
|
|
88
|
+
.command('start')
|
|
89
|
+
.description('Start dashboard and agent together (shortcut for team mode)')
|
|
90
|
+
.option('-p, --port <port>', 'Port', '9000')
|
|
91
|
+
.option('--host <host>', 'Host to bind to', '0.0.0.0')
|
|
92
|
+
.option('--no-open', 'Do not auto-open the browser')
|
|
93
|
+
.action(async (options) => {
|
|
94
|
+
const key = process.env.SKOPIX_SECRET_KEY;
|
|
95
|
+
if (!key) {
|
|
96
|
+
console.log(chalk.red(' ✖ SKOPIX_SECRET_KEY is not set.'));
|
|
97
|
+
console.log(chalk.dim(' Set it with: export SKOPIX_SECRET_KEY="your-secret"'));
|
|
98
|
+
process.exit(1);
|
|
99
|
+
}
|
|
100
|
+
// Start dashboard with agent flag
|
|
101
|
+
await dashboardCommand({ ...options, team: true, agent: true });
|
|
102
|
+
});
|
|
103
|
+
|
|
85
104
|
program.parse();
|
package/package.json
CHANGED
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
|
|
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 —
|
|
490
|
+
<div class="code-label observe">3B. TEAM MODE — ONE COMMAND STARTS EVERYTHING</div>
|
|
491
491
|
<div class="code-block observe">
|
|
492
|
-
<div
|
|
493
|
-
<div class="code-
|
|
494
|
-
<div class="code-
|
|
495
|
-
<div class="code-
|
|
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
|
|
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
|
|
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">#
|
|
511
|
-
<div class="code-
|
|
512
|
-
<div
|
|
513
|
-
<div class="code-
|
|
514
|
-
<div class="code-out">→
|
|
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
|
|