CLI Reference
Synopsis
scw-ai [options] [url]
The CLI can be invoked via node src/index.js, pnpm start, or the compiled bin/scw-ai binary.
Options
| Flag | Description | Default |
|---|---|---|
--url <value> | Challenge URL | Prompts interactively |
--session <value> | sessionId from SCW localStorage | SCW_SESSION_ID env var |
--tab-delay <ms> | Delay in milliseconds between tab clicks | 600 |
--headless / --no-headless | Toggle Puppeteer headless mode | true |
--new | Use the vulnerability discovery collector | false |
--fix | Use the diff/solution comparison collector | false |
Positional arguments
The first positional argument is treated as the challenge URL if --url is not provided:
node src/index.js https://portal.securecodewarrior.com/#/assessments/take/...
Environment variables
| Variable | Description |
|---|---|
SCW_SESSION_ID | Default session ID (loaded from .env or shell environment) |
SCW_CHALLENGE_URL | Default challenge URL when none is provided |
Examples
Default mode (interactive)
pnpm start
Prompts for the challenge URL, headless preference, and tab delay.
Specify all options
node src/index.js \
--url "https://portal.securecodewarrior.com/#/assessments/take/ABC/XYZ" \
--session YOUR_SESSION_ID \
--tab-delay 800 \
--no-headless
Vulnerability discovery mode
node src/index.js --new --url "..."
Solution comparison mode
node src/index.js --fix --url "..."
Exit codes
| Code | Meaning |
|---|---|
0 | Success |
1 | Error (missing arguments, browser failure, iframe not found, etc.) |