Releases: zzzzseong/netmon
v1.3.0 Release
Release Notes - v1.3.0
Release Date: December 5, 2025
🎯 Minor Release: New Network Monitoring Commands
This release introduces two powerful new commands that expand netmon's network monitoring capabilities: stats for network statistics overview and dns for DNS lookups.
✨ What's New
📊 Network Statistics Command (stats)
Comprehensive Network Overview:
- Connection Counts: View total TCP and UDP ESTABLISHED connections at a glance
- Listening Ports: Count of all active listening ports
- Network Interfaces: Total number of network interfaces on the system
- Default Gateway: Automatically detects and displays the default gateway from routing table
- Top Processes: Shows top 5 processes by connection count for quick identification of network-heavy applications
Usage:
netmon statsOutput:
╭────────────────────────────────────────────────────────────╮
│ │
│ Network Summary │
│ │
│ Active TCP Connections: 150 │
│ Active UDP Connections: 0 │
│ Listening Ports: 42 │
│ Network Interfaces: 19 │
│ Default Gateway: 192.168.1.1 │
│ │
│ Top Processes by Connections: │
│ • chrome (25 connections) │
│ • node (12 connections) │
│ • docker (8 connections) │
│ │
╰────────────────────────────────────────────────────────────╯
Benefits:
- Quick overview of network activity
- Identify network-heavy processes
- Monitor connection trends
- Perfect for system administrators and developers
🌐 DNS Lookup Command (dns)
Fast and Reliable DNS Queries:
- Forward Lookup: Query A and AAAA records for domains
- Reverse Lookup: Query PTR records for IP addresses
- Response Time: Measures DNS query response time
- No External Dependencies: Uses Go's built-in
netpackage - Clean Output: Beautifully formatted table with color-coded results
Usage:
# Forward lookup (domain to IP)
netmon dns google.com
# Reverse lookup (IP to domain)
netmon dns 8.8.8.8Output:
🔍 DNS Lookup: google.com
╭───────────────┬──────────────────────────────────────────────────────────────╮
│ TYPE │ VALUE │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ A │ 142.250.206.206 │
│ AAAA │ 2404:6800:400a:813::200e │
╰───────────────┴──────────────────────────────────────────────────────────────╯
Response Time: 6ms
Benefits:
- Quick DNS troubleshooting
- Verify DNS resolution
- Check reverse DNS records
- No need for external tools like
digornslookup
📋 Changes
Added
cmd/stats.go- Network statistics command implementationcmd/dns.go- DNS lookup command implementationformatter/stats_formatter.go- Statistics formatting with beautiful box layoutformatter/dns_formatter.go- DNS result formatting with response timeutils/dns.go- DNS lookup utilities (forward and reverse lookup)utils/network.go- Network utility functions (connection filtering)- Enhanced table column definitions in
formatter/table_columns.go - New styles in
style/style.gofor statistics display
Changed
utils/find.go- Improved connection filtering logicformatter/formatter.go- Extended formatter interface for new commandscmd/root.go- Added new commands to root commandREADME.md- Updated with new commands documentation
Enhanced
- Better connection filtering utilities
- Improved network statistics collection
- More comprehensive DNS lookup with IPv6 support
- Enhanced table formatting for better readability
🔄 Migration Guide
For End Users
No breaking changes! All existing commands work exactly the same. New commands are additive:
# New commands available
netmon stats # View network statistics
netmon dns <domain> # Perform DNS lookup
# All existing commands work as before
netmon ls # List ports (unchanged)
netmon ip # Show interfaces (unchanged)
netmon find <pid> # Find process (now shows active connections too)
# ... and all other commandsWhat's New:
stats- Get quick network overviewdns- Fast DNS lookups without external toolsfind- Enhanced to show active connections for found processes
For Developers
No breaking changes! All existing APIs remain compatible.
New Utilities:
utils.LookupDomain()- Perform forward DNS lookuputils.ReverseLookup()- Perform reverse DNS lookuputils.FilterEstablishedConnections()- Filter ESTABLISHED connectionsformatter.NewStatsFormatter()- Format network statisticsformatter.NewDNSFormatter()- Format DNS results
🐛 Bug Fixes
- Improved connection filtering accuracy
- Better error handling in DNS lookups
- Enhanced network statistics collection reliability
📚 Documentation Updates
- Added comprehensive documentation for new commands in README
- Updated usage examples with new commands
- Enhanced command reference table
🎯 Performance Improvements
- Optimized DNS lookup performance
- Efficient connection filtering
- Fast network statistics collection
📦 Installation
Homebrew (macOS)
brew upgrade zzzzseong/netmon/netmonLinux
curl -fsSL https://raw.githubusercontent.com/zzzzseong/netmon/main/scripts/install.sh | bash -s v1.3.0Download Binaries
Pre-built binaries are available in the Releases section.
🙏 Thanks
Thank you for using netmon! This release adds powerful network monitoring capabilities while maintaining the simplicity and ease of use that makes netmon great. The new stats and dns commands provide essential network diagnostics tools in one beautiful CLI.
Full Changelog: v1.2.2...v1.3.0
v1.2.2 Release
Release Notes - v1.2.2
Release Date: December 5, 2025
🎯 Minor Release: Enhanced Find Command & Code Quality Improvements
This release introduces significant improvements to the find command, major code quality enhancements following Go best practices, and better user experience across the application.
✨ What's New
🔍 Enhanced Find Command
Smart Search by PID and Port:
- Automatic Detection: When you provide a number,
findautomatically searches by both PID and port - Dual Results: If both PID and port match, both results are displayed (with duplicate removal)
- Single Result: If only one matches, only that result is shown
- Command Line Display: Shows full command line (like
ps -ef) for better process identification
Usage Examples:
# Search by PID 8922
netmon find 8922
# Search by port 8080
netmon find 8080
# If PID 8080 exists AND port 8080 is in use, both results shown
netmon find 8080Benefits:
- No need to remember whether a number is a PID or port
- Faster workflow - one command does both searches
- Full command line helps identify processes easily
📋 Port Listing Improvements
Automatic Sorting:
- Ports are now automatically sorted by port number (ascending)
- More predictable and easier to scan output
- No additional flags needed
🛑 Enhanced Shutdown Command
Improved UI:
- Better confirmation prompt with clearer options
- Styled success/cancel messages with bordered boxes
- Cleaner visual feedback
🏗️ Code Quality Improvements
📚 Comprehensive Documentation
Added Documentation:
- All public types and functions now have English documentation comments
- Follows Go official documentation standards
- Better API discoverability with
go doc
🏛️ Architecture Improvements
Package-Level Variables Removed:
- All command variables converted to constructor functions (
new*Cmd()) - Follows Go Code Review Comments recommendations
- Better testability and maintainability
Dependency Injection:
- Introduced
Configstruct for version/build information - Commands now receive configuration through parameters
- More testable and flexible architecture
Code Organization:
- Extracted table column definitions to
formatter/table_columns.go - Centralized ASCII art in
style/ascii.go - Created
parserpackage for traceroute parsing logic - Separated formatting logic into dedicated formatter packages
🎨 Style Centralization
Reusable Styles:
- Added common styles:
ASCIIStyle,VersionTextStyle,BuildTextStyle,FooterTextStyle - Reduced code duplication across commands
- Easier to maintain consistent styling
🔢 Constants Management
Magic Numbers Eliminated:
- All table column widths defined as constants
- Port validation constants (
minPort,maxPort) - Traceroute configuration constants
- Centralized in appropriate packages
🧪 Testing Enhancements
New Test Coverage:
utils/interface_test.go- Interface IP retrieval testsformatter/route_helpers_test.go- Route formatting testsprovider/filter_test.go- Route filtering logic tests- Benchmark tests included for performance monitoring
📋 Changes
Added
utils/find.go- New find utilities with PID/port/name searchutils/sort.go- Connection sorting utilitiesutils/interface.go- Interface IP retrieval with proper error handlingformatter/table_columns.go- Centralized table column definitionsformatter/route_helpers.go- Route formatting helper functionsparser/traceroute.go- Traceroute parsing logic separationstyle/ascii.go- Centralized ASCII artcmd/config.go- Configuration structure- Comprehensive test files for multiple packages
- English documentation comments for all public APIs
Changed
- find command: Now searches by both PID and port when given a number
- find command: Displays full command line (like
ps -ef) - ls command: Ports are now automatically sorted by port number
- shutdown command: Improved UI with better prompts and styled messages
- All commands: Converted from package-level variables to constructor functions
- All formatters: Moved to dedicated formatter packages
- Error handling: Improved with proper error wrapping
- ProcessInfo: Added
Cmdlinefield for full command line display
Fixed
- Performance optimization in
FindByPort(reduced redundant process info calls) - Command line length truncation for very long commands (max 500 chars)
- Code organization and maintainability issues
🔄 Migration Guide
For End Users
No breaking changes! All commands work the same, with improvements:
# find command now works smarter
netmon find 8080 # Searches both PID 8080 and port 8080
# ls command now sorts ports automatically
netmon ls # Ports sorted by number
# shutdown has better UI
netmon shutdown <pid> # Improved confirmation promptWhat's Better:
findcommand is more intuitive - just provide a number- Port listings are sorted for easier reading
- Better visual feedback in shutdown command
For Developers
Breaking Changes:
cmd.Execute()now requires aConfigparameter- Command constructors changed from variables to functions (
new*Cmd()) - Some formatter function signatures updated
New Utilities:
utils.FindByInput()- Smart search by PID/port/nameutils.FindByPID()- Search by PIDutils.FindByPort()- Search by portutils.SortConnectionsByPort()- Sort connectionsutils.GetInterfaceIP()- Get interface IP with error handling
🐛 Bug Fixes
- Fixed potential performance issues in port search
- Improved error handling in process information retrieval
- Fixed command line display for very long commands
📚 Documentation Updates
- Added comprehensive English documentation for all public APIs
- Updated README with new find command features
- Improved code comments throughout the codebase
🎯 Performance Improvements
- Optimized
FindByPortto reduce redundant process info calls - Improved connection sorting performance
- Better memory allocation in table formatting
📦 Installation
Homebrew (macOS)
brew upgrade zzzzseong/netmon/netmonLinux
curl -fsSL https://raw.githubusercontent.com/zzzzseong/netmon/main/scripts/install.sh | bash -s v1.2.2Download Binaries
Pre-built binaries are available in the Releases section.
🙏 Thanks
Thank you for using netmon! This release significantly improves code quality, maintainability, and user experience while maintaining the simplicity and ease of use that makes netmon great.
Full Changelog: v1.2.1...v1.2.2
v1.2.1 Release
Release Notes - v1.2.1
Release Date: December 4, 2025
🎯 Patch Release: UI Improvements and Code Organization
This release focuses on improving user experience and code organization with custom help restoration and completion command cleanup.
✨ What's New
🎨 Custom Help Output Restored
Improvements:
- Restored the beautifully styled custom help output that was lost during Cobra migration
- Extracted help rendering logic to a separate
cmd/help.gofile for better code organization - Maintains the original ASCII art, version display, and formatted command lists
Benefits:
- Cleaner code structure with separated concerns
- Easier to maintain and extend help formatting
- Consistent beautiful UI across all help outputs
🧹 Completion Command Cleanup
Changes:
- Removed
completioncommand from help output using Cobra's officialCompletionOptions.DisableDefaultCmd - Completion functionality is still available via Homebrew's automatic installation
- Cleaner command list without internal completion commands
Technical Details:
- Uses Cobra's official API:
rootCmd.CompletionOptions.DisableDefaultCmd = true - Follows Cobra best practices for disabling default commands
- No breaking changes for end users
📋 Changes
Added
cmd/help.go- Separated help rendering logic for better code organization- Custom help and usage functions properly integrated with Cobra
Changed
- Help output now uses custom styled format instead of default Cobra help
- Code organization improved with help logic in separate file
- Completion command removed from help output (still functional via Homebrew)
Fixed
- Custom help output restoration after Cobra migration
- Release workflow configuration updates
🔄 Migration Guide
For End Users
No breaking changes! All commands work exactly the same:
# All commands work as before
netmon ls
netmon ip
netmon route
netmon find <port>
netmon shutdown <pid>
netmon traceroute <host>
netmon version
netmon helpWhat's Different:
- Help output now shows the beautiful custom format again
completioncommand is no longer visible in help (but still works via Homebrew)
For Developers
Code Organization:
- Help rendering logic moved to
cmd/help.go - Better separation of concerns
- Easier to maintain and extend
🐛 Bug Fixes
- Fixed custom help output that was lost during Cobra migration
- Improved code organization with help logic separation
📚 Documentation Updates
- Updated release workflow configuration
- Improved code structure documentation
📦 Installation
Homebrew (macOS)
brew upgrade zzzzseong/netmon/netmonLinux
curl -fsSL https://raw.githubusercontent.com/zzzzseong/netmon/main/scripts/install.sh | bash -s v1.2.1Download Binaries
Pre-built binaries are available in the Releases section.
🙏 Thanks
Thank you for using netmon! This patch release improves the user experience and code maintainability.
Full Changelog: v1.2.0...v1.2.1
v1.2.0 Release
Release Notes - v1.2.0
Release Date: November 27, 2025
🎉 Major Release: Cobra CLI Framework Migration
This release represents a significant architectural improvement with the migration to the industry-standard Cobra CLI framework, bringing enhanced functionality, better maintainability, and improved user experience.
✨ What's New
🚀 Cobra CLI Framework Migration
Major Refactoring:
- Migrated from custom command registry to Cobra, the industry-standard CLI framework
- Improved code organization with cleaner command structure
- Better error handling and command validation
- Foundation for future CLI enhancements
Benefits:
- More maintainable codebase (reduced code by ~365 lines)
- Better command structure and organization
- Enhanced extensibility for future features
- Industry-standard CLI patterns
🎯 Shell Completion Support
With the migration to Cobra, shell completion is now automatically available. The install script automatically installs completion scripts for your shell during installation.
Supported Shells:
- Bash - Automatically installed via install script
- Zsh - Automatically installed via install script
- Fish - Automatically installed via install script
Automatic Installation:
The install script automatically detects your shell and installs the appropriate completion script:
# Install netmon (completions are automatically installed)
curl -fsSL https://raw.githubusercontent.com/zzzzseong/netmon/main/scripts/install.sh | bashManual Installation (if needed):
If you need to manually install completions, you can use Cobra's built-in completion command:
# Bash
netmon completion bash | sudo tee /etc/bash_completion.d/netmon
# Zsh
netmon completion zsh | sudo tee /usr/share/zsh/site-functions/_netmon
# Fish
netmon completion fish | sudo tee /usr/share/fish/vendor_completions.d/netmon.fishFeatures:
- Command name completion
- Flag and option completion
- Argument completion for commands like
findandshutdown - Automatic installation via install script (no manual steps required)
🧪 Testing Infrastructure
Added comprehensive test coverage:
- Formatter Tests - Unit tests for table formatting logic
- Utils Tests - Tests for utility functions
- Improved code reliability and maintainability
⚡ Performance & Quality Improvements
- Enhanced error handling throughout the codebase
- Performance optimizations in formatter and utility functions
- Better code organization and structure
📋 Changes
Added
- Cobra CLI framework integration (provides automatic shell completion support)
- Comprehensive test suite (formatter and utils tests)
- Automatic shell completion installation in install script
- Shell completion support for Bash, Zsh, and Fish (via Cobra's built-in completion command)
Changed
- BREAKING: Internal command structure migrated to Cobra
- Commands moved from
commands/tocmd/directory - Command registration system completely refactored
- Commands moved from
- Improved error handling and validation
- Enhanced code organization and maintainability
Removed
- Custom command registry system
- Legacy command registration code
- Old
commands/directory structure
🔄 Migration Guide
For End Users
No breaking changes for end users! All existing commands work exactly the same:
# All commands work as before
netmon ls
netmon ip
netmon route
netmon find <port>
netmon shutdown <pid>
netmon traceroute <host>
netmon version
netmon helpFor Developers
If you're extending netmon or contributing:
- Command Structure: Commands are now in
cmd/directory instead ofcommands/ - Cobra Patterns: New commands should follow Cobra command patterns
- Testing: New tests should be added alongside code in
*_test.gofiles
New Features to Try
-
Shell Completion: Tab completion is automatically enabled after installation
# After installation, restart your shell and try: netmon <TAB> # See all commands netmon find <TAB> # See port suggestions netmon ls -<TAB> # See available flags
-
Better Help: Enhanced help system with Cobra
netmon help netmon help <command>
🐛 Bug Fixes
- Improved error handling prevents silent failures
- Better validation of command arguments
- More robust command execution
📚 Documentation Updates
- Updated README with shell completion information
- Added examples for shell completion usage
- Updated installation instructions
🔗 Technical Details
Dependencies Added
github.com/spf13/cobra v1.10.1- CLI frameworkgithub.com/spf13/pflag v1.0.10- Flag parsing
Code Statistics
- Lines Removed: ~785 (legacy code)
- Lines Added: ~634 (Cobra-based code)
- Net Change: -151 lines (cleaner codebase)
- Test Coverage: New test files added
📦 Installation
Homebrew (macOS)
brew upgrade zzzzseong/netmon/netmonLinux
curl -fsSL https://raw.githubusercontent.com/zzzzseong/netmon/main/scripts/install.sh | bash -s v1.2.0The install script now automatically installs shell completions!
Download Binaries
Pre-built binaries are available in the Releases section.
🎯 What's Next
This release sets the foundation for:
- More advanced CLI features
- Better command extensibility
- Enhanced help and documentation
- Additional shell completion improvements
🙏 Thanks
Thank you for using netmon! This major refactoring improves the foundation for future enhancements. If you encounter any issues or have suggestions, please open an issue on GitHub.
Full Changelog: v1.1.5...v1.2.0
v1.1.5 Release
Release Notes - v1.1.5
Release Date: November 26, 2025
🎉 What's New
✨ UDP Connection Visibility
Added the -a flag to the ls command to optionally display UDP connections alongside TCP connections.
Usage:
# Show TCP LISTEN connections only (default)
netmon ls
# Include UDP connections
netmon ls -a🔧 Improved Filtering Logic
- Default behavior: Only TCP connections in LISTEN state are displayed for a cleaner, more focused output
- With
-aflag: Both TCP LISTEN and UDP connections are displayed - This change makes the default output more useful for most use cases while still allowing full visibility when needed
📋 Changes
Added
-aflag tolscommand for displaying UDP connectionsincludeUDPparameter toFilterListeningConnectionsfunction
Modified
FilterListeningConnectionsfunction signature to acceptincludeUDPboolean parameter- Default
lscommand behavior to show only TCP LISTEN connections - Usage message for
lscommand to reflect new-aoption
🔄 Migration Guide
If you were previously relying on UDP connections being shown by default, you'll need to use the -a flag:
# Before (v1.1.4 and earlier)
netmon ls # Showed both TCP and UDP
# After (v1.1.5)
netmon ls # Shows only TCP LISTEN
netmon ls -a # Shows both TCP LISTEN and UDP🐛 Bug Fixes
None in this release.
📚 Documentation Updates
- Updated README.md with new
-aflag documentation - Added examples for both default and
-aflag usage - Updated command table with new flag information
🔗 Related Issues
- Implements feature request for optional UDP connection display
- Improves default output clarity by focusing on TCP LISTEN connections
📦 Installation
Homebrew (macOS)
brew upgrade zzzzseong/netmon/netmonLinux
curl -fsSL https://raw.githubusercontent.com/zzzzseong/netmon/main/scripts/install.sh | bash -s v1.1.5Download Binaries
Pre-built binaries are available in the Releases section.
🙏 Thanks
Thank you for using netmon! If you encounter any issues or have suggestions, please open an issue on GitHub.
Full Changelog: v1.1.4...v1.1.5
v1.1.4 Release
Release Notes - v1.1.4
🎉 What's New
🐧 Linux Installation Script
- Added one-command installation script for Linux users
- Automatic OS and architecture detection (Linux AMD64/ARM64)
- Installs directly to
/usr/local/binfor immediate use - Installation verification included
⚡ Performance Improvements
- Optimized code performance and reduced duplication
- Improved memory usage and execution speed
🔄 Enhanced Traceroute
- Converted traceroute to real-time streaming output
- Better user experience with immediate feedback
📁 Project Structure
- Organized installation scripts into
scripts/directory - Improved project organization and maintainability
📝 Documentation
- Optimized README with removed duplicates
- Updated installation instructions
- Cleaner and more organized documentation
📦 Installation
Linux (New!)
curl -fsSL https://raw.githubusercontent.com/zzzzseong/netmon/main/scripts/install.sh | bashmacOS
brew install zzzzseong/netmon/netmonManual Installation
Download pre-built binaries from the Releases page.
🔧 Technical Changes
-
New Files:
scripts/install.sh- Linux/macOS installation script
-
Modified Files:
README.md- Documentation updates and optimizationcommands/traceroute.go- Real-time streaming outputcommands/find.go- Performance improvementscommands/ip.go- Code optimizationcommands/route.go- Code optimizationformatter/formatter.go- Performance improvementsprovider/filter.go- Code deduplicationprovider/utils.go- Utility improvementsutils/network.go- Network utility improvementsmain.go- Version bump
🐛 Bug Fixes
- Code deduplication and cleanup
- Improved error handling
📊 Statistics
- 14 files changed
- 411 insertions(+), 365 deletions(-)
- Net code reduction through optimization
🙏 Contributors
- zzzzseong
Full Changelog: v1.1.3...v1.1.4
v1.1.3 Release
🎉 netmon v1.1.3
🚀 New Features
🗺️ Traceroute Command
New network path tracing command with beautiful, intuitive output:
netmon traceroute google.comFeatures:
- ✨ Cross-platform support - Works on macOS/Linux (
traceroute) and Windows (tracert) - 🎨 Animated loading spinner - Beautiful rotating indicator during execution
- 🌈 Color-coded RTT values - Green (<30ms), Yellow (30-100ms), Red (>100ms)
- 📊 Clean table format - Organized hop-by-hop information with 3 RTT measurements per hop
📦 Version Command
Added dedicated version command for easy version checking:
netmon version
# Also supports: netmon -v, netmon --versionNow visible in the help menu alongside other commands for better discoverability.
🔧 Improvements & Simplifications
Simplified Command Options
Removed redundant flags for cleaner, more intuitive usage:
-
IP Command: Removed
--allflag, now only-ais supportednetmon ip # IPv4 only (default) netmon ip -a # Include IPv6
-
Route Command: Removed
--formatflag, always uses table formatnetmon route # Clean table format
Unified Version Management
- Single source of truth for version information in
main.go - Removed duplicate version definitions across files
- Fixed version mismatch between help (1.1.1) and actual version (1.1.2)
🎨 User Experience Enhancements
- ⚡ Loading indicators - Visual feedback during long-running operations
- 🎯 Consistent command structure - Simplified options across all commands
- 📝 Better help output - Version and traceroute commands now visible in help menu
- 🎨 Polished animations - Smooth spinner with optimal timing (150ms intervals)
📚 Updated Commands
| Command | Description | Usage |
|---|---|---|
ls |
List all active ports with process metrics | netmon ls |
ip |
Show network interfaces | netmon ip [-a] |
route |
Display routing table | netmon route |
find |
Find process using a port | netmon find <port> |
shutdown |
Shutdown a process | netmon shutdown <pid> |
traceroute |
Trace route to network host | netmon traceroute <host> |
version |
Show version information | netmon version |
help |
Show help information | netmon help |
🛠️ Technical Changes
- Added
commands/traceroute.gowith cross-platform traceroute implementation - Added
commands/version.gofor version command - Consolidated version constants into
main.go - Updated help command to display version and traceroute
- Simplified command-line flag parsing for ip and route commands
📦 Installation
Homebrew
brew upgrade zzzzseong/netmon/netmonBinary Download
Download pre-built binaries from the releases page.
Build from Source
git clone https://github.com/zzzzseong/netmon.git
cd netmon
git checkout v1.1.3
go build -o netmon .🔗 Links
- Documentation: README.md
- Issues: GitHub Issues
- Previous Release: v1.1.2
🙏 Acknowledgments
Thank you for using netmon! If you find it helpful, please ⭐ star the repository.
Full Changelog: v1.1.2...v1.1.3
v1.1.2 Release
Release v1.1.2
🎉 What's New
🚀 Major Route Command Refactoring
Native OS API Integration 🆕
The netmon route command has been completely refactored to use native OS APIs instead of parsing command output. This provides better accuracy, performance, and cross-platform compatibility.
Platform-Specific Implementations:
- Linux: Uses
vishvananda/netlinklibrary for direct Netlink RTM_GETROUTE calls - macOS/BSD: Uses
golang.org/x/net/routefor BSD routing socket (PF_ROUTE) - Windows: Uses
GetIpForwardTable2()Win32 API - Fallback: Command parsing for unsupported platforms
Before (v1.1.1):
# Parsed output from 'ip route' or 'netstat -rn'
netmon route
# Output: 130+ routes including many unnecessary entriesAfter (v1.1.2):
# Direct OS API calls
netmon route
# Output: Only 2-3 essential routes✨ Smart Route Filtering
Automatic Filtering 🎯
The route command now automatically filters out unnecessary routes for cleaner, more readable output:
Excluded Routes:
/32single host routes (individual internet IPs)- Link-local addresses (
169.254.0.0/16) - Multicast addresses (
224.0.0.0/4) - Broadcast addresses (
255.255.255.255/32) - Loopback addresses (
127.0.0.0/8)
Included Routes:
- Default gateway (
default) - Directly connected subnets (e.g.,
172.16.0.0/22) - Docker/Bridge networks and meaningful internal networks
- Networks with
/24or larger CIDR blocks
Result:
- Before: 130+ routes displayed
- After: 2-3 essential routes displayed
- Reduction: ~98% fewer routes for better readability
🐧 Linux-Style Output Format
New Format Option 🆕
Added support for Linux ip route style output format:
# Table format (default)
netmon route
# Linux-style format
netmon route --format linuxLinux-Style Output Example:
default via 172.16.3.254 dev en0 src 172.16.0.99
172.16.0.0/22 dev en0 src 172.16.0.99
10.10.0.0/24 dev docker0 src 10.10.0.1
This format matches the standard Linux ip route command output, making it familiar for Linux users and easier to parse in scripts.
📋 Version Command
New Command 🆕
Added version information display:
netmon --version
# or
netmon -v
# or
netmon versionOutput:
███╗ ██╗███████╗████████╗███╗ ███╗ ██████╗ ███╗ ██╗
████╗ ██║██╔════╝╚══██╔══╝████╗ ████║██╔═══██╗████╗ ██║
██╔██╗ ██║█████╗ ██║ ██╔████╔██║██║ ██║██╔██╗ ██║
██║╚██╗██║██╔══╝ ██║ ██║╚██╔╝██║██║ ██║██║╚██╗██║
██║ ╚████║███████╗ ██║ ██║ ╚═╝ ██║╚██████╔╝██║ ╚████║
╚═╝ ╚═══╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝
Version: 1.1.2
Build Date: 2025-11-20
🛠️ Technical Improvements
Architecture Refactoring
Provider Pattern 🏗️
Introduced a clean OS abstraction layer with the RouteProvider interface:
type RouteProvider interface {
GetRoutes() ([]RouteEntry, error)
}Benefits:
- Clean separation of OS-specific implementations
- Easy to add support for new platforms
- Better testability and maintainability
- Build tags ensure only relevant code is compiled per platform
File Structure:
provider/
├── route_provider.go # Common interface and RouteEntry struct
├── route_linux.go # Linux Netlink implementation
├── route_bsd.go # BSD/macOS routing socket implementation
├── route_windows.go # Windows GetIpForwardTable2 implementation
├── route_fallback.go # Fallback command parsing
├── route_other.go # Other OS support
├── filter.go # Route filtering logic
└── formatter.go # Linux-style formatter
Performance Improvements
Direct API Calls ⚡
- Eliminated external process overhead: No more spawning
ip,netstat, orroutecommands - Faster execution: Direct system calls are significantly faster
- Lower memory usage: No need to parse large command outputs
- More reliable: Native APIs provide consistent, accurate data
Before:
// Spawn external process
cmd := exec.Command("ip", "route", "show")
output, _ := cmd.Output()
// Parse output string...After:
// Direct API call
routes, _ := netlink.RouteList(nil, netlink.FAMILY_V4)
// Use structured data directlyCross-Platform Support
True Multi-Platform 🌍
- ✅ Linux (x64 & ARM) - Netlink API
- ✅ macOS (Intel & Apple Silicon) - BSD routing socket
- ✅ Windows (x64) - Win32 API
- ✅ FreeBSD, OpenBSD, NetBSD - BSD routing socket
All platforms now use native APIs for maximum accuracy and performance.
📚 Documentation
Updated README.md 📖
- Added comprehensive route command documentation
- Updated version to 1.1.2
- Added platform badges (Linux | macOS | Windows)
- Expanded "What's New" section with v1.1.2 details
- Added routing system dependencies documentation
- Updated examples with Linux-style format usage
🐛 Bug Fixes
- Fixed route command output inconsistencies across platforms
- Improved error handling in route provider implementations
- Fixed cross-compilation issues (Linux, Windows)
- Resolved unused import warnings
🔧 Technical Details
New Dependencies
require (
github.com/vishvananda/netlink v1.1.0 // Linux Netlink
golang.org/x/net v0.47.0 // BSD routing socket
golang.org/x/sys v0.38.0 // Windows system calls
)Build Tags
Each OS implementation uses build tags for clean separation:
//go:build linux- Linux Netlink//go:build darwin || freebsd || openbsd || netbsd- BSD routing socket//go:build windows- Windows API//go:build !linux && !darwin && !freebsd && !openbsd && !netbsd && !windows- Fallback
📥 Installation
Homebrew
brew install zzzzseong/netmon/netmonDownload Binaries
Pre-built binaries for all platforms are available in the Releases section:
- Linux (amd64)
- macOS (Intel & ARM64)
- Windows (amd64)
Build from Source
git clone https://github.com/zzzzseong/netmon.git
cd netmon
go build -o netmon .🔄 Migration Guide
Upgrading from v1.1.1
No breaking changes: All existing commands work exactly the same.
New features available:
- Use
netmon route --format linuxfor Linux-style output - Use
netmon --versionto check version information - Enjoy cleaner route output with automatic filtering
Behavior changes:
netmon routenow shows significantly fewer routes (filtered)- Route information is more accurate (native APIs)
- Cross-platform compatibility improved
📝 Full Changelog
Added:
- Native OS API integration for route command (Linux, macOS, Windows)
- Smart route filtering (excludes /32 hosts, link-local, multicast, broadcast)
- Linux-style output format (
--format linux) - Version command (
--version,-v,version) - Provider package with RouteProvider interface
- OS-specific route implementations with build tags
- Route filtering logic (
provider/filter.go) - Linux-style formatter (
provider/formatter.go) - Cross-platform build support
Changed:
- Route command now uses native OS APIs instead of command parsing
- Route output reduced from 130+ to 2-3 essential routes
- Improved route accuracy and reliability
- Enhanced cross-platform compatibility
Improved:
- Performance (direct API calls vs. external processes)
- Code maintainability (provider pattern)
- Platform support (Windows added)
- Documentation (comprehensive README updates)
Fixed:
- Route command output inconsistencies
- Cross-compilation issues
- Unused import warnings
- Error handling improvements
🙏 Acknowledgments
Thank you to everyone who contributed feedback and suggestions!
Download v1.1.2
Full Changelog: v1.1.1...v1.1.2
v1.1.1 Release
Release v1.1.1
🎉 What's New
Enhanced Port Listing (netmon ls)
New Columns Added 🆕
- USERNAME: Shows which user owns each process
- CPU %: Real-time CPU usage percentage per process
- MEM %: Real-time memory usage percentage per process
UI Improvements 🎨
- Center-aligned table headers for better readability
- Optimized column widths for better terminal compatibility
- Reduced total table width from 160 to 130 characters
Before:
╭──────────────────┬─────────────────────┬─────────────────┬─────────────────┬───────────────────────────╮
│ PROTOCOL │ LOCAL ADDRESS │ STATUS │ PID │ PROCESS NAME │
├──────────────────┼─────────────────────┼─────────────────┼─────────────────┼───────────────────────────┤
│ TCP │ 127.0.0.1:8080 │ LISTEN │ 12345 │ node │
╰──────────────────┴─────────────────────┴─────────────────┴─────────────────┴───────────────────────────╯
After:
╭────────────┬─────────────────────┬────────────┬───────────┬───────────────────────────┬─────────────────┬───────────┬──────────╮
│ PROTOCOL │ LOCAL ADDRESS │ STATUS │ PID │ PROCESS NAME │ USERNAME │ CPU % │ MEM % │
├────────────┼─────────────────────┼────────────┼───────────┼───────────────────────────┼─────────────────┼───────────┼──────────┤
│ TCP │ 127.0.0.1:8080 │ LISTEN │ 12345 │ node │ jisung │ 15.2% │ 2.1% │
╰────────────┴─────────────────────┴────────────┴───────────┴───────────────────────────┴─────────────────┴───────────┴──────────╯
Improved Network Interface Display (netmon ip)
Smart Filtering 🎯
- By default, shows only IPv4 addresses for cleaner output
- Automatically hides interfaces without IP addresses
- Use
-aor--allflag to show IPv6 addresses and all interfaces
UI Improvements 🎨
- Center-aligned table headers
- Optimized column widths (INTERFACE: 12, STATUS: 8, MTU: 6)
- Reduced total table width from 140 to 110 characters
Usage:
# IPv4 only (default)
netmon ip
# Show all including IPv6
netmon ip -a🚀 Performance & Code Quality
Code Optimization ⚡
utils/network.go
- Added
ConnectionTypeconstants for better type safety - Introduced
ProcessInfostruct for clean data handling - New
GetProcessInfo()helper function to fetch all process metrics at once - Reduced code duplication and improved maintainability
formatter/formatter.go
- Reusable style variables to reduce memory allocation
- Extracted helper functions for better code organization:
getStatusStyled()- Status styling logiccreateTable()- Generic table creationgetTableRowStyle()- Row styling logic
- Introduced
tableColumnstruct for type-safe column definitions - Used
strings.Builderfor efficient string concatenation - Removed redundant style object creation
Performance Improvements
- ⚡ Faster execution time
- 📉 Lower memory footprint
- 🔄 Better code reusability
🐛 Bug Fixes
- Fixed table layout issues on narrow terminals
- Improved process information retrieval error handling
- Enhanced compatibility with various terminal emulators
📚 Documentation
- Updated README.md with comprehensive feature documentation
- Added badges for Go version, license, and version
- Improved examples and use cases
- Added detailed v1.1.1 changelog section
- Enhanced contributing guidelines
🛠️ Technical Details
Dependencies
- Go 1.25+
- github.com/shirou/gopsutil/v3
- github.com/charmbracelet/lipgloss
- github.com/manifoldco/promptui
Compatibility
- ✅ macOS (Intel & Apple Silicon)
- ✅ Linux (x64 & ARM)
📥 Installation
Homebrew
brew install zzzzseong/netmon/netmonDownload Binaries
Download pre-built binaries from the Releases page.
🙏 Acknowledgments
Thank you to everyone who contributed feedback and suggestions!
📝 Full Changelog
Added:
- USERNAME column in
netmon lsoutput - CPU % column showing real-time CPU usage
- MEM % column showing real-time memory usage
-a, --allflag fornetmon ipcommand- ProcessInfo struct for better data handling
- Helper functions for code reusability
Changed:
netmon ipnow shows IPv4 addresses only by default- Table headers are now center-aligned
- Optimized column widths for better display
- Improved code structure with better separation of concerns
Improved:
- Performance optimization through style reuse
- Memory efficiency with strings.Builder
- Code maintainability with extracted functions
- Error handling in process information retrieval
Fixed:
- Table layout on narrow terminals
- Process information display consistency
v1.1.0 - Release
netmon v1.1.0 Release Notes
🎉 New Features
✨ New Commands
ip - Show Network Interface Information
Display network interface information for the system. Provides similar information to Linux's ip addr show.
netmon ipOutput Information:
- INTERFACE: Network interface name (e.g., eth0, en0, lo)
- IP ADDRESS: IPv4 and IPv6 addresses (CIDR notation)
- MAC ADDRESS: Hardware address
- STATUS: Interface status (UP/DOWN)
- MTU: Maximum Transmission Unit
route - Show Routing Table
Display routing table information. Output format matches Linux's ip route command.
netmon routeOutput Information:
- DESTINATION: Destination network (default or CIDR)
- GATEWAY: Gateway address (shows
-if none) - INTERFACE: Network interface
- METRIC: Routing metric (shows
-if none) - SOURCE: Source address (shows
-if none)
Features:
- Supports both macOS and Linux
- Output format matches Linux
ip route - Automatically filters system routes (127.x.x.x, 169.254.x.x, etc.)
- Excludes IPv6 routes (IPv4 only)
🔄 Changes
ls Command
- Removed
ls -aoption: Removed to keep the command simple and clean - Default behavior unchanged: Still shows only LISTEN state ports
📊 Command Comparison
| Command | Description | Linux Equivalent |
|---|---|---|
netmon ls |
List ports | netstat -tuln, ss -tuln |
netmon ip |
Interface info | ip addr show, ifconfig |
netmon route |
Routing table | ip route show, route -n |
netmon find |
Find port | lsof -i :port |
netmon shutdown |
Kill process | kill <pid> |
🎯 Usage Examples
Network Monitoring
# Find process using specific port
netmon find 8080Network Interface Information
# Show all network interface information
netmon ipRouting Table
# Show routing table (same format as Linux ip route)
netmon route🐛 Bug Fixes
- Improved
routecommand output on macOS to match Linuxip routeformat - Enhanced IPv6 route filtering
- Improved system route filtering logic
🔧 Technical Improvements
- Enhanced cross-platform routing table parsing (macOS
netstat -rn→ Linuxip routeformat conversion) - Improved network interface information collection
- Added process-based port grouping logic
📝 Migration Guide
Upgrading from v1.0.0
No breaking changes: All existing commands (ls, find, shutdown, help) work exactly the same.
New commands available:
- Use
netmon ipwhen you need network interface information - Use
netmon routewhen you need routing table information
🙏 Contributors
Thank you to everyone who contributed to this release!
📦 Download
- Homebrew:
brew install zzzzseong/netmon/netmon - GitHub Releases: v1.1.0
Full Changelog: v1.0.0...v1.1.0