A network scanner written in Rust. CLI, terminal UI, desktop app, and MCP server. One library behind all four.
- Why this exists
- Features
- Screenshots
- Architecture
- Installation
- Usage
- Building
- MCP Server
- Contributing
- License
I wanted my AI agent to answer questions about my local network. Things
like "what's the IP of the device that just joined" or "is port 22 open
on 192.168.1.42". Existing tools work but they aren't great to drive from
an agent. Half a dozen CLI invocations, brittle output parsing, no shared
context. So I built an MCP server first. netscli serve, nine tools,
JSON-RPC over stdio, structured results.
Then the TUI. Coding agents like Claude Code have put real work into autocomplete, command history, in-place progress, and mouse selection that doesn't fight the scrollback. I wanted to see how they do it. So netscli has a proper ratatui TUI with those affordances.
The CLI is simpler. Sometimes you just want netscli scan host --json | jq
and running a full MCP server for that is overkill. Cron jobs and CI
scripts want the same thing.
The desktop app is for when I don't want to open a terminal. Click an
icon, see what's on my network, close it. Because every other surface
already talked to netscli-core, the GUI was mostly a Tauri window over
the same Rust calls.
- Ping, port scan, host discover, subnet sweep, DNS lookup (all record types), reverse DNS, traceroute, ARP table with vendor lookup, interface listing, optional packet capture.
- Four interfaces for the same core:
netscli <cmd>for scripts,netsclialone for a terminal UI with autocomplete and history, a Tauri desktop app for when you want a window, andnetscli servefor Claude / Cursor / any MCP client. --jsonand--yamloutput on every non-interactive subcommand; pipe straight into jq.- Cross-platform. Windows / Linux / macOS binaries in the release matrix. Packet capture is feature-gated so the default binary has zero non-Rust runtime deps.
- Auto-detects a reasonable subnet so
netscli discoverworks with no args.
Dashboard: default interface, live up/down rates, all interfaces at a glance.
Port scan. Results show service names for well-known ports.
DNS lookup. Type and value per row, supports every standard record type.
Interfaces. Each row shows state, MAC, and every assigned address.
curl -fsSL https://raw.githubusercontent.com/fstubner/netscli/main/scripts/install.sh | bashThis downloads the latest release binary for your platform and installs it into ~/.local/bin by default.
You can pin a specific release by setting NETSCLI_VERSION (e.g. NETSCLI_VERSION=v0.1.0).
If the release publishes a matching .sha256 asset, the installer will verify the download automatically; you can also set NETSCLI_SHA256 (or NETSCLI_SHA256_URL to fetch a checksum file).
Release assets: Windows x86_64, Linux x86_64/aarch64 (glibc) + Linux x86_64 (musl), macOS x86_64/aarch64.
PCAP-enabled install (optional, adds packet capture support):
NETSCLI_PCAP=1 curl -fsSL https://raw.githubusercontent.com/fstubner/netscli/main/scripts/install.sh | bashThe single NETSCLI_PCAP=1 flag does two things: it downloads the pcap-enabled binary variant and installs the libpcap system library via your package manager. If you already have libpcap installed and don't want the installer touching it, add NETSCLI_SKIP_LIBPCAP=1.
Windows PowerShell (same idea; NETSCLI_PCAP=1 downloads the pcap binary and runs the Npcap installer):
iwr -useb https://raw.githubusercontent.com/fstubner/netscli/main/scripts/install.ps1 | iex
# With PCAP:
$env:NETSCLI_PCAP=1; iwr -useb https://raw.githubusercontent.com/fstubner/netscli/main/scripts/install.ps1 | iexWindows CLI installer details:
- Installs
netscli.exeto$env:USERPROFILE\.cargo\binby default (override withINSTALL_DIR). - Installs from
fstubner/netscliby default (override withREPO) and installs the latest release by default (override withNETSCLI_VERSION). - When
NETSCLI_PCAP=1is set: installs the-pcapasset and runs the Npcap installer (admin required; skip withNETSCLI_SKIP_NPCAP=1). - If the release publishes a matching
.sha256asset, the script verifies the download automatically; you can also setNETSCLI_SHA256orNETSCLI_SHA256_URL.
git clone https://github.com/fstubner/netscli.git
cd netscli
cargo build --release -p netscli
sudo cp target/release/netscli /usr/local/bin/cargo install netscliOr install directly from the git tip:
cargo install --git https://github.com/fstubner/netscli netsclicd apps/netscli-gui
npm install
npm run tauri build
# Installers created in src-tauri/target/release/bundle/Windows note: the desktop app requires the WebView2 runtime. Most Windows 10/11 systems already have it; if the app does not start, install the Evergreen runtime: https://developer.microsoft.com/microsoft-edge/webview2/.
The CLI installer (scripts/install.ps1) does not install WebView2 because it is only required for the desktop GUI.
Output:
- macOS:
.appbundle insrc-tauri/target/release/bundle/macos/ - Windows:
.exeand.msiinsrc-tauri/target/release/bundle/msi/ - Linux:
.AppImageand.debinsrc-tauri/target/release/bundle/
Run the setup wizard to install optional dependencies:
netscli setupThis will interactively guide you through installing:
libpcap(for packet capture)tcpdump(for PCAP functionality)
PCAP capture is optional and disabled in the default builds for portability. To enable it:
- Via installer (recommended):
NETSCLI_PCAP=1does everything. It picks the pcap-enabled binary variant and installs the system library (libpcapon Linux/macOS, Npcap on Windows).- Add
NETSCLI_SKIP_LIBPCAP=1(POSIX) orNETSCLI_SKIP_NPCAP=1(Windows) if you manage the system library yourself.
- Add
- From source:
cargo build --features pcap(see Building for the full command with OS-specific deps). - On Windows: ensure
wpcap.dllis on PATH. Npcap installs it toC:\Windows\System32\Npcap\which isn't on PATH by default. Add that directory to your PATH, or the installer does it for you when you setNETSCLI_PCAP=1.
Launch the interactive terminal UI:
netscliKey Features:
- Autocomplete: Type
/to see commands, use Up/Down to navigate, Tab to accept - Command History: Use Up/Down when no suggestions are shown
- Scrollback: PageUp/PageDown/Ctrl+Home/Ctrl+End
- Status footer: Host/IP plus live traffic stats (configurable via
/config) - Cancel: Esc cancels a running command
- Exit: Press Esc or Ctrl+C twice, or type
/exit - Export:
/exportsaves session output to a file - Scrollback/Selection: TUI renders in the main buffer so native scrollback and selection work
- Responsive Layout: UI adapts to terminal resize automatically
Available Commands:
/discover [subnet]- Discover live hosts on a network subnet/scan <host> [ports]- Scan TCP ports on a host (default: common ports)/inspect <host> [ports]- Inspect host (ping + scan + resolve)/sweep [subnet] [ports] [--no-resolve]- Sweep network (discover + scan)/ping <host> [count]- Ping a host/trace <host> [--resolve] [--max-hops <n>]- Trace route (hops)/dns <host> [--record <type>|ALL]- DNS lookup (A/AAAA/CNAME/MX/NS/TXT/SRV/PTR/SOA/CAA)/reverse <ip>- Reverse DNS (PTR) lookup/arp- Show/manage ARP table with vendor information/interfaces- List network interfaces/config- Interactive TUI settings (saved to~/.netscli/tui-settings.json)/export [md|json] [--output <path>]- Export the current session output/pcap ...- Packet capture (pcap-enabled builds only; run/pcap --checkto list interfaces)/help- Show detailed help/exit- Exit the TUI
Run commands directly from the command line:
# Discover hosts on network
netscli discover [subnet] --resolve
# Scan specific ports
netscli scan <host> -p 22,80,443
# Comprehensive host inspection
netscli inspect <host>
# Network sweep (discover + scan)
netscli sweep [subnet] -p 80,443 --resolve
# ARP table
netscli arp
# Ping with count
netscli ping <host> -c 4
# Trace route (hops)
netscli trace <host> --max-hops 20
# DNS lookup (all record types)
netscli dns <host>
# Reverse DNS lookup
netscli reverse <ip>
# List network interfaces
netscli interfacesMost CLI commands support structured JSON output:
netscli discover --json
netscli scan host -p 80 --json
netscli arp --jsonMost CLI commands also support YAML:
netscli discover --yaml
netscli scan host -p 80 --yaml
netscli arp --yamlSupported formats: --json, --yaml
- Rust 1.92.0 (pinned via
rust-toolchain.toml) (install from rustup.rs) - For GUI: Node.js 18+ and npm
# Development
cargo build -p netscli
# Release
cargo build --release -p netscli
# Release with PCAP enabled
cargo build --release -p netscli --features pcap
# Run tests
cargo test --allcd apps/netscli-gui
npm install
npm run tauri dev # Development
npm run tauri build # ProductionTo include PCAP support in the desktop app build:
cd apps/netscli-gui
npm run tauri build -- --features pcap# Linux (static)
rustup target add x86_64-unknown-linux-musl
cargo build -p netscli --target x86_64-unknown-linux-musl --release
# Windows (from Linux/WSL)
rustup target add x86_64-pc-windows-msvc
cargo build -p netscli --target x86_64-pc-windows-msvc --release
# macOS
rustup target add x86_64-apple-darwin aarch64-apple-darwin
cargo build -p netscli --target x86_64-apple-darwin --releaseTo update the MAC vendor database:
cd scripts
cargo run --bin generate-ouiThis fetches data from IEEE and Wireshark sources and generates crates/netscli-core/data/oui.min.json.gz, which ships embedded in the netscli-core crate.
The MCP server exposes network scanning tools for AI agents via the Model Context Protocol.
Edit ~/.config/Claude/claude_desktop_config.json (Linux):
{
"mcpServers": {
"netscli": {
"command": "netscli",
"args": ["serve"]
}
}
}- Settings -> MCP Servers -> Add MCP Server
- Command:
netscli - Arguments:
serve
netscli mcp-service --install
systemctl --user enable --now netscli-mcp.serviceThe MCP server exposes 9 tools:
discover_network- Discover live hosts on a network subnetscan_ports- Scan TCP ports on a hostping_host- Ping a host with statisticsdns_lookup- DNS lookup (forward or reverse)get_arp_table- Get ARP/neighbor table with vendor informationinspect_host- Comprehensive host inspectionsweep_network- Sweep a network (discover hosts then scan ports)list_network_interfaces- List network interfaces with detailscapture_pcap- Capture network packets to PCAP file
We welcome contributions! Here's how you can help:
git clone https://github.com/fstubner/netscli.git
cd netscli
cargo build -p netscli
cargo test --all- Follow Rust standard formatting:
cargo fmt - Run clippy:
cargo clippy --all-targets -- -D warnings - Write tests for new features
- Update documentation
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes and add tests
- Ensure all tests pass:
cargo test --all - Commit:
git commit -m 'Add amazing feature' - Push:
git push origin feature/amazing-feature - Open a Pull Request
netscli/
|-- crates/
| |-- netscli-core/ # Core network scanning logic
| `-- netscli-mcp/ # MCP server implementation
|-- apps/
| |-- netscli-cli/ # CLI/TUI application
| `-- netscli-gui/ # Tauri desktop GUI
`-- scripts/ # Build/utility scripts
MIT