Skip to content
/ tsk Public

A simple, fast and efficient command-line process manager written in Rust

Notifications You must be signed in to change notification settings

sammwyy/tsk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TSK - CLI Process Manager

A fast and efficient command-line process manager written in Rust. Monitor, list, and manage system processes with ease.

Features

  • 📊 List and monitor system processes
  • 🔍 Filter processes by name or executable path
  • 💾 Accurate memory usage reporting
  • 🧵 View individual threads or grouped processes
  • ⚡ Sort by CPU or memory usage
  • 🎯 Kill processes by PID, name, or filter
  • 🔌 Filter processes by port number
  • 👁️ Real-time process monitoring
  • 📋 Detailed process information

Installation

Building from Source

Prerequisites

  • Rust (1.70 or higher)

Clone and Build

# Clone the repository
git clone https://github.com/sammwyy/tsk.git
cd tsk

# Build the project
cargo build --release

# The binary will be available at target/release/tsk

Install Globally

# Install to ~/.cargo/bin
cargo install --path .

# Or copy the binary to a directory in your PATH
sudo cp target/release/tsk /usr/local/bin/

Usage

List Processes

# List top 10 processes by memory usage
tsk ls

# List top 20 processes
tsk ls 20

# List all threads separately (no grouping)
tsk ls --threads
tsk ls -t

# Sort by CPU usage
tsk ls --cpu

# Show processes with lowest resource usage
tsk ls --low

# Filter by process name
tsk ls -f chrome

# Filter by executable path
tsk ls -e firefox

# Filter by port number
tsk ls -p 3000
tsk ls --port 8080

# Combine flags
tsk ls 15 --cpu -f node
tsk ls -p 3000 -t

Output

When not using --threads (default):

PID      NAME                           MEMORY          CPU %    THREADS 
===========================================================================
40147    ProfilerChild                  195.60 GB       19.51    4       
61690    VfsIoser                       50.29 GB        0.00     2       

When using --threads:

PID      NAME                           MEMORY          CPU %    
=================================================================
40147    ProfilerChild                  195.60 GB       19.51    
40148    ProfilerChild                  195.60 GB       5.20     
40149    ProfilerChild                  195.60 GB       8.15     

Kill Processes

# Kill by PID
tsk kill 1234

# Kill by executable name (kills first match)
tsk kill -e firefox

# Kill by process name filter (kills first match)
tsk kill -f chrome

# Kill by port number (kills first match)
tsk kill -p 3000
tsk kill --port 8080

# Kill all matching processes
tsk kill -f chrome --all
tsk kill -e node --all
tsk kill -p 3000 --all

Process Information

# Show detailed info by PID
tsk info 1234

# Show info by executable name
tsk info -e firefox

# Show info by process name filter
tsk info -f chrome

# Show info by port number
tsk info -p 3000
tsk info --port 8080

Output Example

=== Process Information ===
PID: 1234
Name: firefox
Memory: 1.25 GB
CPU: 5.32%
Executable: /usr/bin/firefox
Working Directory: /home/user
Run Time: 3600 seconds

Arguments:
  firefox
  --profile
  /home/user/.mozilla/firefox/default

Environment Variables:
  PATH=/usr/local/bin:/usr/bin
  HOME=/home/user
  ... and 45 more

Monitor Processes

Watch for new processes in real-time:

# Monitor all processes
tsk watch

# Monitor specific executable
tsk watch -e node

# Monitor with name filter
tsk watch -f chrome

# Custom refresh interval (in milliseconds)
tsk watch -r 500

# Combine flags
tsk watch -e python -r 2000

Output Example

Monitoring processes (Ctrl+C to exit)...

[2025-12-04 10:30:45] New process detected:
  PID: 5678
  Name: node
  Path: /usr/bin/node
  Args: node server.js --port 3000

[2025-12-04 10:31:02] New process detected:
  PID: 5690
  Name: npm
  Path: /usr/bin/npm
  Args: npm install express

Command Reference

tsk ls [OPTIONS] [LIMIT]

List system processes.

Arguments:

  • LIMIT - Number of processes to display (default: 10)

Options:

  • -t, --threads - Show all threads separately (no grouping)
  • --cpu - Sort by CPU usage instead of memory
  • --low - Show processes with lowest resource usage
  • -f, --filter <NAME> - Filter by process name
  • -e, --exe <PATH> - Filter by executable path
  • -p, --port <PORT> - Filter by port number

tsk kill [OPTIONS] [PID]

Kill one or more processes.

Arguments:

  • PID - Process ID to kill

Options:

  • -e, --exe <PATH> - Kill by executable name
  • -f, --filter <NAME> - Kill by process name filter
  • -p, --port <PORT> - Kill by port number
  • --all - Kill all matching processes (use with -e, -f, or -p)

tsk info [OPTIONS] [PID]

Show detailed information about a process.

Arguments:

  • PID - Process ID

Options:

  • -e, --exe <PATH> - Find by executable name
  • -f, --filter <NAME> - Find by process name filter
  • -p, --port <PORT> - Find by port number

tsk watch [OPTIONS]

Monitor processes in real-time.

Options:

  • -e, --exe <PATH> - Monitor specific executable
  • -f, --filter <NAME> - Monitor by name filter
  • -r, --refresh <MS> - Refresh interval in milliseconds (default: 1000)

Understanding Memory Reporting

TSK correctly handles multi-threaded processes:

  • Without --threads: Processes are grouped by executable, and memory is reported accurately (not duplicated across threads). The THREADS column shows how many threads belong to that process.

  • With --threads: All threads are shown separately. Note that threads of the same process will show the same memory value because they share the same memory space.

Dependencies

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Author

Created by Sammwy

Support

If you encounter any issues or have questions, please open an issue on GitHub.

About

A simple, fast and efficient command-line process manager written in Rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages