Skip to content
/ pulse Public

🌐 A tiny, dependency-free CLI that checks the full networking chain β€” DNS β†’ TCP β†’ TLS β†’ HTTP β€” and presents actionable, beautifully formatted results for humans and machines.

License

Notifications You must be signed in to change notification settings

VAZlabs/pulse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

pulse β€” Advanced Network Diagnostics Tool

Version Python License

A high-performance async network diagnostics tool that checks DNS β†’ TCP β†’ TLS β†’ HTTP chains with comprehensive analysis, multiple output formats, and actionable insights.


✨ What's New in 2.0

  • Async Architecture β€” Concurrent checks with configurable workers
  • Multiple Output Formats β€” Terminal, JSON, CSV, HTML, Markdown, YAML
  • IPv6 Support β€” Full IPv4/IPv6 dual-stack support
  • Benchmark Mode β€” Run multiple iterations and get statistics
  • Comparison Mode β€” Compare multiple targets side-by-side
  • Deep Analysis β€” TLS certificate details, security headers, HTTP/2 detection
  • Configuration Files β€” Save and load settings
  • Retry Logic β€” Automatic retries with exponential backoff

πŸš€ Quick Start

# Install
pip install pulse-network-diagnostics

# Basic check
pulse google.com

# Multiple targets with comparison
pulse google.com cloudflare.com github.com --compare

# JSON output for automation
pulse google.com --format json

# Benchmark mode (10 iterations)
pulse google.com --benchmark

# Deep analysis with all checks
pulse api.example.com --deep --checks dns,tcp,tls,http

πŸ“Š Example Output

Terminal (Beautiful colors)

╔════════════════════════════════════════════════════════════╗
β•‘  πŸ” pulse β€” Network Diagnostics                            β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

  Target:  google.com

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Results                                                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

  β–Έ βœ“  DNS      12 ms  Β»  β†’ 142.250.180.14 (IPv4) +1 more
  β–Έ βœ“  TCP      45 ms  Β»  Connected (fast)
  β–Έ βœ“  TLS     165 ms  Β»  β†’ TLSv1.3 β€’ TLS_AES_256_GCM_SHA384
  β–Έ βœ“  HTTP    198 ms  Β»  β†’ GET / β†’ 301 β†’ https://www.google.com/

╔════════════════════════════════════════════════════════════╗
β•‘  ✨ All Systems Healthy ✨                                  β•‘
β•‘  Total time: 420 ms                                        β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

JSON (Machine-readable)

[
  {
    "target": "google.com",
    "address": "google.com:443",
    "checks": [
      {
        "name": "DNS",
        "duration_ms": 12.34,
        "status": "success",
        "details": "β†’ 142.250.180.14 (IPv4) +1 more",
        "metadata": {
          "ips": ["142.250.180.14", "2a00:1450::200e"],
          "ipv4_count": 1,
          "ipv6_count": 1
        }
      }
    ],
    "total_duration_ms": 420.5,
    "is_healthy": true
  }
]

πŸ› οΈ Installation

From PyPI (Recommended)

pip install pulse-network-diagnostics

From Source

git clone https://github.com/vazor-code/pulse.git
cd pulse
pip install -e .

Development Mode

pip install -e ".[dev]"
pip install -r requirements-dev.txt

🐍 From Source

# Download and run directly
wget https://raw.githubusercontent.com/vazor-code/pulse/main/pulse.py
python pulse.py api.github.com

πŸ“– Usage

Basic Checks

# Check a single host
pulse example.com

# Check specific port
pulse example.com:8080

# Check with URL
pulse https://api.github.com

# Check multiple targets
pulse google.com github.com cloudflare.com

Output Formats

# Terminal (default, with colors)
pulse google.com

# JSON
pulse google.com --format json

# CSV
pulse google.com --format csv -o results.csv

# HTML report
pulse google.com --format html -o report.html

# Markdown
pulse google.com --format markdown

# YAML
pulse google.com --format yaml

Advanced Options

# Deep analysis (certificate info, security headers)
pulse google.com --deep

# IPv6 preference
pulse google.com --ipv6

# HTTP/2 support check
pulse google.com --http2

# Custom timeout and retries
pulse google.com --timeout 30 --retries 3

# Concurrent workers
pulse target1.com target2.com target3.com --workers 5

# Quiet mode (errors only)
pulse google.com --quiet

# No colors
pulse google.com --no-color

# Verbose output
pulse google.com -v
pulse google.com -vv  # Debug level

Benchmark Mode

# Run 10 iterations
pulse google.com --benchmark

# With verbose output
pulse google.com --benchmark -v

Comparison Mode

# Compare multiple targets side-by-side
pulse google.com cloudflare.com github.com --compare

Configuration Files

# Save current options
pulse google.com --deep --timeout 30 --save-config myconfig.json

# Load configuration
pulse google.com --config myconfig.json

Reading Targets from File

# Create targets.txt with one target per line
echo "google.com
cloudflare.com
github.com" > targets.txt

# Check all targets
pulse -f targets.txt --compare

πŸ—οΈ Architecture

