Master Fiddler CLI: Automate HTTP Debugging & HTTPS Decryption
Learn how to use Fiddler CLI for automated HTTP debugging, HTTPS decryption, HAR exports, and CI/CD integration — a practical fiddler tutorial for developers and testers.
Fiddler isn’t just a GUI tool — it’s a full-featured, scriptable HTTP debugging proxy with powerful command-line capabilities. When you need to integrate traffic inspection into CI/CD pipelines, automate regression tests, or batch-process captured sessions, the Fiddler command line interface (CLI) becomes indispensable.
Whether you’re validating API contracts, auditing third-party SDK behavior, or enforcing HTTPS decryption policies across test environments, mastering Fiddler.exe flags and scripting unlocks repeatability, scalability, and precision far beyond manual session analysis. This tutorial walks you through real-world CLI usage — from launching headless captures to exporting decrypted HTTPS traffic in machine-readable formats.
Why Use Fiddler from the Command Line?
GUI-based HTTP debugging works well for exploratory analysis, but falls short when you need consistency, scheduling, or integration. The Fiddler CLI enables:
- Automated capture during test runs, without human intervention
- HTTPS decryption at scale, with pre-configured root certificates and trust rules
- Session export in JSON, SAZ, or HAR for downstream parsing or diffing
- Custom rule injection via
.jsor.csxscripts before capture starts - Headless operation on Windows Server, Docker containers, or Azure DevOps agents
This is where advanced techniques like CLI automation separate ad-hoc debugging from production-grade HTTP observability.
Prerequisites and Setup
Before using Fiddler CLI, ensure:
- You’re running Fiddler Classic v5.0.20234.58100 or later (older versions lack robust CLI support)
- .NET Framework 4.8+ is installed (required for Fiddler Core dependencies)
- You’ve configured HTTPS decryption once via the GUI (
Tools > Options > HTTPS) and trusted the Fiddler root certificate in Windows Certificate Manager - Your system allows loopback exemptions if capturing UWP or localhost-bound apps (run
CheckNetIsolation LoopbackExempt -a -n=Microsoft.Win32WebViewHostas needed)
💡 Tip: For CI/CD use, avoid interactive prompts. Pre-configure settings via
FiddlerApplication.Prefs.SetStringPref()in startup scripts or use/prefarguments (see below).
Launching Fiddler in Headless Mode
The core CLI flag is /noattach, which suppresses the UI and runs Fiddler as a background proxy server:
Fiddler.exe /noattach
By default, this starts Fiddler listening on 127.0.0.1:8888. To change the port or bind to all interfaces (use cautiously in shared environments):
Fiddler.exe /noattach /port:9999 /bindto:0.0.0.0
To confirm it’s running and accepting traffic, check the Windows Services panel or run:
Get-Process | Where-Object {$_.ProcessName -eq "Fiddler"}
You can also launch Fiddler without auto-starting the proxy by adding /noproxy — useful when you only need its scripting engine or session loader.
Enabling HTTPS Decryption Programmatically
HTTPS decryption must be explicitly enabled in CLI mode — unlike the GUI, it’s not on by default. Use /enablehttps:
Fiddler.exe /noattach /enablehttps
If your environment blocks certificate installation (e.g., locked-down corporate images), pre-deploy the FiddlerRoot certificate and enable decryption silently:
Fiddler.exe /noattach /enablehttps /reinstallcert
⚠️ Troubleshooting: If decrypted HTTPS traffic appears as
Tunnel to host:443with no request/response bodies, verify:
- The target app trusts the FiddlerRoot certificate (check
certmgr.msc > Trusted Root Certification Authorities)Decrypt HTTPS trafficis checked in Fiddler’s HTTPS options before exporting preferences- You’re not capturing traffic from apps that bypass the system proxy (e.g., Electron apps with
--proxy-serveroverrides)
For deeper control over which domains to decrypt, combine CLI with custom RulesScript: see the Scripting section below.
Capturing and Saving Sessions Automatically
Fiddler CLI doesn’t auto-save sessions unless instructed. Use /savesessions followed by a path and optional filter:
Fiddler.exe /noattach /savesessions:"C:\logs\test-run-$(date +%Y%m%d-%H%M%S).saz" /filter:"HOSTEQ www.api.example.com"
Note: Native date formatting requires PowerShell or a wrapper script. A more portable approach uses %DATE% and %TIME% environment variables (Windows CMD):
for /f "tokens=2 delims==" %%a in ('wmic os get localdatetime /value') do set dt=%%a
set ymd=%dt:~2,2%%dt:~4,2%%dt:~6,2%
set hms=%dt:~8,2%%dt:~10,2%%dt:~12,2%
Fiddler.exe /noattach /savesessions:"C:\logs\capture-%ymd%-%hms%.saz"
Exporting to HAR or JSON for Automation
While .saz is Fiddler’s native format, many tools consume HAR (HTTP Archive) or structured JSON. Use /export:
Fiddler.exe /noattach /export:"har;C:\logs\output.har" /savesessions:"C:\logs\temp.saz"
Or export raw JSON metadata (request headers, status, timings):
Fiddler.exe /noattach /export:"json;C:\logs\summary.json" /savesessions:"C:\logs\temp.saz"
✅ Pro tip: Combine
/exportwith/quitafterto auto-exit after N seconds or after capturing M requests:Fiddler.exe /noattach /savesessions:"C:\logs\auto.saz" /export:"har;C:\logs\auto.har" /quitafter:30This exits cleanly after 30 seconds — ideal for scripted smoke tests.
Scripting with FiddlerCore and Custom Rules
Fiddler’s CLI supports injecting custom logic via JavaScript (/js) or C#-style scripts (/csx). These execute before capture begins and let you configure filters, modify requests/responses, or log telemetry.
Example: Block Tracking Domains During Capture
Save this as block-trackers.js:
import System;
import Fiddler;
// Block known trackers
var blockedHosts = [
"doubleclick.net",
"googleadservices.com",
"taboola.com"
];
FiddlerApplication.BeforeRequest += function(oSession) {
if (blockedHosts.some(h => oSession.hostname.indexOf(h) > -1)) {
oSession.utilCreateResponseAndBypassServer();
oSession.responseCode = 403;
oSession.ResponseBody = "Blocked by automation policy.";
}
};
Then launch with:
Fiddler.exe /noattach /js:"C:\scripts\block-trackers.js" /savesessions:"C:\logs\clean.saz"
Loading Saved Preferences and Rules
Prefer configuring via GUI then reusing? Export your current preferences:
- In Fiddler GUI:
Tools > Options > General > Export Settings - Save as
my-prefs.xml - Load it via CLI:
Fiddler.exe /noattach /loadprefs:"C:\config\my-prefs.xml"
This preserves HTTPS decryption settings, custom headers, timeouts, and even saved AutoResponder rules — making your CLI setup fully reproducible.
Integrating Fiddler CLI into CI/CD Pipelines
Here’s how to embed Fiddler into an Azure Pipelines YAML job (Windows agent):
- task: PowerShell@2
displayName: 'Start Fiddler Proxy'
inputs:
targetType: 'inline'
script: |
Start-Process "C:\Program Files\Fiddler\Fiddler.exe" `
-ArgumentList "/noattach /enablehttps /savesessions:C:\logs\api-test.saz /quitafter:60" `
-WindowStyle Hidden
Start-Sleep -Seconds 5
- script: |
# Run your test suite with HTTP_PROXY=http://localhost:8888
npm test -- --proxy http://localhost:8888
displayName: 'Run API Tests with Proxy'
- task: PublishPipelineArtifact@1
inputs:
targetPath: 'C:\logs\api-test.saz'
artifact: 'fiddler-capture'
publishLocation: 'pipeline'
For Docker-based testing, include Fiddler in a Windows container image (requires Server Core base and .NET Framework), or use FiddlerCore as a library in a .NET console app — a lighter-weight alternative for pure automation scenarios.
🔍 Bonus: Need to inspect traffic from mobile devices or remote VMs? Configure Fiddler CLI to accept remote connections with
/bindto:0.0.0.0, then point the client’s proxy to your host IP + port. Ensure Windows Firewall allows inbound TCP on that port.
Troubleshooting Common CLI Issues
| Symptom | Likely Cause | Fix |
|---|---|---|
Fiddler.exe not found |
Not in PATH or wrong architecture (x64 vs x86) | Use full path: "C:\Program Files\Fiddler\Fiddler.exe" |
No HTTPS decryption despite /enablehttps |
Root cert not trusted or missing /reinstallcert |
Run once with /reinstallcert; verify cert in certmgr.msc |
| Sessions not saved or exported | Path contains spaces or invalid chars; folder doesn’t exist | Quote paths; pre-create directories; avoid : in filenames on Windows |
| Fiddler exits immediately | Missing /noattach or conflicting flags |
Always pair /noattach with /savesessions, /export, or /quitafter |
Tunnel to host:443 only, no bodies |
App bypasses system proxy (e.g., Chrome with --no-proxy-server) |
Force proxy via --proxy-server=127.0.0.1:8888 or use PAC file |
When debugging, add /loglevel:3 to generate verbose logs to Fiddler.log in the same directory — invaluable for diagnosing handshake failures or rule misfires.
Conclusion: From Manual Inspection to Automated HTTP Observability
The Fiddler command line transforms HTTP debugging from a reactive, GUI-driven process into a proactive, integrated part of your engineering workflow. With CLI automation, you can enforce HTTPS decryption policies across environments, validate third-party API integrations in CI, and generate audit-ready traffic archives — all without touching the UI.
Key takeaways:
- Always use
/noattachto run headlessly; pair it with/savesessions,/export, or/quitafterto prevent silent failure - Enable HTTPS decryption explicitly with
/enablehttps— and verify certificate trust outside the GUI - Leverage
/jsor/csxscripts to inject domain-specific logic like filtering, mocking, or logging - Export to HAR or JSON for programmatic analysis — not just
.sazfor manual review - Pre-configure and reuse preferences via
/loadprefsto ensure environment parity
Ready to go deeper? Explore our more tutorials on Fiddler debugging best practices, or dive into browse Advanced Techniques tutorials for topics like custom inspectors, AutoResponder scripting, and TLS 1.3 inspection caveats. For enterprise deployment questions, contact us — we help teams scale Fiddler across thousands of test agents.
Fiddler CLI isn’t just about convenience — it’s about bringing HTTP transparency to every layer of your stack.