Launch browser with HAR recording for manual traffic capture
Launches a browser with HAR recording to capture network traffic for manual API reverse engineering.
/plugin marketplace add kalil0321/reverse-api-engineer/plugin install reverse-api-engineer@reverse-api-engineer[url]Launch a browser with HAR (HTTP Archive) recording enabled. Navigate manually, then close the browser to save the HAR file. This command does NOT generate code - use /reverse-api-engineer:engineer <run_id> afterward to analyze the captured traffic and generate an API client.
Capture mode is useful when you want to:
Create a unique run ID for this capture session:
run_id=$(uuidgen | tr '[:upper:]' '[:lower:]' | tr -d '-' | cut -c1-12)
echo "Starting capture session: ${run_id}"
Setup HAR file path:
har_dir="${HOME}/.reverse-api/runs/har/${run_id}"
mkdir -p "${har_dir}"
har_path="${har_dir}/recording.har"
Display to user:
Capture session started!
Run ID: {run_id}
HAR file: ~/.reverse-api/runs/har/{run_id}/recording.har
Launch browser with HAR recording enabled using Playwright MCP:
Call MCP tool: playwright_navigate
Parameters:
- url: {url} (if provided) or "about:blank"
- options:
- record_har: true
- har_path: ~/.reverse-api/runs/har/{run_id}/recording.har
- headless: false
Display instructions to user:
Browser launched with HAR recording enabled.
Instructions:
1. Navigate to the website you want to capture
2. Perform the actions you want to reverse engineer:
- Log in (to capture authentication)
- Browse pages (to capture GET requests)
- Submit forms (to capture POST/PUT requests)
- Trigger any API calls you need
3. Close the browser when done
The HAR file will be automatically saved when you close the browser.
Monitor the browser session. When the browser window closes, proceed to verification.
Check that the HAR file was created and contains data:
if [ -f ~/.reverse-api/runs/har/{run_id}/recording.har ]; then
size=$(ls -lh ~/.reverse-api/runs/har/{run_id}/recording.har | awk '{print $5}')
echo "✓ HAR file saved: $size"
else
echo "✗ Error: HAR file not found"
exit 1
fi
Count network requests in the HAR file:
import json
from pathlib import Path
har_path = Path.home() / ".reverse-api" / "runs" / "har" / "{run_id}" / "recording.har"
with open(har_path, 'r') as f:
har_data = json.load(f)
entry_count = len(har_data['log']['entries'])
print(f"Captured {entry_count} network requests")
Save metadata about this capture session:
cat > ~/.reverse-api/runs/har/{run_id}/metadata.json <<EOF
{
"run_id": "{run_id}",
"mode": "capture",
"timestamp": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
"har_path": "~/.reverse-api/runs/har/{run_id}/recording.har",
"url": "{url or 'manual navigation'}",
"entry_count": {entry_count}
}
EOF
Present completion summary to user:
Capture complete!
Run ID: {run_id}
HAR file: ~/.reverse-api/runs/har/{run_id}/recording.har
File size: {size}
Network requests captured: {entry_count}
Next steps:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Option 1: Analyze and generate API client
/reverse-api-engineer:engineer {run_id}
Option 2: View captured HAR file
cat ~/.reverse-api/runs/har/{run_id}/recording.har | jq
Option 3: Filter HAR to see API calls only
python plugins/reverse-api-engineer/skills/reverse-engineering-api/scripts/har_filter.py \\
~/.reverse-api/runs/har/{run_id}/recording.har --stats
Tip: You can capture multiple times and analyze later!
# Capture with starting URL
/reverse-api-engineer:capture https://api.example.com
# Capture with manual navigation (no starting URL)
/reverse-api-engineer:capture
# After capture, analyze whenever ready
/reverse-api-engineer:engineer abc123def456
Browser doesn't launch:
HAR file is empty:
HAR file is too large: