Local Workflow
The complete offline debugging flow: capture events, process them into incidents and bundles, inspect, resolve, and clean up — no cloud account needed.
Overview
DebugBundle's local workflow gives you the full debugging experience on your machine:
Capture → Process → Inspect → ResolveNo cloud account, no network, no signup. Everything runs on disk.
1. Setup
If you haven't already:
debugbundle setupThis creates the .debugbundle/ scaffold. See Setup & Configuration for details.
2. Capture Events
Events land in .debugbundle/local/events/ through three paths:
SDK Capture (Automatic)
When your SDK's projectToken is 'local' or projectMode is 'local-only', events write to disk automatically:
import DebugBundle from '@debugbundle/sdk-node';
DebugBundle.init({
projectToken: 'local',
service: 'my-api',
});
// Exceptions, logs, and HTTP context now capture to local filesLog Ingestion (One-Shot)
Ingest an existing log file:
debugbundle ingest ./logs/error.log --format php-errorSupported formats:
| Format | Description |
|---|---|
debugbundle-ndjson | Native DebugBundle NDJSON format |
php-error | PHP error log format |
apache-error | Apache error log format |
Log Watch (Continuous)
Tail-watch a log file and ingest new entries as they appear:
debugbundle watch --log ./logs/error.log --format apache-errorWatch mode polls the log file for new content and processes new events through the full pipeline (ingest → process → bundle).
To stream watched events to the cloud simultaneously:
debugbundle watch --log ./logs/error.log --format php-error --cloud3. Process Events
Process raw events into incidents, bundles, and reproduction artifacts:
debugbundle processProcessing does the following for each batch of events:
- Normalize — Standardize event format, extract structured fields
- Classify — Determine event type (exception, log, HTTP, metric)
- Fingerprint — Generate a stable fingerprint for incident grouping
- Aggregate — Group events into incidents by fingerprint
- Build bundles — Generate debug bundles with full context
- Build reproductions — Create reproduction artifacts (curl, httpie, JSON spec)
Output:
Processed 12 events into 3 incidents.
- api: 2 incidents
- worker: 1 incidentProcessing State
Processing is incremental and idempotent. The processor tracks the last processed event file and only processes new files on subsequent runs. Re-running process on already-processed events is safe.
4. List Incidents
debugbundle incidentsOutput:
inc_a1b2c3 | high | open | TypeError: Cannot read property 'id' of undefined
inc_d4e5f6 | medium | open | POST /api/charge → 500 (timeout)
inc_g7h8i9 | low | resolved | Warning: deprecated API versionFiltering
# By source
debugbundle incidents --source local
debugbundle incidents --source cloud
# By status and severity
debugbundle incidents --status open --severity high
# By environment and service
debugbundle incidents --environment production --service api
# Pagination
debugbundle incidents --limit 20 --cursor <cursor>JSON Output
debugbundle incidents --jsonReturns a JSON object with incidents, cursor, and total fields.
5. Inspect an Incident
debugbundle inspect inc_a1b2c3Output:
Incident: inc_a1b2c3
Source: local
Title: TypeError: Cannot read property 'id' of undefined
Severity: high
Status: open
Environment: development
Occurrences: 5JSON Output
debugbundle inspect inc_a1b2c3 --jsonReturns the full incident object including event history, fingerprint details, and matched fields.
6. Retrieve the Bundle
debugbundle bundle inc_a1b2c3Returns the full debug bundle as JSON — the complete context snapshot for the incident:
{
"schema_version": "1.0.0",
"bundle_type": "failure",
"incident": { "..." },
"events": [ "..." ],
"context": {
"request": { "..." },
"response": { "..." },
"probe_data": { "..." },
"breadcrumbs": [ "..." ]
},
"reproduction": {
"curl": "curl -X POST ...",
"httpie": "http POST ...",
"json_spec": { "..." }
}
}7. Retrieve Reproduction Artifacts
debugbundle reproduce inc_a1b2c3Returns ready-to-run reproduction commands:
{
"curl": "curl -X POST http://localhost:3000/api/charge -H 'Content-Type: application/json' -d '{\"amount\":100}'",
"httpie": "http POST http://localhost:3000/api/charge amount:=100",
"json_spec": {
"method": "POST",
"url": "/api/charge",
"headers": { "content-type": "application/json" },
"body": { "amount": 100 }
}
}8. View Event Logs
debugbundle logs inc_a1b2c3Output:
2025-01-15T10:30:00Z | error | exception | evt_001
2025-01-15T10:30:00Z | warning | log | evt_002
2025-01-15T10:29:58Z | info | http | evt_003Filtering
debugbundle logs inc_a1b2c3 --level error --limit 509. Resolve and Reopen
Mark an incident as resolved:
debugbundle resolve inc_a1b2c3Reopen if it recurs:
debugbundle reopen inc_a1b2c310. Run Analysis
Run improvement analysis on local incidents:
debugbundle analyze --type improvement --local --jsonAnalysis types:
| Type | Purpose |
|---|---|
improvement | Suggests code changes to prevent the incident |
failure | Root cause analysis for failures |
performance | Performance regression analysis |
11. Clean Up
Remove local events:
debugbundle clean --eventsRemove local bundles:
debugbundle clean --bundlesRemove everything:
debugbundle clean --allRemove data older than N days:
debugbundle clean --all --older-than 30dComplete Example
A full local workflow session:
# 1. Initialize
debugbundle setup
# 2. Start your app with the SDK
# (events capture to .debugbundle/local/events/)
# 3. Process captured events
debugbundle process
# 4. Check what happened
debugbundle incidents
# 5. Investigate
debugbundle inspect inc_a1b2c3
debugbundle bundle inc_a1b2c3
# 6. Get reproduction command
debugbundle reproduce inc_a1b2c3
# 7. Fix and resolve
debugbundle resolve inc_a1b2c3
# 8. Verify health
debugbundle doctorNext Steps
- CLI Overview — Full command index and authentication
- Setup & Configuration — Profile, connection, and scaffold details
- Node.js SDK — Capture events from your backend