netls-0.1.0 has been yanked.
netls
netls - a network connections viewer built for developer workflows and automation.
- JSON & CSV output - pipe directly into
jq, scripts, or AI agents
- Container visibility - shows which container owns each connection (Docker supported, more runtimes coming)
- Process tree - trace any connection back to its parent process chain
- Watch mode - live diff, see new and closed connections in real time
- CI-friendly -
--wait-for 8080 blocks until a port is up
- And more - TUI, snapshot diff, service name annotations, port utilities
- Linux & macOS - full support on both platforms; macOS works entirely without root

Quick look
Container visibility - which container owns each connection:

Process tree - full parent chain per connection:

Default output:

Installation
Requires Rust 1.88 or newer.
cargo install netls
Usage
netls netls --json netls --json --pretty netls --csv netls --watch netls --watch 5 netls --tui
Filters
netls --port 8080 netls --pid 1234 netls --process nginx netls --state established netls --proto tcp netls --ipv4 netls --ipv6 netls --no-loopback netls --listen netls --all
Filters can be combined:
netls --proto tcp --state listen
netls --proto tcp --port 443 --json
netls --no-loopback --state established
Extra columns
netls --queues netls --service-names netls --age netls --tree netls --systemd netls --fd netls --cmdline netls --containers netls --resolve-dns netls --resolve-proxy
Aggregation and analysis
netls --summary netls --summary --warn-timewait netls --summary --warn-timewait 200
netls --top netls --top 5
netls --count netls --sort port netls --group-by remote-ip
Snapshot and diff
netls --save before.json netls --diff before.json
Port utilities
netls --check-port 8080 netls --kill 8080 netls --kill 8080 --force netls --wait-for 8080 netls --wait-for 8080 --timeout 60
Output
Table (default)
Colors are enabled automatically when stdout is a terminal and disabled in pipes/redirects.
JSON
netls --json
{"proto":"tcp","local":"127.0.0.1:8080","remote":"127.0.0.1:54321","state":"ESTABLISHED","pid":1234,"process":"cargo","recv_q":0,"send_q":0}
{"proto":"tcp","local":"0.0.0.0:22","remote":"0.0.0.0:*","state":"LISTEN","pid":891,"process":"sshd","recv_q":0,"send_q":0}
{"proto":"tcp","local":"0.0.0.0:8443","remote":"0.0.0.0:*","state":"LISTEN","pid":null,"process":null,"recv_q":0,"send_q":0}
One JSON object per line. Use --pretty for human-readable output:
netls --json --pretty
{
"proto": "tcp",
"local": "0.0.0.0:22",
"remote": "0.0.0.0:*",
"state": "LISTEN",
"pid": 891,
"process": "sshd",
"recv_q": 0,
"send_q": 0
}
CSV
netls --csv
proto,local,remote,state,pid,process
tcp,127.0.0.1:8080,127.0.0.1:54321,ESTABLISHED,1234,cargo
tcp,0.0.0.0:22,0.0.0.0:*,LISTEN,891,sshd
Watch mode
netls --watch
Refreshes every 2 seconds. New connections are shown in green, closed connections in red. Exit with Ctrl+C.
netls --watch 5 --proto tcp --state established
TUI
netls --tui
Interactive mode with live updates, keyboard navigation, and inline filtering. Exit with q or Ctrl+C.
As a library
netls is also a Rust library for programmatic access to socket information:
[dependencies]
netls = "0.1"
use netls::{Filter, snapshot};
fn main() -> anyhow::Result<()> {
let filter = Filter::default().proto("tcp").state("ESTABLISHED");
let connections = snapshot(&filter)?;
for conn in connections {
println!("{} {} -> {}", conn.process.as_deref().unwrap_or("-"), conn.local, conn.remote);
}
Ok(())
}
License
Licensed under either of MIT or Apache-2.0 at your option.