PScan is a cross-platform command-line tool for process filtering and analysis with advanced window detection capabilities. It provides multiple output formats and flexible filtering options to help developers and system administrators quickly locate and analyze system processes.
- Quick Process Location: Rapidly find target processes among numerous system processes
- Window Association Analysis: Identify which processes have graphical interface windows
- Multi-format Output: Support for table, JSON, YAML, CSV, and other formats for easy integration with other tools
- Cross-platform Compatibility: Runs on both Windows and Unix-like systems
- Finding specific processes when debugging applications
- System resource monitoring and analysis
- Automation script integration
- Process management tool development
- PID Filter: Exact filtering by process ID
- Name Filter: Fuzzy matching by process name (case-insensitive)
- Title Filter: Fuzzy matching by window title (case-insensitive)
- Window Status Filter: Filter processes with or without windows
- Table Format: Easy-to-read tabular output
- JSON Format: Easy parsing by programs
- YAML Format: Well-structured configuration format
- CSV Format: Spreadsheet-compatible format
- Simple Format: Concise single-line output
- Detailed Format: Complete process information display
- Windows: Full window detection support
- Linux/macOS: Basic process information support (window detection as placeholder)
pscan/
├── Cargo.toml # Project configuration and dependency management
├── Cargo.lock # Dependency version locking
├── README.md # Project documentation (Chinese)
├── README.en.md # Project documentation (English)
└── src/ # source code
┌─────────┐ ┌─────────┐ ┌──────────┐
│ main │───▶│ cli │───▶│ output │
└─────────┘ └─────────┘ └──────────┘
│ │ │
▼ ▼ ▼
┌─────────┐ ┌─────────┐ ┌──────────┐
│process │───▶│ types │◀───│ output │
└─────────┘ └─────────┘ └──────────┘
│
▼
┌─────────┐
│ window │
└─────────┘
Detailed Dependency Table
| Module | Dependencies | Used By |
|---|---|---|
| main.rs | cli, process, output, types | (Entry Point) |
| cli.rs | output::OutputFormat | main.rs |
| process.rs | types::ProcessInfo, window | main.rs |
| output.rs | types::{ProcessInfo, ProcessOutput} | main.rs, cli.rs |
| types.rs | (None) | main.rs, process.rs, output.rs |
| window.rs | (None) | process.rs |
- main.rs: Coordinates the entire application workflow
- cli.rs: Parses command line arguments and configuration
- process.rs: Enumerates, filters, and manages process information
- window.rs: Platform-specific window detection functionality
- output.rs: Multiple format data output and display
- types.rs: Defines core data structures and conversions
- No Circular Dependencies: All dependencies are unidirectional
- Clear Hierarchy: Clear layers from bottom (window/types) to top (main)
- Separation of Responsibilities: Each module has clear single responsibility
- Easy Testing: Loose coupling between modules facilitates unit testing
- Rust programming environment (version 1.70.0 or higher)
- Cargo package manager
- Install from Source
# Clone the project
git clone https://github.com/ymc-github/pscan.git
cd pscan
# Build and install
cargo install --path .- Install from Crates.io (after publication)
cargo install pscan- Run Locally
# Run in development mode
cargo run -- --help
# Run in release mode
cargo run --release -- --help# View all processes (table format)
pscan
# View detailed process information
pscan --verbose
# Filter by process name
pscan --name "chrome"
# Filter by window title
pscan --title "Visual Studio"
# Show only processes with windows
pscan --has-window# Exact search by PID
pscan --pid 1234
# Combined filtering: processes with name containing "code" and having windows
pscan --name "code" --has-window
# Show processes without windows
pscan --no-window# JSON format output
pscan --format json
# YAML format output
pscan --format yaml
# CSV format output (suitable for Excel import)
pscan --format csv
# Simple format output
pscan --format simple
# Detailed format output
pscan --format detailed# Combine filtering and output formats
pscan --name "firefox" --has-window --format json
# Table output in verbose mode
pscan --verbose --format table
# Pipeline processing: find Chrome processes and count them
pscan --name "chrome" --format simple | wc -l- PID: Process ID
- Name: Process name
- Title: Window title or fallback title
- Memory: Memory usage (MB)
- Window: Whether has window (shown only in verbose mode)
- Memory usage automatically converted to MB
- Raw memory usage in bytes (shown in detailed output)
- main.rs: Handles command-line parsing, process collection, and filtering logic
- output.rs: Handles all output format rendering and display
To add new output formats, add corresponding handling in the OutputFormat enum and display_processes function in output.rs.
-
Window Detection Not Working (Non-Windows Systems)
- Currently, window detection is fully supported only on Windows systems
- Other systems will display warning messages
-
Permission Issues
- Administrator privileges may be required on some systems to access all process information
-
Incomplete Process Information
- Some processes may not provide complete command-line or path information
Developer: YeMiancheng
Email: [email protected]
GitHub: ymc-github
This project is dual-licensed under:
- MIT License
- Apache License 2.0
You may choose either license according to your needs.
Issues and Pull Requests are welcome to help improve this project!
- Initial version release
- Basic process filtering functionality
- Multi-format output support
- Windows window detection feature