Skip to main content

Getting Started

SCW-AI is a CLI tool that uses Puppeteer to scrape Secure Code Warrior challenges and format them as prompt-friendly output for AI-powered code analysis workflows.

Prerequisites​

  • Node.js 18 or later
  • pnpm package manager
  • Optionally, Bun to build a single-file executable

Installation​

From source​

git clone https://github.com/catesandrew/scw-ai.git
cd scw-ai
pnpm install

As a standalone binary​

If you have Bun installed, you can compile a self-contained executable:

pnpm build

This produces bin/scw-ai which can be copied anywhere on your system.

Configuration​

Copy the example environment file and add your Secure Code Warrior session ID:

cp .env.example .env

Edit .env and set:

SCW_SESSION_ID=your-session-id-here
SCW_CHALLENGE_URL=https://portal.securecodewarrior.com/#/assessments/take/...

Finding your session ID​

  1. Open your browser and navigate to Secure Code Warrior.
  2. Log in to your account.
  3. Open the browser Developer Tools (F12 or Cmd+Option+I).
  4. Go to Application > Local Storage > https://portal.securecodewarrior.com.
  5. Find the sessionId key and copy its value.

Quick start​

# Interactive mode (prompts for URL and settings)
pnpm start

# Direct mode with flags
node src/index.js --url "https://portal.securecodewarrior.com/#/assessments/take/..." --session YOUR_SESSION_ID

# Using the compiled binary
./bin/scw-ai --url "..." --session "..."

The CLI prints a formatted prompt and copies it to your clipboard (macOS only).