AI-First Console Error & Warning Detector for Web Applications
Project description
ConsolePatrol
AI-First Console Error & Warning Detector for Web Applications
ConsolePatrol is an intelligent console monitoring tool designed for AI agents and developers to automatically detect console errors and warnings across entire web applications. It supports multiple UI frameworks (Ant Design, Element UI, React, Vue, etc.) and provides structured reports with actionable insights.
Features
- ๐ Auto-Discovery โ Scans project routes/pages automatically without manual configuration
- ๐ฏ Framework-Aware โ Recognizes UI frameworks and applies targeted detection rules
- ๐ Severity Levels โ P0 (Fatal) / P1 (Warning) / P2 (Hint) classification
- ๐ Dual Output โ JSON (for AI agents) + Markdown (for humans)
- ๐ Diff Mode โ Compare results with previous runs to track changes
- โ๏ธ Extensible Rules โ Easy to add custom detection patterns
- ๐ผ๏ธ Screenshot Capture โ Auto-screenshot on critical errors
Installation
pip install console-patrol
Or from source:
git clone https://github.com/zhzgao/console-patrol.git
cd console-patrol
pip install -e .
Quick Start
# Scan a running web app
console-patrol scan http://localhost:3000
# With auto-discovery of routes (React Router example)
console-patrol scan http://localhost:3000 --router-type react
# Full options
console-patrol scan http://localhost:3000 \
--router-type react \
--base-path /admin \
--output report.json \
--format markdown \
--screenshot \
--severity P1
Architecture
console-patrol/
โโโ src/console_patrol/
โ โโโ cli.py # CLI entry point
โ โโโ crawler.py # Page navigation & route discovery
โ โโโ detector.py # Console message interception
โ โโโ framework.py # Framework auto-detection
โ โโโ reporter.py # JSON / Markdown output
โ โโโ rules/ # Detection rule engine
โ โโโ base.py
โ โโโ antd.py # Ant Design rules
โ โโโ react.py # React rules
โ โโโ element.py # Element UI rules
โโโ tests/
Detection Rules
Severity Levels
| Level | Meaning | Action |
|---|---|---|
| P0 | Fatal (JS exception, crash) | Immediate fix required |
| P1 | Warning (framework issues) | Fix before release |
| P2 | Hint (code smell, anti-pattern) | Consider fixing |
Built-in Rules
Ant Design
antd-useForm-unhookedโform.getFieldValue()called outside form contextantd-modal-contextโ Static modal methods in React 18+antd-tree-missing-keysโ Tree component missing required keys
React
react-strict-mode-double-mountโ Potential StrictMode side effectsreact-hook-rulesโ Hook usage violations
Element UI
element-form-validateโ Form validation issues
For AI Agents
ConsolePatrol is designed to be agent-friendly:
from console_patrol import ConsolePatrol
result = ConsolePatrol.scan(
url="http://localhost:3000",
router_type="react",
wait_time=2.0,
)
# Structured output
for issue in result.issues:
if issue.severity == "P0":
print(f"[{issue.severity}] {issue.rule_id}")
print(f" File: {issue.location}")
print(f" Fix: {issue.suggestion}")
License
MIT ยฉ zhzgao
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file console_patrol-0.1.1.tar.gz.
File metadata
- Download URL: console_patrol-0.1.1.tar.gz
- Upload date:
- Size: 25.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
676720a555addba58e87d1e1f8faef198c1a5609f541fb90607f678dc9c518bd
|
|
| MD5 |
6290c3e1d93e6defc6353333a370de55
|
|
| BLAKE2b-256 |
68283ac7652a8ed7ed3847ebe612ec368c9bdf1bd710a260f8f2288ed91a4b2f
|
File details
Details for the file console_patrol-0.1.1-py3-none-any.whl.
File metadata
- Download URL: console_patrol-0.1.1-py3-none-any.whl
- Upload date:
- Size: 27.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b09d8bc910ba9aebf8a1eb1cb2e732500646fae98d28489059a2a46b2b55a6a
|
|
| MD5 |
9408b2f30423edb5abccc1ad82e1876d
|
|
| BLAKE2b-256 |
ac4430ebb44c2b8b54cb7a3dbfed52bdcf75fbca05e13479fce9ff193a18ecbf
|