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 m
Imported from x-cmd/x-cmd (mod/nets/SKILL.md). Install upstream with npx skills add x-cmd/x-cmd --skill nets. Copyright stays with the author (Apache-2.0).
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 tablesx nets ls# View a specific tablex nets view internet
Features
Data Caching: Update and cache network data for faster access
Table View: View different network tables (internet, route, etc.)
Multiple Formats: TSV, CSV output for data processing
Interactive Mode: Interactive table selection
Cross-platform: Works on Linux, macOS, Windows
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 datax nets update# This creates cached data in ~/.x-cmd.root/data/nets/
List Available Tables
# Show all available tablesx nets ls# Common tables:# - internet : TCP/UDP connections# - route : Routing table# - interface : Network interface statistics
View Tables
# Interactive mode - select table to viewx nets view# View specific table (interactive)x nets view internet# View in TSV format (for scripting)x nets view --tsv internet# View in CSV formatx nets view --csv route
Data Processing
# Filter connections with awkx nets view --tsv internet | awk -F'\t' '$1 == "TCP"'# Count connections by statex nets view --tsv internet | cut -f4 | sort | uniq -c# Import into spreadsheetx 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 tablesx nets ls# 3. View specific tablex nets view internet# 4. Or process with other toolsx nets view --tsv internet | x csv sql "SELECT * WHERE State = 'ESTABLISHED'"
Platform Notes
Linux: Uses netstat, ss, or /proc/net data
macOS: Uses netstat and route commands
Windows: Uses netstat command
Data is cached in ~/.x-cmd.root/data/nets/latest/ for faster access.
Related
Native netstat(8) manual page
Use it
Copy one of these into your project. Installing also returns the manifest and these snippets.
yaml
targets:
- https://api.opensmartroute.ai/api/v1/registry/x-cmd-x-cmd-nets/manifest # or paste the manifest below
Manifest
An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.
x-cmd-x-cmd-nets.ocm.jsonjson
{
"ocm": "1",
"id": "x-cmd-x-cmd-nets",
"kind": "skill",
"name": "x-nets",
"description": "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 installation.",
"publisher": "x-cmd",
"version": "1.0.0",
"capabilities": {
"domains": [
"math",
"data_analysis"
],
"tags": [
"skill-md",
"x-cmd",
"network",
"netstat",
"connections",
"monitoring",
"github"
],
"languages": [
"en"
]
},
"quality_prior": 0.6,
"examples": [
"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 installation."
],
"primary": false,
"metadata": {
"source": {
"provider": "github",
"repository": "https://github.com/x-cmd/x-cmd",
"path": "mod/nets/SKILL.md",
"ref": "e18c1ef8b4695c7556c4e847b2eb7eaac13b9230",
"url": "https://github.com/x-cmd/x-cmd/blob/e18c1ef8b4695c7556c4e847b2eb7eaac13b9230/mod/nets/SKILL.md",
"key": "x-cmd/x-cmd/mod/nets/SKILL.md"
},
"compatibility": "POSIX Shell",
"license": "Apache-2.0"
},
"instructions": "# x nets - Enhanced Network Statistics\n\n> Enhanced `netstat` with data caching and structured output formats.\n\n---\n\n## Quick Start\n\n```bash\n# Update/collect network data (creates cache)\nx nets update\n\n# List available tables\nx nets ls\n\n# View a specific table\nx nets view internet\n```\n\n---\n\n## Features\n\n- **Data Caching**: Update and cache network data for faster access\n- **Table View**: View different network tables (internet, route, etc.)\n- **Multiple Formats**: TSV, CSV output for data processing\n- **Interactive Mode**: Interactive table selection\n- **Cross-platform**: Works on Linux, macOS,",
"cost": {
"context_tokens": 770
}
}
Fetch it by URL: GET /api/v1/registry/x-cmd-x-cmd-nets/manifest?version=1.0.0
Reviews
Star ratings from people who tried it. One review per account; edit yours any time.
No reviews yet. Install it, try it, and be the first to rate it.