Skip to content

Releases: zzzzseong/netmon

v1.3.0 Release

05 Dec 07:18

Choose a tag to compare

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 stats

Output:

╭────────────────────────────────────────────────────────────╮
│                                                            │
│  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 net package
  • 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.8

Output:

🔍 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 dig or nslookup

📋 Changes

Added

  • cmd/stats.go - Network statistics command implementation
  • cmd/dns.go - DNS lookup command implementation
  • formatter/stats_formatter.go - Statistics formatting with beautiful box layout
  • formatter/dns_formatter.go - DNS result formatting with response time
  • utils/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.go for statistics display

Changed

  • utils/find.go - Improved connection filtering logic
  • formatter/formatter.go - Extended formatter interface for new commands
  • cmd/root.go - Added new commands to root command
  • README.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 commands

What's New:

  • stats - Get quick network overview
  • dns - Fast DNS lookups without external tools
  • find - 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 lookup
  • utils.ReverseLookup() - Perform reverse DNS lookup
  • utils.FilterEstablishedConnections() - Filter ESTABLISHED connections
  • formatter.NewStatsFormatter() - Format network statistics
  • formatter.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/netmon

Linux

curl -fsSL https://raw.githubusercontent.com/zzzzseong/netmon/main/scripts/install.sh | bash -s v1.3.0

Download 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

05 Dec 06:08

Choose a tag to compare

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, find automatically 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 8080

Benefits:

  • 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 Config struct 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 parser package 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 tests
  • formatter/route_helpers_test.go - Route formatting tests
  • provider/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 search
  • utils/sort.go - Connection sorting utilities
  • utils/interface.go - Interface IP retrieval with proper error handling
  • formatter/table_columns.go - Centralized table column definitions
  • formatter/route_helpers.go - Route formatting helper functions
  • parser/traceroute.go - Traceroute parsing logic separation
  • style/ascii.go - Centralized ASCII art
  • cmd/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 Cmdline field 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 prompt

What's Better:

  • find command 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 a Config parameter
  • Command constructors changed from variables to functions (new*Cmd())
  • Some formatter function signatures updated

New Utilities:

  • utils.FindByInput() - Smart search by PID/port/name
  • utils.FindByPID() - Search by PID
  • utils.FindByPort() - Search by port
  • utils.SortConnectionsByPort() - Sort connections
  • utils.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 FindByPort to reduce redundant process info calls
  • Improved connection sorting performance
  • Better memory allocation in table formatting

📦 Installation

Homebrew (macOS)

brew upgrade zzzzseong/netmon/netmon

Linux

curl -fsSL https://raw.githubusercontent.com/zzzzseong/netmon/main/scripts/install.sh | bash -s v1.2.2

Download 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

04 Dec 06:32

Choose a tag to compare

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.go file 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 completion command from help output using Cobra's official CompletionOptions.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 help

What's Different:

  • Help output now shows the beautiful custom format again
  • completion command 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/netmon

Linux

curl -fsSL https://raw.githubusercontent.com/zzzzseong/netmon/main/scripts/install.sh | bash -s v1.2.1

Download 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

27 Nov 02:34

Choose a tag to compare

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 | bash

Manual 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.fish

Features:

  • Command name completion
  • Flag and option completion
  • Argument completion for commands like find and shutdown
  • 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/ to cmd/ directory
    • Command registration system completely refactored
  • 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 help

For Developers

If you're extending netmon or contributing:

  1. Command Structure: Commands are now in cmd/ directory instead of commands/
  2. Cobra Patterns: New commands should follow Cobra command patterns
  3. Testing: New tests should be added alongside code in *_test.go files

New Features to Try

  1. 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
  2. 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 framework
  • github.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/netmon

Linux

curl -fsSL https://raw.githubusercontent.com/zzzzseong/netmon/main/scripts/install.sh | bash -s v1.2.0

The 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

26 Nov 01:26

Choose a tag to compare

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 -a flag: 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

  • -a flag to ls command for displaying UDP connections
  • includeUDP parameter to FilterListeningConnections function

Modified

  • FilterListeningConnections function signature to accept includeUDP boolean parameter
  • Default ls command behavior to show only TCP LISTEN connections
  • Usage message for ls command to reflect new -a option

🔄 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 -a flag documentation
  • Added examples for both default and -a flag 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/netmon

Linux

curl -fsSL https://raw.githubusercontent.com/zzzzseong/netmon/main/scripts/install.sh | bash -s v1.1.5

Download 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

22 Nov 07:14

Choose a tag to compare

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/bin for 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 | bash

macOS

brew install zzzzseong/netmon/netmon

Manual 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 optimization
    • commands/traceroute.go - Real-time streaming output
    • commands/find.go - Performance improvements
    • commands/ip.go - Code optimization
    • commands/route.go - Code optimization
    • formatter/formatter.go - Performance improvements
    • provider/filter.go - Code deduplication
    • provider/utils.go - Utility improvements
    • utils/network.go - Network utility improvements
    • main.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

22 Nov 06:10

Choose a tag to compare

🎉 netmon v1.1.3

🚀 New Features

🗺️ Traceroute Command

New network path tracing command with beautiful, intuitive output:

netmon traceroute google.com

Features:

  • 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 --version

Now 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 --all flag, now only -a is supported

    netmon ip      # IPv4 only (default)
    netmon ip -a   # Include IPv6
  • Route Command: Removed --format flag, always uses table format

    netmon 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.go with cross-platform traceroute implementation
  • Added commands/version.go for 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/netmon

Binary 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


🙏 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

20 Nov 04:15

Choose a tag to compare

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/netlink library for direct Netlink RTM_GETROUTE calls
  • macOS/BSD: Uses golang.org/x/net/route for 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 entries

After (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:

  • /32 single 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 /24 or 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 linux

Linux-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 version

Output:

███╗   ██╗███████╗████████╗███╗   ███╗ ██████╗ ███╗   ██╗
████╗  ██║██╔════╝╚══██╔══╝████╗ ████║██╔═══██╗████╗  ██║
██╔██╗ ██║█████╗     ██║   ██╔████╔██║██║   ██║██╔██╗ ██║
██║╚██╗██║██╔══╝     ██║   ██║╚██╔╝██║██║   ██║██║╚██╗██║
██║ ╚████║███████╗   ██║   ██║ ╚═╝ ██║╚██████╔╝██║ ╚████║
╚═╝  ╚═══╝╚══════╝   ╚═╝   ╚═╝     ╚═╝ ╚═════╝ ╚═╝  ╚═══╝
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, or route commands
  • 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 directly

Cross-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/netmon

Download 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 linux for Linux-style output
  • Use netmon --version to check version information
  • Enjoy cleaner route output with automatic filtering

Behavior changes:

  • netmon route now 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

19 Nov 13:44

Choose a tag to compare

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 -a or --all flag 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 ConnectionType constants for better type safety
  • Introduced ProcessInfo struct 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 logic
    • createTable() - Generic table creation
    • getTableRowStyle() - Row styling logic
  • Introduced tableColumn struct for type-safe column definitions
  • Used strings.Builder for 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/netmon

Download 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 ls output
  • CPU % column showing real-time CPU usage
  • MEM % column showing real-time memory usage
  • -a, --all flag for netmon ip command
  • ProcessInfo struct for better data handling
  • Helper functions for code reusability

Changed:

  • netmon ip now 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

19 Nov 06:52

Choose a tag to compare

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 ip

Output 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 route

Output 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 -a option: 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 8080

Network Interface Information

# Show all network interface information
netmon ip

Routing Table

# Show routing table (same format as Linux ip route)
netmon route

🐛 Bug Fixes

  • Improved route command output on macOS to match Linux ip route format
  • Enhanced IPv6 route filtering
  • Improved system route filtering logic

🔧 Technical Improvements

  • Enhanced cross-platform routing table parsing (macOS netstat -rn → Linux ip route format 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 ip when you need network interface information
  • Use netmon route when 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