Nets

From x-cmd/x-cmd · View interactive version

Nets is an AI agent skill from the GitHub repository x-cmd/x-cmd. Enhanced netstat module with cached data and structured output. View network connections, routing tables, and interface statistics in interactive or TSV/CSV formats. **Dependency**: This is an x-cmd module. Install x-cmd first (see x-cmd skill for installation options). see x-cmd skill for installat

How to use this skill

Skill file

x nets - Enhanced Network Statistics

Enhanced netstat with data caching and structured output formats.


Quick Start

# Update/collect network data (creates cache)
x nets update

# List available tables
x nets ls

# View a specific table
x nets view internet

Features


Commands

| Command | Description |

|---------|-------------|

| x nets update | Collect and cache network data |

| x nets ls | List all available tables |

| x nets view <table> | View table in interactive mode |

| x nets view --tsv <table> | View table in TSV format |

| x nets view --csv <table> | View table in CSV format |


Examples

Update Data (Create Cache)

# Collect and cache all network data
x nets update

# This creates cached data in ~/.x-cmd.root/data/nets/

List Available Tables

# Show all available tables
x nets ls

# Common tables:
# - internet  : TCP/UDP connections
# - route     : Routing table
# - interface : Network interface statistics

View Tables

# Interactive mode - select table to view
x nets view

# View specific table (interactive)
x nets view internet

# View in TSV format (for scripting)
x nets view --tsv internet

# View in CSV format
x nets view --csv route

Data Processing

# Filter connections with awk
x nets view --tsv internet | awk -F'\t' '$1 == "TCP"'

# Count connections by state
x nets view --tsv internet | cut -f4 | sort | uniq -c

# Import into spreadsheet
x nets view --csv route > route.csv

Available Tables

| Table | Description |

|-------|-------------|

| internet | TCP/UDP connections (like netstat) |

| route | Routing table information |

| interface | Network interface statistics |


Table Output Fields

internet table

| Field | Description |

|-------|-------------|

| Protocol | TCP/UDP |

| Local Address | Local IP:port |

| Foreign Address | Remote IP:port |

| State | Connection state (ESTABLISHED, LISTEN, etc.) |

route table

| Field | Description |

|-------|-------------|

| Destination | Target network |

| Gateway | Next hop |

| Flags | Route flags |

| Interface | Network interface |


Workflow

# 1. Update data (do this first or when data is stale)
x nets update

# 2. List available tables
x nets ls

# 3. View specific table
x nets view internet

# 4. Or process with other tools
x nets view --tsv internet | x csv sql "SELECT * WHERE State = 'ESTABLISHED'"

Platform Notes

Data is cached in ~/.x-cmd.root/data/nets/latest/ for faster access.


Related

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.