devpulse 1.0.0

Developer diagnostics: HTTP timing, build artifact cleanup, environment health checks, port scanning, PATH analysis, and config format conversion
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
# DevPulse

```
╔══════════════════════════════════════════════════════════════════════════╗
║                                                                          ║
║     ██████╗ ███████╗██╗   ██╗██████╗ ██╗   ██╗██╗     ███████╗███████╗   ║
║     ██╔══██╗██╔════╝██║   ██║██╔══██╗██║   ██║██║     ██╔════╝██╔════╝   ║
║     ██║  ██║█████╗  ██║   ██║██████╔╝██║   ██║██║     ███████╗█████╗     ║
║     ██║  ██║██╔══╝  ╚██╗ ██╔╝██╔═══╝ ██║   ██║██║     ╚════██║██╔══╝     ║
║     ██████╔╝███████╗ ╚████╔╝ ██║     ╚██████╔╝███████╗███████║███████╗   ║
║     ╚═════╝ ╚══════╝  ╚═══╝  ╚═╝      ╚═════╝ ╚══════╝╚══════╝╚══════╝   ║
║                                                                          ║
║           Take the pulse of your dev environment ⚡                      ║
║                                                                          ║
║                    🐸 LazyFrog | kindware.dev                            ║
║                                                                          ║
╚══════════════════════════════════════════════════════════════════════════╝
```

