Skip to main content

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 with auto-refresh
15//! - **Freeze/Thaw**: `proc freeze` / `proc thaw` - pause and resume by port, PID, or name
16//! - **Port Freeing**: `proc free :3000` - kill and verify port is available
17//! - **Ancestry Tracing**: `proc why :3000` - trace why a port is busy
18//! - **Orphan Detection**: `proc orphans` - find abandoned child processes
19//! - **File Lookup**: `proc for ./script.py` - find by file path
20//! - **Cross-Platform**: macOS, Linux, and Windows
21//! - **Shell Completions**: bash, zsh, fish via `proc completions`
22//! - **Man Pages**: `proc manpage` generates documentation
23//!
24//! ## Quick Start
25//!
26//! ```bash
27//! # What's on port 3000?
28//! proc on :3000
29//!
30//! # What's running this file?
31//! proc for ./script.py
32//!
33//! # Kill multiple targets
34//! proc kill :3000,:8080,node
35//!
36//! # Node processes in current directory
37//! proc by node --in .
38//!
39//! # Preview before killing
40//! proc kill node --dry-run
41//!
42//! # Kill only node processes in current directory
43//! proc kill node --in .
44//!
45//! # Watch processes in real-time
46//! proc watch node --in .
47//!
48//! # Generate shell completions
49//! proc completions zsh > ~/.zsh/completions/_proc
50//! ```
51//!
52//! ## Commands
53//!
54//! **Discovery**: `on`, `for`, `by`, `in`, `list`, `info`, `ports`, `tree`, `stuck`, `watch`, `why`, `orphans`
55//!
56//! **Lifecycle**: `kill`, `stop`, `unstick`, `freeze`, `thaw`, `free`
57//!
58//! **Tooling**: `completions`, `manpage`
59
60pub mod commands;
61pub mod core;
62pub mod error;
63pub mod ui;
64
65pub use error::{ProcError, Result};
66
67/// Library version
68pub const VERSION: &str = env!("CARGO_PKG_VERSION");