Skip to the content.

Complete documentation for the CallFlow Tracer CLI module.

Location: callflow_tracer/cli.py (850 lines)


Overview

The CLI provides a comprehensive command-line interface for all CallFlow Tracer features without writing Python code.

Available Commands

1. trace - Trace Function Calls

callflow-tracer trace script.py -o output.html
callflow-tracer trace script.py arg1 arg2 --3d --title "My Trace"

Options:

2. flamegraph - Generate Flamegraph

callflow-tracer flamegraph script.py -o flamegraph.html
callflow-tracer flamegraph script.py --min-time 0.5 --title "Performance"

Options:

3. profile - Profile Performance

callflow-tracer profile script.py -o profile.html
callflow-tracer profile script.py --memory --cpu --format json

Options:

4. memory-leak - Detect Memory Leaks

callflow-tracer memory-leak script.py -o report.html
callflow-tracer memory-leak script.py --threshold 10 --top 20

Options:

5. compare - Compare Traces

callflow-tracer compare trace1.json trace2.json -o comparison.html
callflow-tracer compare trace1.json trace2.json --label1 "Before" --label2 "After"

Options:

6. export - Export Traces

callflow-tracer export trace.json -o output.html --format html
callflow-tracer export trace.json -o output.html --format 3d

Options:

7. info - Show Trace Information

callflow-tracer info trace.json
callflow-tracer info trace.json --detailed

Options:

8. quality - Analyze Code Quality

callflow-tracer quality . -o quality_report.html
callflow-tracer quality . --track-trends --format json

Options:

9. predict - Predict Performance Issues

callflow-tracer predict history.json -o predictions.html
callflow-tracer predict history.json --format json

Options:

10. churn - Analyze Code Churn

callflow-tracer churn . -o churn_report.html
callflow-tracer churn . --days 90 --format json

Options:

Usage Examples

Basic Tracing

callflow-tracer trace my_script.py -o my_trace.html

Flamegraph with Title

callflow-tracer flamegraph my_script.py --title "Performance Analysis" -o perf.html

Memory Leak Detection

callflow-tracer memory-leak my_script.py --threshold 10 --top 15

Compare Two Traces

callflow-tracer compare before.json after.json --label1 "Before" --label2 "After"

Quality Analysis

callflow-tracer quality ./src --track-trends --format html

Predictive Analysis

callflow-tracer predict trace_history.json --format html

Code Churn Analysis

callflow-tracer churn . --days 180 --format html

Exit Codes

Environment Variables