#nushell-plugin #networking #nushell #plugin

app nu_plugin_net

A nushell plugin for enumerating network interfaces in a platform-agnostic way

5 stable releases

1.4.0 Apr 4, 2024
1.3.0 Nov 15, 2023
1.2.0 Sep 27, 2023
1.1.0 Aug 18, 2022
1.0.0 Jul 28, 2022

#397 in Network programming

Download history 21/week @ 2024-02-16 14/week @ 2024-02-23 8/week @ 2024-03-01 5/week @ 2024-03-08 9/week @ 2024-03-15 2/week @ 2024-03-22 141/week @ 2024-03-29 94/week @ 2024-04-05

247 downloads per month

MIT and maybe CC-PDDC

17KB
91 lines

nu_plugin_net

A nushell plugin to list system network interfaces

A simple and straightforward plugin. All of the heavy lifting is done by pnet. This package just translates the datatypes into a nu-accepatble format.

Format may be subject to change.

Examples

~> net
╭───┬──────────┬─────────────┬───────────────────┬────────────────┬───────────────────╮
│ # │   name   │ description │        mac        │      ips       │       flags       │
├───┼──────────┼─────────────┼───────────────────┼────────────────┼───────────────────┤
│ 1 │ lo       │             │ 00:00:00:00:00:00[table 2 rows]{record 5 fields} │
│ 2 │ enp2s0f0 │             │ 8c:8c:aa:1f:a5:2a │ [table 2 rows]{record 5 fields} │
│ 3 │ wlp3s0   │             │ c8:e2:65:c3:09:42[table 2 rows]{record 5 fields} │
╰───┴──────────┴─────────────┴───────────────────┴────────────────┴───────────────────╯
~> net | flatten flags
╭───┬──────────┬─────────────┬───────────────────┬────────────────┬───────┬──────────────┬─────────────┬───────────────────┬──────────────╮
│ # │   name   │ description │        mac        │      ips       │ is_up │ is_broadcast │ is_loopback │ is_point_to_point │ is_multicast │
├───┼──────────┼─────────────┼───────────────────┼────────────────┼───────┼──────────────┼─────────────┼───────────────────┼──────────────┤
│ 1 │ lo       │             │ 00:00:00:00:00:00[table 2 rows]truefalsetruefalsefalse        │
│ 2 │ enp2s0f0 │             │ 8c:8c:aa:1f:a5:2a │ [table 2 rows]truetruefalsefalsetrue         │
│ 3 │ wlp3s0   │             │ c8:e2:65:c3:09:42[table 2 rows]truetruefalsefalsetrue         │
╰───┴──────────┴─────────────┴───────────────────┴────────────────┴───────┴──────────────┴─────────────┴───────────────────┴──────────────╯
~> net | select ips | flatten | flatten
╭───┬──────┬──────────────────────────────┬────────╮
│ #type │             addr             │ prefix │
├───┼──────┼──────────────────────────────┼────────┤
│ 0 │ v4   │ 127.0.0.1/88 │
│ 1 │ v6   │ ::1/128128 │
│ 2 │ v4   │ 192.168.1.232/2424 │
│ 3 │ v6   │ fe80::8e8c:aaff:fe1f:a52a/6464 │
│ 4 │ v4   │ 192.168.4.189/2424 │
│ 5 │ v6   │ fe80::cae2:65ff:fec3:942/6464 │
╰───┴──────┴──────────────────────────────┴────────╯

Installing

This plugin can either be installed from crates.io, or built from source.

To install using cargo, run:

cargo install nu_plugin_net

To build from source, use:

git clone https://github.com/fennewald/nu_plugin_net.git
cd nu_plugin_net
cargo install --path .

Both of these processes will place a binary in ~/.cargo/bin/nu_plugin_net To register the plugin for use, just run:

register ~/.cargo/bin/nu_plugin_net

Changelog

Version 1.4.0

  • (@oraoto) Update for Nushell 0.92

Version 1.3.0

  • (@FMotalleb) Bump dependency versions
  • (@FMotalleb) Refactor: replaced structs with standard constructors

Version 1.2.0

  • Update for Nushell 0.84

Version 1.1.0

  • Use if_index instead of index, fixing the way table indexes are displayed

Dependencies

~15–49MB
~738K SLoC