[![CI](https://github.com/Brutus1066/devpulse/actions/workflows/ci.yml/badge.svg)](https://github.com/Brutus1066/devpulse/actions/workflows/ci.yml)
[![Rust](https://img.shields.io/badge/Rust-2021-orange.svg)](https://www.rust-lang.org/)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
![Tests](https://img.shields.io/badge/Tests-79_passing-brightgreen)
[![Windows](https://img.shields.io/badge/Windows-0078D6?logo=windows&logoColor=white)](https://www.microsoft.com/windows)
[![Linux](https://img.shields.io/badge/Linux-FCC624?logo=linux&logoColor=black)](https://www.linux.org/)
[![macOS](https://img.shields.io/badge/macOS-000000?logo=apple&logoColor=white)](https://www.apple.com/macos)
[![crates.io](https://img.shields.io/crates/v/devpulse.svg)](https://crates.io/crates/devpulse)

> Developer diagnostics in a single binary. TUI dashboard, HTTP timing, port scanning, environment analysis, build cleanup, and config conversion — all from one fast Rust CLI.

---

## 🎯 What is DevPulse?

DevPulse is an all-in-one developer environment diagnostics toolkit. Instead of juggling dozens of scattered tools (`curl`, `lsof`, `netstat`, `httpstat`, `npkill`, `jq`, ...), DevPulse gives you everything in **one binary, one command: `devpulse`**.

- 🖥️ **Interactive TUI** — Beautiful terminal dashboard with keyboard navigation
-**Fast** — Parallel scanning, zero async, pure Rust performance
- 🌐 **Cross-platform** — Windows, Linux, macOS — same binary, same features
- 📋 **JSON output** — Every command supports `--json` for scripting and CI
- 🔒 **Safe** — Zero `unsafe` code, confirmation before all deletions
- 🦀 **Single binary** — No runtime dependencies, no config files, no setup

---

## ✨ Features

| Tool | Description | Inspired By |
|------|-------------|-------------|
| 🖥️ **TUI Dashboard** | Interactive terminal UI with arrow-key navigation ||
| 🩺 **Doctor** | Dev tool health checker (Git, Node, Rust, Python, Docker, disk, SSH) | `flutter doctor` |
| 🔌 **Ports** | Parallel port scanner with banner grabbing, PIDs, 36+ service hints | `lsof` / `nmap` |
| 🌍 **Env** | PATH analyzer, dev vars, proxy, CI, `.env`, Git config & SSH key audit ||
| 🧹 **Sweep** | Build artifact scanner & cleaner (node_modules, target, etc.) | `npkill` |
| ⏱️ **HTTP** | Request timing with DNS/TCP/TLS/TTFB breakdown, security audit (A-F), TLS cert, redirects | `httpstat` |
| 🔄 **Convert** | Config converter: JSON ↔ YAML ↔ TOML ↔ .env with dot-flattening ||

---

## 📸 Screenshots

### TUI Dashboard
![TUI Dashboard](screenshots/devpulse-tui-dashboard.png)

### Doctor — Health Check
![Doctor Check](screenshots/devpulse-doctor-check.png)

### Ports — Port Scanner
![Port Scan](screenshots/devpulse-port-scan.png)

### About
![About](screenshots/devpulse-about.png)

---

## 📦 Installation

### From crates.io

```sh
cargo install devpulse
```

### From source

```sh
git clone https://github.com/Brutus1066/devpulse.git
cd devpulse
cargo build --release
# Binary at: target/release/devpulse(.exe)
```

### Pre-built Binaries

Download from [Releases](https://github.com/Brutus1066/devpulse/releases):

| Platform | Binary |
|----------|--------|
| Windows x86_64 | `devpulse-windows-x64.exe` |
| Linux x86_64 | `devpulse-linux-x64` |
| macOS x86_64 | `devpulse-macos-x64` |
| macOS ARM64 | `devpulse-macos-arm64` |

---

## 🚀 Quick Start

```sh
# Launch interactive TUI dashboard (no args needed)
devpulse

# Or use CLI subcommands directly:
devpulse doctor                          # Health-check your dev toolchain
devpulse ports                           # See what's listening on your ports
devpulse env                             # Analyze PATH, dev vars, .env files
devpulse sweep ~/projects                # Find build artifacts
devpulse http https://api.github.com     # Time HTTP requests
devpulse convert config.yaml --to json   # Convert config formats
```

---

## 🖥️ Interactive TUI

Run `devpulse` with no arguments to launch the interactive dashboard:

| Key | Action |
|-----|--------|
| ↑↓ / j/k | Navigate menu |
| 1–7 | Quick select tool (from any screen) |
| Enter | Run selected tool |
| Tab / Shift+Tab | Cycle through tools |
| r | Re-run current tool (refresh) |
| F1 / ? | Help screen |
| ↑↓ / PgUp/PgDn / Home/End | Scroll results |
| Esc | Back to menu |
| q | Quit |

DevPulse auto-detects interactive terminals. In non-TTY environments (CI, piped), it falls back to CLI help output.

---

## 📖 CLI Reference

```
$ devpulse --help
Developer diagnostics: HTTP timing, build artifact cleanup, environment
health checks, port scanning, PATH analysis, and config format conversion

Usage: devpulse [OPTIONS] [COMMAND]

Commands:
  doctor       Dev environment health checker
  ports        Listening port inspector & scanner
  env          Environment variable analyzer
  sweep        Build artifact scanner/cleaner
  http         HTTP request timing visualizer
  convert      Config format converter
  completions  Generate shell completions
  help         Print help for a command

Options:
      --json                       Output in JSON format
      --color <auto|always|never>  Control colored output
  -h, --help                       Print help
  -V, --version                    Print version

🐸 LazyFrog | kindware.dev
```

### 🩺 `doctor` — Toolchain Health Check

Checks Git, Node.js, Rust, Python, Docker, disk space, and SSH keys. Reports pass/warn/fail for each. All 7 checks run **in parallel** for maximum speed.

```sh
devpulse doctor
devpulse doctor --json          # JSON output for CI
```

### 🔌 `ports` — Port Scanner & Network Inspector

Shows listening TCP ports with PID, process name, service hints, and network address binding. Includes **parallel scanning** powered by rayon and **banner grabbing** with protocol-specific probes.

```sh
devpulse ports                          # All listening ports
devpulse ports --port 3000              # Filter by port
devpulse ports --scan-range 8000-9000   # Scan custom port range
devpulse ports --json                   # JSON output
```

**Service detection** covers 36+ well-known ports: SSH (22), HTTP (80/8080), HTTPS (443), MySQL (3306), PostgreSQL (5432), Vite (5173), Redis (6379), MongoDB (27017), Docker (2375), and more.

**Banner grabbing** — For each open port, DevPulse sends protocol-specific probes:
- HTTP ports: `HEAD / HTTP/1.0` → extracts `Server` header
- Redis: `PING` → expects `PONG`
- Generic: reads initial banner bytes

### 🌍 `env` — Environment Analyzer

Analyzes PATH (duplicates, missing dirs, tool discovery), dev environment variables, proxy settings, CI detection, `.env` file scanning, Git configuration audit, and SSH key security audit.

```sh
devpulse env                            # Full report
devpulse env --filter path              # PATH analysis only
devpulse env --filter proxy             # Proxy vars only
devpulse env --filter dotenv            # .env file report
devpulse env --json                     # JSON output
```

**Git Config audit** — Reads 7 global Git keys (user.name, user.email, commit.gpgsign, core.editor, core.autocrlf, credential.helper, init.defaultBranch) with warnings for missing identity and unsigned commits.

**SSH Key audit** — Scans `~/.ssh/*.pub` for key type (RSA/ED25519/ECDSA/DSA), bit strength, and age. Warns on weak keys (RSA < 3072), old keys (> 2 years), and deprecated algorithms (DSA).

### 🧹 `sweep` — Build Artifact Scanner

Finds and optionally deletes build artifacts: `node_modules`, `target/`, `__pycache__`, `.gradle`, `.next`, `venv`, `dist`, `.tox`, and more.

```sh
devpulse sweep .                        # Scan current directory
devpulse sweep ~/projects --min-size 100M  # Only show > 100 MB
devpulse sweep . -y                     # Delete all found artifacts
devpulse sweep . --json                 # JSON output
```

### ⏱️ `http` — HTTP Timing & Security Audit

Measures DNS lookup, TCP connect, TLS handshake, server processing (TTFB), and content transfer. Includes **security header audit** with A-F grading, **TLS certificate inspection**, and **redirect chain tracing**.

```sh
devpulse http https://api.github.com
devpulse http -X POST -H "Content-Type: application/json" \
  -d '{"key":"val"}' https://httpbin.org/post
devpulse http https://example.com --json
```

**Security audit** — Checks 8 critical HTTP security headers (HSTS, CSP, X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Permissions-Policy, X-XSS-Protection, COOP) with weighted **A-F grade**.

**TLS certificate** — Extracts subject, issuer, validity dates, days until expiry, key algorithm & size, and SANs via x509-parser.

**Redirect chain** — Follows HTTP redirects (301/302/303/307/308) up to 10 hops with per-hop timing.

### 🔄 `convert` — Config Format Converter

Converts between JSON, YAML, TOML, and .env with auto-detection from file extension. Nested structures are dot-flattened for .env output.

```sh
devpulse convert config.yaml --to json         # YAML → JSON
devpulse convert settings.json --to toml       # JSON → TOML
devpulse convert app.toml --to env             # TOML → .env
devpulse convert .env --to yaml                # .env → YAML
devpulse convert config.yaml --to json -o out.json  # Write to file
```

---

## ⚙️ Global Flags

| Flag | Description |
|------|-------------|
| `--json` | Output in JSON format (all subcommands) |
| `--color <auto\|always\|never>` | Control colored output. Respects `NO_COLOR` |
| `--version` | Print version |
| `--help` | Print help |

---

## 🐚 Shell Completions

```sh
devpulse completions bash > ~/.local/share/bash-completion/completions/devpulse
devpulse completions zsh > ~/.zfunc/_devpulse
devpulse completions fish > ~/.config/fish/completions/devpulse.fish
devpulse completions powershell > devpulse.ps1   # dot-source in $PROFILE
```

---

## 🔒 Security & Safety

| | |
|---|---|
| 🚫 Zero `unsafe` code | Pure safe Rust throughout |
| 🚫 Zero `.unwrap()` | All errors handled with `thiserror` |
| 🔒 CRLF injection prevention | HTTP headers validated for injection attacks |
| 🔒 TCP timeouts | 30s read / 10s write to prevent hanging |
| 🔒 Body size cap | 10 MB max response body to prevent OOM |
| ✅ UTF-8 safe truncation | No panics on multi-byte characters |
| ✅ Confirmation before delete | Sweep requires explicit confirmation |
| ✅ Selective deletion | Type `1,3,5` to delete specific items |
| ✅ Offline | sweep, doctor, env, ports work fully offline |

---

## 🛠️ Building

```sh
# Debug build
cargo build

# Release build (optimized, LTO, stripped)
cargo build --release

# Run tests
cargo test

# Lint
cargo clippy -- -D warnings

# Format check
cargo fmt -- --check
```

---

## 🧪 Tests

79 tests — all passing ✓

```
64 unit tests across 11 modules
15 integration tests (end-to-end CLI pipeline)
 0 failures
```

```sh
cargo test          # Run all tests
cargo clippy        # Zero warnings
```

---

## 🏗️ Project Structure

```
src/
  main.rs      — Entry point, Windows VT bootstrap, TUI/CLI dispatch
  cli.rs       — clap derive definitions (6 subcommands + global flags)
  error.rs     — Unified thiserror error types
  utils.rs     — Shared utilities (format_size, safe_truncate)
  tui.rs       — Interactive ratatui/crossterm TUI dashboard
  doctor.rs    — Dev environment health checker (7 parallel checks)
  ports.rs     — Parallel port scanner + banner grabbing + network scan
  env.rs       — PATH analyzer, dev vars, proxy, CI, .env, Git, SSH audit
  sweep.rs     — Build artifact scanner/cleaner
  http.rs      — HTTP timing + security audit + TLS cert + redirects
  convert.rs   — Config converter: JSON ↔ YAML ↔ TOML ↔ .env
tests/
  integration_tests.rs — CLI exit code & JSON output tests
```

### Design Principles

- **Zero async** — Pure synchronous Rust, no runtime overhead
- **One module per feature** — Clean separation of concerns
- **`thiserror`** for all errors — No `process::exit()` calls in library code
- **`serde`** JSON on everything — All outputs are machine-readable
- **Cross-platform** — Windows/macOS/Linux with compile-time `#[cfg]` guards
- **LTO + strip** — Release binary ~2 MB, fully self-contained

---

## 📋 Dependencies

All pure Rust. No OpenSSL. No system libraries.

| Crate | Purpose |
|-------|---------|
| clap 4.4 | CLI argument parsing with derive |
| ratatui 0.29 | Terminal UI framework |
| crossterm 0.28 | Cross-platform terminal control |
| serde 1.0 + serde_json 1.0 | Serialization & JSON |
| serde_yml 0.0.12 | YAML support (replaces deprecated serde_yaml) |
| toml 0.8 | TOML support |
| thiserror 1.0 | Error handling |
| colored 2.1 | CLI colored output |
| walkdir 2.5 | Directory walking |
| rayon 1.10 | Parallel scanning |
| native-tls 0.2 | TLS connections |
| x509-parser 0.16 | TLS certificate inspection |
| sysinfo 0.32 | System information |

---

## 🪟 Windows / PowerShell

DevPulse works great in PowerShell 5.1, PowerShell 7, and Windows Terminal:

- **Colors** — Automatically enables Virtual Terminal processing
- **TUI** — Full interactive dashboard via ratatui + crossterm
- **NO_COLOR** — Respects the `NO_COLOR` environment variable
- **Globs** — Uses `wild` crate so `devpulse sweep *` works correctly
- **Exit codes** — Returns proper exit codes for `$LASTEXITCODE` checks

---

## 🐸 LazyFrog Toolkit

| Tool | Description | Command | Install |
|------|-------------|---------|---------|
| [DevPulse]https://github.com/Brutus1066/devpulse | Dev environment diagnostics | `devpulse` | `cargo install devpulse` |
| [QuickCrypt]https://github.com/Brutus1066/QuickCrypt | Offline crypto toolkit | `qc` | `cargo install quickcrypt` |
| [QuickTransform]https://github.com/Brutus1066/QuickTransform | Encode/decode/hash toolkit | `qt` | `cargo install quicktransform` |
| [portr]https://github.com/Brutus1066/portr | Port inspector & process killer | `portr` | `cargo install portr` |
| [envcraft]https://github.com/Brutus1066/envcraft | .env file validator/differ/formatter | `envcraft` | `cargo install envcraft` |

---

## 📄 License

This project is licensed under the MIT License — see the [LICENSE](LICENSE) file for details.

---

## 🐸 About

DevPulse is developed by **LazyFrog** at [kindware.dev](https://kindware.dev/).

- 📧 Support: [support@kindware.dev]mailto:support@kindware.dev
- 🐙 GitHub: [github.com/Brutus1066/devpulse]https://github.com/Brutus1066/devpulse
- 🌐 Website: [kindware.dev]https://kindware.dev/

---

🐸 LazyFrog | [kindware.dev]https://kindware.dev/ | [GitHub]https://github.com/Brutus1066

*Take the pulse of your dev environment.*