skopix 2.0.5 → 2.0.7
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/dashboard.js +21 -1
- package/cli/index.js +21 -2
- package/package.json +1 -1
|
@@ -2022,6 +2022,26 @@ 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
|
+
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));
|
|
2038
|
+
});
|
|
2039
|
+
process.on('SIGINT', () => { agentProc.kill(); });
|
|
2040
|
+
});
|
|
2041
|
+
} else {
|
|
2042
|
+
console.log(chalk.yellow(' ⚠ --agent flag set but SKOPIX_SECRET_KEY not found, skipping auto-agent'));
|
|
2043
|
+
}
|
|
2044
|
+
}
|
|
2025
2045
|
});
|
|
2026
2046
|
|
|
2027
2047
|
process.on('SIGINT', () => { console.log(chalk.yellow('\n Stopping...')); server.close(); process.exit(0); });
|
|
@@ -3481,7 +3501,7 @@ async function resolveUserSecretsEnv(userId, teamMode) {
|
|
|
3481
3501
|
if (key === 'ANTHROPIC_API_KEY' && !env.CLAUDE_API_KEY) env.CLAUDE_API_KEY = value;
|
|
3482
3502
|
} catch (err) {
|
|
3483
3503
|
// Decryption failed - log and skip. Could happen if SKOPIX_SECRET_KEY changed since the value was encrypted.
|
|
3484
|
-
|
|
3504
|
+
// Silently skip secrets that can't be decrypted (e.g. encrypted with old key)
|
|
3485
3505
|
}
|
|
3486
3506
|
}
|
|
3487
3507
|
return env;
|
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