https://github.com/kfn-d0/netfetch
neofetch but for network
https://github.com/kfn-d0/netfetch
cpp linux windows
Last synced: 20 days ago
JSON representation
neofetch but for network
- Host: GitHub
- URL: https://github.com/kfn-d0/netfetch
- Owner: kfn-d0
- Created: 2026-05-07T15:19:44.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2026-05-07T16:04:32.000Z (2 months ago)
- Last Synced: 2026-05-07T18:10:18.338Z (2 months ago)
- Topics: cpp, linux, windows
- Language: C++
- Homepage:
- Size: 85 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Netfetch
A lightweight, network diagnostic CLI for Windows and Linux, inspired by `neofetch`. It grabs your current network interfaces, speed, MTU, data usage, latency, public ASN/IP, and detects your OS to print it alongside a dynamic ASCII art logo.

## Key Features (Linux Improvements)
This version includes several enhancements for Linux environments:
- **Improved Latency Detection:** Falls back to the system `ping` command if raw socket permissions are missing.
- **Smart Speed Detection:** Includes a fallback to check parent USB device speed (useful for RNDIS/USB Tethering devices like Xiaomi/Samsung phones).
- **Accurate DHCP Info:** Better detection of dynamic address assignment on Linux.
## Building from Source
To compile the project from source, you need a standard C++ compiler.
**Windows (MinGW/GCC)**
To build the Windows executable with the embedded custom icon, make sure you link the resource file (`netfetch.res`) alongside the required networking libraries:
```bash
g++ netfetch.cpp netfetch.res -o netfetch.exe -lws2_32 -liphlpapi -lwininet
```
**Linux (GCC)**
To compile the binary for Linux, simply compile the source file. No external libraries are required:
```bash
g++ netfetch.cpp -o netfetch
```
## Installation
### Global Installation
To install `netfetch` globally so you can run it from any terminal:
#### Windows
1. Open PowerShell or Command Prompt **as Administrator**.
2. Run the executable with the install flag:
```bash
.\netfetch.exe --install
```
#### Linux
1. Open a terminal.
2. Run the compiled binary with the install flag:
```bash
sudo ./netfetch --install
```
### Manual Installation
- **Windows:** Copy `netfetch.exe` into your `C:\Windows` folder.
- **Linux:** Copy `netfetch` into your `/usr/local/bin` folder or `~/.local/bin/`.
## Usage
If you installed it globally, simply run:
```bash
netfetch
```
If you are running it locally without installing, use:
```bash
# Windows
.\netfetch.exe
# Linux
./netfetch
```
For a more compact view (hiding DHCP, MAC, etc.):
```bash
netfetch --compact
```