Skip to content

meliodas113/portman

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Portman

A powerful Go CLI tool to manage network ports across macOS, Linux, and Windows.

✨ Features

  • Cross-Platform Support: Works on macOS, Linux, and Windows
  • Port Listing: List all listening ports with detailed information
  • Port Information: Get comprehensive details about specific ports
  • Port Management: Close ports with graceful shutdown options
  • Real-time Monitoring: Watch ports for changes in real-time
  • Advanced Filtering: Filter by interface, protocol, user, and more
  • Rich Output: Color-coded output with tables and detailed information

🚀 Installation

go install

📖 Usage

List Ports

# List all ports
portman list

# Show detailed information
portman list --verbose

# Filter by interface
portman list --interface lo0

# Filter by protocol
portman list --protocol TCP

# Filter by user
portman list --user root

Get Port Information

# Get detailed info about a specific port
portman info 8080

Close Ports

# Close port with confirmation
portman close 8080

# Try graceful shutdown first
portman close 8080 --graceful

# Skip confirmation prompt
portman close 8080 --force

Monitor Ports

# Watch all ports every 5 seconds
portman watch

# Watch every 2 seconds
portman watch --interval 2s

# Watch specific port
portman watch --port 8080

# Watch for 10 iterations
portman watch --count 10

Other Commands

# Show version information
portman version

# Show help
portman --help

🔧 Requirements

  • Go 1.24+
  • macOS/Linux: lsof and ps commands
  • Windows: netstat command
  • Sudo access for closing ports (Unix systems)

🏗️ Architecture

portman/
├── cmd/           # CLI commands
├── internal/      # Core port management logic
├── main.go        # Application entry point
└── go.mod         # Go module definition

🆕 What's New

  • Cross-platform support for Windows, macOS, and Linux
  • Graceful shutdown with SIGTERM before SIGKILL
  • Real-time monitoring with change detection
  • Advanced filtering by interface, protocol, and user
  • Enhanced information including process start time and uptime
  • Better error messages with helpful guidance
  • Verbose output for detailed port information

🤝 Contributing

Feel free to submit issues and enhancement requests!

About

Portman is a cross-platform Go CLI tool for managing network ports on macOS, Linux, and Windows. It lets you list, inspect, monitor, and close ports with advanced filtering, real-time updates, and graceful shutdown options. Fast, powerful, and sysadmin-friendly.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages