-
Notifications
You must be signed in to change notification settings - Fork 0
API Reference
The configuration file supports these options:
{
"url": "string", // Target URL (optional, auto-detected)
"outputDir": "string", // Log output directory (default: "./devmirror-logs")
"chromePath": "string", // Path to Chrome executable (optional)
"mode": "string", // "cdp" or "cef" (default: "cdp")
"cefPort": "number", // CEF debug port (required for CEF mode)
"autoDetectPort": "boolean", // Auto-detect dev server port
"autoOpenBrowser": "boolean", // Open browser in CEF mode (v0.4.52+)
"throttle": {
"maxPerSecond": "number", // Max messages per second (default: 100)
"suppressAfter": "number" // Suppress after N repeats (default: 100)
}
}Commands available via Command Palette (Cmd/Ctrl+Shift+P):
| Command | Description |
|---|---|
DevMirror: Setup Project |
Create initial configuration |
DevMirror: Start Capture |
Start capturing manually |
DevMirror: Stop Capture |
Stop current capture session |
DevMirror: Show Logs |
Open logs directory |
DevMirror: Open Settings |
Open VS Code settings |
DevMirror: Refresh Scripts |
Reload package.json scripts tree |
Note: Additional commands are available via context menus in the DevMirror Scripts panel.
Actions available in DevMirror Scripts panel:
| Icon | Action | Description |
|---|---|---|
| + | Add Mirror Script | Quick setup with defaults |
| ⚙️ | Setup Wizard | Advanced configuration |
| ↩ | Undo Changes | Revert script modifications |
| ▶ | Run Script | Execute the script |
| 🔄 | Refresh | Reload script list |
DevMirror generates scripts following these patterns:
"script:mirror": "concurrently \"npx devmirror-cli\" \"npm run script\"""script:mirror": "node scripts/devmirror-background.js & npm run script"The background script is created automatically when needed.
DevMirror includes a CLI tool (devmirror-cli) that is invoked by the generated scripts. The CLI:
- Reads the
devmirror.config.jsonfile - Connects to the target using CDP or CEF mode
- Captures console output to log files
- Communicates with the VS Code extension via HTTP
Note: The CLI is primarily invoked through generated scripts, not directly.
YYYY-MM-DD-HHMMSS.log
Example: 2025-09-22-143052.log
[YYMMDD'T'HH:MM:SS.ms] [LEVEL] Message
[250922T14:30:52.12] [LOG] Application started
[250922T14:30:52.13] [ERROR] Error message
[250922T14:30:52.14] [NETWORK:ERROR] Connection failed
URL: http://example.com
- LOG, ERROR, WARN, INFO, DEBUG - Console methods
- NETWORK:ERROR - Network failures
- BROWSER:WARNING/ERROR - Browser events
- LIFECYCLE - Page load events
-
current.log- Symlink to active log file -
.devmirror.lock- Lock file for single instance
{
"outputDir": "./devmirror-logs",
"mode": "cdp"
}{
"mode": "cef",
"cefPort": 8555,
"outputDir": "./logs",
"autoOpenBrowser": true
}{
"chromePath": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
"outputDir": "./devmirror-logs"
}DevMirror adds scripts with :mirror suffix:
{
"scripts": {
"dev": "vite",
"dev:mirror": "concurrently \"npx devmirror-cli\" \"npm run dev\""
}
}For interactive CLIs, it may create a background script in scripts/ folder.
Available in VS Code settings (Preferences → Settings → Search for "devmirror"):
| Setting | Description | Default |
|---|---|---|
devmirror.chromePath |
Path to Chrome executable | Auto-detect |
Note: Most settings are managed through the devmirror.config.json file.
DevMirror shows status in VS Code's status bar:
- Hidden when idle
- Shows
🟢 DevMirror | package-name | X logs | durationwhen active - Click to open logs directory
| Browser | CDP Port | Support |
|---|---|---|
| Chrome | 9222 | Full |
| Chromium | 9222 | Full |
| Edge | 9222 | Full |
| Brave | 9222 | Full |
| Opera | 9222 | Partial |
| Vivaldi | 9222 | Partial |
| Protocol | Default Port | Status |
|---|---|---|
| CDP | 9222 | ✅ Supported |
| CEF | 8555 | ✅ Supported |
| Node Inspector | 9229 | 🔄 Planned |
| Version | Key Changes |
|---|---|
| 0.4.65 | Browser auto-refresh on CEF reconnection |
| 0.4.64 | Auto-navigation to CEF DevTools |
| 0.4.63 | Fixed autoOpenBrowser implementation |
| 0.4.62 | autoOpenBrowser setting in configs |
| 0.4.61 | Fixed CEF reconnection context tracking |
| 0.4.60 | CEF disconnect/reconnect logging |
| 0.4.59 | Fixed extension activation in all windows |
| 0.4.58 | Fixed status bar in correct window |
| 0.4.57 | Fixed recursive folding loop |
| 0.4.56 | Working log folding |
| 0.4.51 | Fixed reconnect loop, added autoOpenBrowser |
| 0.4.50 | Setup Wizard, undo functionality |
| 0.4.49 | WebviewView implementation |
| 0.4.48 | Wizard panel closing behavior |
| 0.4.47 | Quick add button (+) |
- Node.js debugging not yet supported
- Advanced filtering options not yet implemented
- WebSocket API for external tools not available
- Backup/restore system limited to package.json changes via undo button
- Node.js Inspector support
- Advanced log filtering
- Pattern-based exclusions
- Source file filtering
- Performance tuning options
- WebSocket event API
- Programmatic extension API
For issues or feature requests, visit: https://github.com/ivg-design/devMirror/issues
DevMirror v0.4.82 | GitHub | Issues | VS Code Marketplace
Capture 100% of browser console output with Chrome DevTools Protocol
v0.4.82