pulse/
β”œβ”€β”€ pulse/
β”‚   β”œβ”€β”€ __init__.py          # Main CLI entry point
β”‚   β”œβ”€β”€ __main__.py          # Module execution
β”‚   β”œβ”€β”€ core/                # Core components
β”‚   β”‚   β”œβ”€β”€ config.py        # Configuration management
β”‚   β”‚   β”œβ”€β”€ engine.py        # Async check engine
β”‚   β”‚   β”œβ”€β”€ target.py        # Target parsing
β”‚   β”‚   └── result.py        # Result data classes
β”‚   β”œβ”€β”€ checks/              # Check implementations
β”‚   β”‚   β”œβ”€β”€ dns.py           # DNS resolution
β”‚   β”‚   β”œβ”€β”€ tcp.py           # TCP connectivity
β”‚   β”‚   β”œβ”€β”€ tls.py           # TLS/SSL handshake
β”‚   β”‚   └── http.py          # HTTP/HTTPS requests
β”‚   β”œβ”€β”€ output/              # Output formatters
β”‚   β”‚   β”œβ”€β”€ formatters.py    # Main formatter dispatcher
β”‚   β”‚   └── terminal.py      # Terminal output with colors
β”‚   └── utils/               # Utilities
β”‚       └── logger.py        # Logging utilities
β”œβ”€β”€ tests/                   # Test suite
└── docs/                    # Documentation

πŸ§ͺ Testing

# Run all tests
pytest

# Run with coverage
pytest --cov=pulse

# Run specific test file
pytest tests/test_pulse.py

# Run with verbose output
pytest -v

πŸ“‹ CLI Reference

usage: pulse [-h] [--from-file] [--compare] [--deep] [--checks CHECKS]
             [--timeout TIMEOUT] [--retries RETRIES] [--ipv6] [--http2]
             [--follow-redirects]
             [--format {terminal,json,csv,html,markdown,yaml}]
             [--output OUTPUT] [--quiet] [--no-color] [--verbose]
             [--workers WORKERS] [--benchmark] [--config CONFIG]
             [--save-config SAVE_CONFIG] [--version]
             [targets ...]

positional arguments:
  targets               Host[:port], URL, or path to file with targets

options:
  -h, --help            show this help message and exit
  --from-file, -f       Read targets from file (one per line)
  --compare, -c         Compare multiple targets side by side
  --deep, -d            Enable deep analysis (TLS analysis, anomaly detection)
  --checks CHECKS       Comma-separated list of checks (default: dns,tcp,tls,http)
  --timeout TIMEOUT, -t TIMEOUT
                        Timeout per check in seconds (default: 10)
  --retries RETRIES, -r RETRIES
                        Number of retries for failed checks (default: 1)
  --ipv6                Prefer IPv6 over IPv4
  --http2               Check HTTP/2 support
  --follow-redirects    Follow HTTP redirects (default: True)
  --format {terminal,json,csv,html,markdown,yaml}, -o {terminal,json,csv,html,markdown,yaml}
                        Output format (default: terminal)
  --output OUTPUT, -O OUTPUT
                        Output file path (default: stdout)
  --quiet, -q           Suppress non-error output
  --no-color            Disable colored output
  --verbose, -v         Increase verbosity (use -vv for debug)
  --workers WORKERS, -w WORKERS
                        Number of concurrent workers (default: 10)
  --benchmark, -b       Run benchmark mode (10 iterations)
  --config CONFIG       Path to configuration file
  --save-config SAVE_CONFIG
                        Save current options to configuration file
  --version             show program's version number and exit

Exit Codes

  • 0 β€” All healthy (all checks passed)
  • 1 β€” Warnings detected (performance issues)
  • 2 β€” Failures detected (connection errors)
  • 130 β€” Interrupted by user (Ctrl+C)

πŸ”§ Troubleshooting

DNS Issues

❌ DNS Resolution Failed
   β†’ Run: nslookup <host>
   β†’ Try: nslookup <host> 8.8.8.8
   β†’ Check: /etc/resolv.conf or DNS settings

TCP Connection Issues

❌ TCP Connection Failed
   β†’ Service not listening on port
   β†’ Check firewall rules
   β†’ Run: netstat -an | grep <port>

TLS Issues

❌ TLS Handshake Failed
   β†’ Certificate issue or service down
   β†’ Run: openssl s_client -connect <host>:<port>
   β†’ Check certificate expiration

HTTP Issues

❌ HTTP Request Failed
   β†’ Application may be offline
   β†’ Check service logs
   β†’ Verify URL path

🀝 Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run tests (pytest)
  5. Commit your changes (git commit -m 'feat: Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

Development Setup

# Clone and setup
git clone https://github.com/vazor-code/pulse.git
cd pulse
pip install -e ".[dev]"

# Run tests
pytest

# Code formatting
black pulse tests
isort pulse tests

# Type checking
mypy pulse

# Linting
flake8 pulse tests

πŸ“„ License

This project is licensed under the GPL-3.0 License β€” see the LICENSE file for details.


πŸ™ Acknowledgments

  • Inspired by the need for simple, fast network diagnostics
  • Built with Python's excellent asyncio and ssl modules
  • Thanks to all contributors!

Made with ❀️ by the pulse team

About

🌐 A tiny, dependency-free CLI that checks the full networking chain β€” DNS β†’ TCP β†’ TLS β†’ HTTP β€” and presents actionable, beautifully formatted results for humans and machines.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks