Skip to content

VassilisSoum/Tracetap

Repository files navigation

TraceTap

HTTP/HTTPS Traffic Capture with AI-Powered Postman Export

License: MIT Python 3.8+ PRs Welcome

TraceTap captures HTTP/HTTPS traffic and uses Claude AI to automatically generate clean, organized Postman collections. Perfect for API testing, documentation, debugging, and creating realistic mocks.


✨ Features

  • πŸ”’ HTTPS Support - Intercept HTTPS traffic with automatic certificate installation
  • πŸ€– AI-Powered Organization - Claude AI cleans and organizes your captures into production-ready collections
  • 🎯 Smart Filtering - Capture only what you need with host and regex filters
  • πŸ“¦ Multiple Export Formats - Postman Collection v2.1, Raw JSON, WireMock stubs
  • πŸ”„ Incremental Updates - Merge new captures with existing collections without losing work
  • πŸš€ Zero Configuration - Single executable, no Python required
  • 🌐 Cross-Platform - Works on Linux, macOS, and Windows
  • ⚑ Real-Time Monitoring - See captured traffic as it happens

πŸš€ Quick Start

1. Download

Choose your platform:

2. Install Certificate (One-Time)

# Linux
./chrome-cert-manager.sh install

# macOS
./macos-cert-manager.sh install

# Windows
powershell -ExecutionPolicy Bypass .\windows-cert-manager.ps1 install

3. Start Capturing

# Basic capture
./tracetap-linux-x64 --listen 8080 --raw-log capture.json

# Configure your browser proxy to localhost:8080
# Browse your app - traffic is captured!
# Press Ctrl+C to stop

4. Enhance with AI (Optional)

export ANTHROPIC_API_KEY='sk-ant-your-key-here'

python tracetap-ai-postman.py capture.json \
  --output enhanced_collection.json

5. Import to Postman

Open Postman β†’ Import β†’ Select enhanced_collection.json β†’ Done! πŸŽ‰

πŸ“– Full Start Guide


🎯 Use Cases

API Testing & Documentation

Capture real API traffic from your application and instantly generate Postman collections for testing and documentation.

./tracetap-linux-x64 --filter-host "api.myapp.com" --listen 8080 --raw-log api.json
python tracetap-ai-postman.py api.json --output api_collection.json

Creating Test Mocks

Capture production API responses and convert them to WireMock stubs for offline development and testing.

./tracetap-linux-x64 --filter-host "api.stripe.com" --raw-log stripe.json
python tracetap2wiremock.py stripe.json --output wiremock/mappings/

Debugging Integration Issues

See exactly what requests and responses are being sent during integration issues.

./tracetap-linux-x64 --verbose --filter-regex ".*\/api\/.*" --raw-log debug.json
cat debug.json | jq '.requests[] | select(.status >= 400)'

πŸ“– Documentation


πŸ”§ Advanced Usage

Smart Filtering

# Capture specific host
./tracetap-linux-x64 --filter-host "api.example.com" --listen 8080

# Capture with wildcard
./tracetap-linux-x64 --filter-host "*.example.com" --listen 8080

# Capture by URL pattern
./tracetap-linux-x64 --filter-regex ".*\/api\/v[0-9]+\/.*" --listen 8080

# Combine filters (OR logic)
./tracetap-linux-x64 \
  --filter-host "api.example.com" \
  --filter-regex ".*\/v2\/.*" \
  --listen 8080

AI Enhancement Options

# Custom instructions
python tracetap-ai-postman.py capture.json \
  --instructions "Focus on /api/v2 endpoints. Remove all /metrics calls." \
  --output collection.json

# Save analysis for review
python tracetap-ai-postman.py capture.json \
  --save-analysis analysis.json \
  --output collection.json

WireMock Integration

# Capture traffic
./tracetap-linux-x64 --listen 8080 --raw-log api.json

# Convert to WireMock stubs
python tracetap2wiremock.py api.json --output wiremock/mappings/

# Run WireMock
docker run -p 8080:8080 \
  -v $(pwd)/wiremock/mappings:/home/wiremock/mappings \
  wiremock/wiremock

πŸ› οΈ Installation from Source

# Clone repository
git clone https://github.com/VassilisSoum/tracetap.git
cd tracetap

# Install dependencies
pip install -r requirements.txt

# Run from source
python tracetap.py --listen 8080

# For AI enhancement
pip install anthropic
export ANTHROPIC_API_KEY='sk-ant-your-key-here'
python tracetap-ai-postman.py capture.json --output collection.json

πŸ—ΊοΈ Roadmap

Current Version: 1.0.0

  • HTTP/HTTPS traffic capture
  • Postman Collection export
  • Raw JSON logging
  • WireMock stub generation
  • AI-powered enhancement with Claude
  • Incremental collection merging
  • Smart filtering (host, regex)
  • WebSocket support
  • HTTP/2 and HTTP/3 support
  • Request/response modification
  • OpenAPI/Swagger export
  • Web UI for browsing captures
  • Environment generation (dev/staging/prod)
  • Built-in request replay
  • Performance metrics dashboard

πŸ” Security & Privacy

⚠️ Important: TraceTap is designed for local development and testing only.

  • All traffic stays on your machine - nothing is sent to external servers
  • Captured data is stored locally in files you specify
  • Remove the certificate when done: ./cert-manager.sh remove
  • Don't use on production systems or shared computers
  • Review captured data before sharing (may contain tokens/passwords)

🀝 Contributing

Contributions are welcome! Whether it's:

  • πŸ› Bug reports
  • πŸ’‘ Feature requests
  • πŸ“– Documentation improvements
  • πŸ”§ Code contributions

Please see our Contributing Guide for details.


πŸ“„ License

MIT License - see LICENSE file for details.


πŸ™ Acknowledgments

  • Built on mitmproxy - an excellent open-source proxy
  • AI enhancement powered by Claude (Anthropic)

πŸ“ž Support


Made with ❀️ for developers who need better API debugging tools

About

Lightweight HTTP traffic recorder that auto-generates Postman collections for QA and developers.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published