proc_cli/lib.rs
1#![warn(missing_docs)]
2//! # proc - Semantic Process Management CLI
3//!
4//! Semantic CLI tool for process management. Target by port, PID, name or path.
5//!
6//! ## Features
7//!
8//! - **Unified Targets**: `:port`, `PID`, and `name` work the same everywhere
9//! - **Multi-Target**: `proc kill :3000,:8080,node` - comma-separated targets
10//! - **Query Language**: `proc by node --in .` - composable filters
11//! - **Working Directory**: See which project folder a process is running from
12//! - **Terminal-Adaptive Tables**: Tables adjust to terminal width automatically
13//! - **Consistent Filters**: `--in`, `--by`, `--min-uptime`, `--parent`, `--range`, `--sort`, `--limit`
14//! - **Real-Time Monitoring**: `proc watch` / `proc top` - live process table (interactive, TTY only)
15//! - **Process Waiting**: `proc wait node` - block until process(es) exit (pipe-friendly)
16//! - **Freeze/Thaw**: `proc freeze` / `proc thaw` - pause and resume by port, PID, or name
17//! - **Port Freeing**: `proc free :3000` - kill and verify port is available
18//! - **Ancestry Tracing**: `proc why :3000` - trace why a port is busy
19//! - **Orphan Detection**: `proc orphans` - find abandoned child processes
20//! - **File Lookup**: `proc for ./script.py` - find by file path
21//! - **Cross-Platform**: macOS, Linux, and Windows
22//! - **Shell Completions**: bash, zsh, fish via `proc completions`
23//! - **Man Pages**: `proc manpage` generates documentation
24//!
25//! ## Quick Start
26//!
27//! ```bash
28//! # What's on port 3000?
29//! proc on :3000
30//!
31//! # What's running this file?
32//! proc for ./script.py
33//!
34//! # Kill multiple targets
35//! proc kill :3000,:8080,node
36//!
37//! # Node processes in current directory
38//! proc by node --in .
39//!
40//! # Preview before killing
41//! proc kill node --dry-run
42//!
43//! # Kill only node processes in current directory
44//! proc kill node --in .
45//!
46//! # Watch processes in real-time
47//! proc watch node --in .
48//!
49//! # Generate shell completions
50//! proc completions zsh > ~/.zsh/completions/_proc
51//! ```
52//!
53//! ## Commands
54//!
55//! **Discovery**: `on`, `for`, `by`, `in`, `list`, `info`, `ports`, `tree`, `stuck`, `why`, `orphans`
56//!
57//! **Lifecycle**: `kill`, `stop`, `unstick`, `freeze`, `thaw`, `free`
58//!
59//! **Monitoring**: `watch` (interactive TUI), `wait` (blocking, pipe-friendly)
60//!
61//! **Tooling**: `completions`, `manpage`
62
63pub mod commands;
64pub mod core;
65pub mod error;
66pub mod ui;
67
68pub use error::{ProcError, Result};
69
70/// Library version
71pub const VERSION: &str = env!("CARGO_PKG_VERSION");