Master Fiddler CLI: Automate HTTP Debugging & Proxy Tasks
Master Fiddler CLI for automated HTTP debugging, HTTPS decryption, headless capture, and CI/CD integration—step-by-step commands, scripts, and troubleshooting.
Fiddler isn’t just a GUI tool—it’s a powerful, scriptable proxy engine with robust command-line capabilities. When you need to integrate HTTP debugging into CI/CD pipelines, automate repetitive capture workflows, or run headless HTTPS decryption across environments, the Fiddler Command Line Interface (CLI) becomes indispensable.
Whether you’re validating API contracts, stress-testing endpoints, or auditing third-party traffic in automated test suites, mastering Fiddler CLI unlocks scalable, repeatable, and auditable network analysis—without manual intervention.
This guide walks you through real-world Fiddler command line usage—from basic startup and configuration to advanced automation scenarios involving custom rules, session filtering, and secure HTTPS decryption. You’ll learn how to invoke Fiddler as a background proxy service, export captures programmatically, and even embed logic using FiddlerCore-based scripts—all while maintaining full control over TLS interception and request/response manipulation.
Prerequisites and Setup
Before using Fiddler CLI, ensure you have:
- Fiddler Classic v5.0.20234.49100+ (or newer) installed on Windows. The CLI is bundled with Fiddler Classic—not Fiddler Everywhere.
- Administrator privileges (required for installing the root certificate and configuring system-wide proxy settings).
- .NET Framework 4.7.2+ (Fiddler CLI is a .NET executable).
Verify installation by opening PowerShell or CMD and running:
fiddler.exe -?
If you see usage help, you’re ready. If not, add C:\Program Files\Fiddler (or your install path) to your PATH environment variable.
💡 Pro Tip: Fiddler CLI requires the same trust configuration as the GUI. Run
fiddler.exe -installCertonce to auto-install the Fiddler root certificate—critical for HTTPS decryption. Without it, decrypted traffic won’t appear in logs or exports.
Core Command-Line Flags and Modes
Fiddler CLI supports three primary operational modes:
1. Headless Capture Mode (`-capture`)
Starts Fiddler silently—no UI—and begins capturing all proxied traffic immediately:
fiddler.exe -capture -output "C:\logs\session.saz"
This mode respects global Fiddler settings (e.g., HTTPS decryption, filters, breakpoints), but does not load custom RulesScript.js unless explicitly instructed (see next section). Use -timeout 300 to auto-stop after 5 minutes:
fiddler.exe -capture -timeout 300 -output "C:\logs\auto-stop.saz"
2. Scripted Automation Mode (`-script`)
Loads and executes a JScript.NET or C# Rules file before starting capture. This is essential for applying custom logic—like auto-responding to /health, blocking ads, or logging specific headers:
fiddler.exe -script "C:\scripts\AutoResponder.js" -capture -output "C:\logs\custom.saz"
Your AutoResponder.js might contain:
static function OnBeforeRequest(oSession: Session) {
if (oSession.uriContains("/api/v2/status")) {
oSession.utilCreateResponseAndBypassClient();
oSession.responseBodyBytes = System.Text.Encoding.UTF8.GetBytes('{"status":"ok"}');
oSession.oResponse.headers.SetStatus(200, "OK");
oSession.oResponse.headers.SetHeader("Content-Type", "application/json");
}
}
⚠️ Troubleshooting: If your script fails silently, launch with
-debugflag to log errors to console:fiddler.exe -script "C:\scripts\faulty.js" -capture -debug
3. Export & Conversion Mode (`-export`)
Convert .saz archives to other formats—ideal for feeding data into reporting tools or CI validators:
fiddler.exe -export "C:\logs\session.saz" "json" "C:\logs\export.json"
Supported formats: json, har, xml, text, csv. For HAR export (widely used in frontend tooling), use:
fiddler.exe -export "session.saz" "har" "output.har"
Note: -export only works on existing .saz files—it does not start a new capture.
Automating HTTPS Decryption at Scale
HTTPS decryption is non-negotiable for modern API testing—but enabling it reliably across machines demands automation. Here’s how to script it end-to-end:
Install the certificate silently (run as Admin):
fiddler.exe -installCertEnable HTTPS decryption globally via CLI args:
fiddler.exe -capture -enablehttps -output "secure.saz"For selective decryption, combine with
-filters(requires Fiddler v5.0.2023x+):fiddler.exe -capture -enablehttps -filters "*.api.example.com;*.auth.service.dev" -output "api-only.saz"
🔐 Security Note: Never commit Fiddler’s root certificate (
FiddlerRoot.cer) to version control. Instead, generate it dynamically in your pipeline and clean up post-run:fiddler.exe -exportcert "C:\temp\FiddlerRoot.cer" # ... use cert in tests ... Remove-Item "C:\temp\FiddlerRoot.cer"
Integrating Fiddler CLI into CI/CD Pipelines
You can embed Fiddler CLI in Azure DevOps, GitHub Actions, or Jenkins to validate backend behavior, detect leaks, or assert response timing.
Example: GitHub Actions Workflow Snippet
- name: Capture API Traffic
run: |
fiddler.exe -capture -enablehttps -timeout 120 -output ${{ github.workspace }}/traffic.saz
# Launch test app configured to use http://localhost:8888 as proxy
dotnet test --filter "TestCategory=Integration" --settings test.runsettings
shell: pwsh
env:
HTTP_PROXY: http://localhost:8888
HTTPS_PROXY: http://localhost:8888
- name: Export to HAR for Analysis
run: fiddler.exe -export ${{ github.workspace }}/traffic.saz har ${{ github.workspace }}/report.har
Ensure your test runner sets HTTP_PROXY and HTTPS_PROXY, and that .NET apps respect them (they do by default since .NET Core 2.1). For Node.js or Python services, explicitly configure their HTTP clients to route through localhost:8888.
Bonus: Validate Captures Programmatically
Use FiddlerCore’s SAZReader class (via C# script) to parse .saz files and assert conditions:
var saz = SAZReader.Read("traffic.saz");
var failed = saz.Where(s => s.responseCode >= 400).ToArray();
if (failed.Length > 0) throw new Exception($"{failed.Length} failed requests detected.");
Compile and run with fiddler.exe -script "validator.cs".
Advanced: Building Custom CLI Tools with FiddlerCore
For maximum flexibility, reference FiddlerCore.dll directly in your .NET project. This bypasses the CLI entirely and gives you full programmatic control—including dynamic rule injection, real-time session inspection, and custom exporters.
Install via NuGet:
Install-Package FiddlerCore4
Minimal headless proxy example:
FiddlerApplication.Startup(8888, FiddlerCoreStartupFlags.DecryptSSL | FiddlerCoreStartupFlags.AllowRemote);
FiddlerApplication.AfterSessionComplete += OnSessionComplete;
// ... run tests ...
FiddlerApplication.Shutdown();
Why go custom? Because Fiddler CLI doesn’t support:
- Real-time session modification during capture (only pre-capture hooks)
- Dynamic filter updates without restart
- Multi-process proxy coordination (e.g., isolate browser vs. mobile app traffic)
When you need those capabilities—and you will—browse Advanced Techniques tutorials for deep dives into FiddlerCore extensibility.
Common Pitfalls & Fixes
| Issue | Cause | Fix |
|---|---|---|
No traffic captured |
System or app not routing through Fiddler proxy | Confirm netsh winhttp show proxy, check app-specific proxy config, or force proxy with set HTTP_PROXY=http://localhost:8888 |
HTTPS traffic shows as CONNECT only |
Certificate not trusted or -enablehttps omitted |
Run fiddler.exe -installCert + -enablehttps; verify Tools > Options > HTTPS > Decrypt HTTPS traffic is checked in GUI (CLI inherits these settings) |
Script fails with 'Object expected' |
JScript.NET syntax error or missing static function wrapper |
Test script in Fiddler GUI first; use -debug flag to surface line numbers |
Export fails with 'Invalid SAZ' |
Corrupted or incomplete .saz (e.g., killed mid-capture) |
Always use -timeout or graceful shutdown; avoid Ctrl+C — send WM_CLOSE or use taskkill /f /im fiddler.exe only as last resort |
Conclusion: From Manual Inspection to Automated HTTP Debugging
Fiddler CLI transforms HTTP debugging from an exploratory, manual activity into a deterministic, repeatable part of your engineering workflow. With its ability to launch headless captures, enforce HTTPS decryption policies, execute custom logic via scripts, and export structured logs, it bridges the gap between interactive [fiddler debugging] and production-grade validation.
Key takeaways:
- Always run
-installCertand-enablehttpstogether for reliable [https decryption]. - Use
-scriptto inject business logic—auto-responses, header sanitization, or audit trails—before traffic hits your app. - Leverage
-export harto feed network data into frontend performance dashboards or security scanners. - When CLI limits are reached, drop down to FiddlerCore for full programmatic control.
Ready to level up? more tutorials cover everything from conditional breakpoints to WebSocket inspection. Or explore our full suite of browse Advanced Techniques tutorials for power-user workflows.
Fiddler CLI isn’t magic—it’s muscle. And like any muscle, it grows stronger with deliberate practice, precise tooling, and real-world pressure testing.