CLI Reference
Raiken ships as a CLI that initializes projects and starts the dashboard.
Commands
raiken init
Initialize Raiken in the current project.
raiken initOptions:
| Flag | Description |
|---|---|
--force, -f | Overwrite existing configuration files |
What it does:
- Detects your project type and test framework
- Creates
.raiken/workspace directory - Ensures crawler artifact paths are ignored (
.raiken/,storage/) - Writes
raiken.config.json - Creates
test-results/andtest-reports/directories - Optionally generates
playwright.config.ts - Optionally creates an example test file
- Adds scripts to
package.json
Example output:
🔎 Analyzing your project...
🔍 Detected project information: Project: my-app Type: nextjs Test Framework: playwright Package Manager: pnpm
✓ Auto-detected project configuration. nextjs + playwright → e2e/
? Use auto-detected configuration? Yes? Install Playwright browsers now? Yes? Generate an example test file? Yes
📁 Setting up nextjs project: my-app
✓ Created .raiken/ directory✓ Updated .gitignore to exclude .raiken/✓ Created test directory: e2e/✓ Created raiken.config.json✓ Created playwright.config.ts✓ Updated package.json scripts✓ Created example test: e2e/example.spec.ts📦 Installing Playwright browsers...✓ Playwright browsers installed successfully
✅ Project initialization complete!
Next steps: 1. Run "raiken start" to launch the dashboard 2. Open http://localhost:7101 in your browser 3. Start generating AI-powered tests!raiken start
Start the Raiken server and dashboard.
raiken startOptions:
| Flag | Description |
|---|---|
-p, --port <number> | Set the server port (default: 7101) |
Example:
raiken start -p 8080Example output:
📍 Found 3 entry points✅ Code graph built successfully: 47 files indexed
🚀 Raiken UI running at http://localhost:7101raiken discover
Start site discovery for a target application.
raiken discover --url http://localhost:3000Common options:
| Flag | Description |
|---|---|
--timeout <number> | Override discovery timeout for this run |
--auth | Capture auth state before starting discovery |
--continue | Continue the active paused discovery session |
Discovery defaults can be provided in raiken.config.json under discovery.
CLI flags override config values at runtime.
Continuation behavior reuses active session metadata (including persisted limits) when available.
raiken auth
Capture auth state for protected routes.
raiken authThe auth command stores state in .raiken/auth-state.json and is used by discovery
resume flows for authenticated navigation.
If runtime Playwright dependencies are missing, Raiken fails fast with install guidance rather than continuing with partial auth flow behavior.
API surface (local)
The CLI exposes a small local API used by the dashboard:
POST /api/generate-test— SSE stream for exploration and test generation outputPOST /api/trpc/*— tRPC router for dashboard actions
Discovery runtime endpoints are exposed through tRPC procedures, including:
startDiscoverycontinueDiscoverygetDiscoveryRuntimegetDiscoveryTimelineauthAssistclearDiscoveryData
Environment variables
Raiken reads .env from your project root.
| Variable | Required | Description |
|---|---|---|
OPENROUTER_API_KEY | Yes | API key for AI generation |
OPENROUTER_MODEL | No | Override the default model |
OPENROUTER_BASE_URL | No | Custom API base URL |
Exit codes
| Code | Meaning |
|---|---|
0 | Success |
1 | Initialization failed or startup error |
Quick reference
# Initialize a new projectraiken init
# Force reinitialize (overwrites config)raiken init --force
# Start the dashboardraiken start
# Start on a custom portraiken start -p 8080
# Start discoveryraiken discover --url http://localhost:3000
# Continue paused discoveryraiken discover --continue
# Check versionraiken --version
# Show helpraiken --help